|
6 | 6 |
|
7 | 7 | =head1 X<statements|control flow, statements>
|
8 | 8 |
|
9 |
| -Perl 6 programs consists of one or more statements. Simple statements |
| 9 | +Perl 6 programs consist of one or more statements. Simple statements |
10 | 10 | are separated by semicolons. The following program will say "Hello"
|
11 | 11 | and then say "World" on the next line.
|
12 | 12 |
|
@@ -327,7 +327,10 @@ unless 0 { "0 is false".say } ; # says "0 is false"
|
327 | 327 | my $c = 0; say (1, (unless 0 { $c += 42; 2; }), 3, $c); # says "(1 2 3 42)"
|
328 | 328 | my $d = 0; say (1, (unless 1 { $d += 42; 2; }), 3, $d); # says "(1 3 0)"
|
329 | 329 |
|
330 |
| -=head2 X<with, orwith, without|control flow,with orwith without> |
| 330 | +X<with|control flow,with> |
| 331 | +X<orwith|control flow,orwith> |
| 332 | +X<without|control flow,without> |
| 333 | +=head2 C<with>, C<orwith>, C<without> |
331 | 334 |
|
332 | 335 | The C<with> statement is like C<if> but tests for definedness rather than
|
333 | 336 | truth. In addition, it topicalizes on the condition, much like C<given>:
|
@@ -367,8 +370,8 @@ an outer block; they also both have a "statement modifier" form. But there is a
|
367 | 370 | difference in how following code in the same, outer block is handled: When the
|
368 | 371 | C<when> block is executed, control is passed to the enclosing block and
|
369 | 372 | following statements are ignored; but when the C<if> block is executed,
|
370 |
| -following statements are executed. N<There are other ways to modify the |
371 |
| -default behavior of each which are discussed in other sections.> The following |
| 373 | +following statements are executed. N<There are other ways to modify their |
| 374 | +default behavior; they are discussed in other sections.> The following |
372 | 375 | examples should illustrate the C<if> or C<when> block's default behavior
|
373 | 376 | assuming no special exit or other side effect statements are included in the
|
374 | 377 | C<if> or C<when> blocks:
|
|
0 commit comments