Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Additional examples in "Statement-level bare blocks"
  • Loading branch information
lizmat committed Apr 28, 2013
1 parent 3acfeda commit 432411a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions S04-control.pod
Expand Up @@ -693,6 +693,15 @@ followed by a statement modifier:
# Not an error: Equivalent to "if foo() -> $x { say $x }"
{ say $^x } if foo();

It's not an error to pass parameters to such a block either:

{ say $^x + $^x }(5);

But as always, you must use them all:

# Syntax error: Too many positional parameters passed
{ say $^x + $^x }(5,6);

=head2 The C<gather> statement prefix
X<gather>X<take>

Expand Down

0 comments on commit 432411a

Please sign in to comment.