Skip to content

Commit

Permalink
Elaborate a bit on blockless NEXT phasers
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jun 3, 2018
1 parent d2b0952 commit 09a6e6d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion doc/Language/5to6-nutshell.pod6
Expand Up @@ -879,7 +879,7 @@ Unchanged:
=head3 C<continue>
There is no longer a C<continue> block.
Instead, use a C<NEXT> block within the body of the loop.
Instead, use a C<NEXT> block (phaser) within the body of the loop.
=for code :lang<perl5>
# Perl 5
Expand All @@ -903,6 +903,17 @@ Instead, use a C<NEXT> block within the body of the loop.
}
}
Please note that phasers don't really need a block. This can be very handy
when you don't want another scope:
=for code
# Perl 6
my $str = '';
for 1..5 {
next if $_ % 2 == 1;
$str ~= $_;
NEXT $str ~= ':';
=head1 Functions
Expand Down

0 comments on commit 09a6e6d

Please sign in to comment.