@@ -12,8 +12,8 @@ Synopsis 4: Blocks and Statements
12
12
13
13
Created: 19 Aug 2004
14
14
15
- Last Modified: 30 July 2014
16
- Version: 134
15
+ Last Modified: 18 Aug 2014
16
+ Version: 135
17
17
18
18
This document summarizes Apocalypse 4, which covers the block and
19
19
statement syntax of Perl.
@@ -326,8 +326,7 @@ invocant to the C<.haste> method.)
326
326
327
327
Conditional statement modifiers work as in Perl 5. So do the
328
328
implicit conditionals implied by short-circuit operators. Note though that
329
- the contents of parens or brackets is parsed as a semicolon-separated list of
330
- I<statements>,
329
+ the contents of parens or brackets is parsed as a statement,
331
330
so you can say:
332
331
333
332
@x = 41, (42 if $answer), 43;
@@ -336,6 +335,10 @@ and that is equivalent to:
336
335
337
336
@x = 41, ($answer ?? 42 !! ()), 43
338
337
338
+ (Only a single statement is allowed inside parens or brackets; otherwise
339
+ it will be interpreted as a LoL composer.
340
+ See L<S02/"Multidimensional slices and parcels">.)
341
+
339
342
=head1 Loop statements
340
343
341
344
Looping statement modifiers are the same as in Perl 5 except that,
@@ -627,7 +630,7 @@ left parenthesis, much like the C<$> operator in Haskell. That is,
627
630
precedence decisions do not cross a C<do> boundary, and the missing
628
631
"right paren" is assumed at the next statement terminator or unmatched
629
632
bracket. A C<do> is unnecessary immediately after any opening bracket as
630
- the syntax inside brackets is a semicolon-separated list of statements,
633
+ the syntax inside brackets expects a statements,
631
634
so the above can in fact be written:
632
635
633
636
@primesquares = ($_ if .is-prime for 1..100) »**» 2;
0 commit comments