Skip to content

Commit 3ba293c

Browse files
committed
Merge pull request #314 from gfldex/master
better example for LABELs
2 parents f6ac8ca + a2356a0 commit 3ba293c

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

doc/Language/control.pod

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -682,16 +682,14 @@ All these forms may produce a return value the same way C<loop> does.
682682
=head2 LABELs
683683
684684
C<while>, C<until>, and C<for> loops can all take a label, which can be
685-
used to identify them for C<next>, C<last>, and C<redo>. For instance:
685+
used to identify them for C<next>, C<last>, and C<redo>. Nested loops are
686+
supported, for instance:
686687
687-
=begin code
688-
689-
LINE: for $*IN.lines -> $line {
690-
last LINE if $line ~~ /^$/; # exit when done with header
691-
...
692-
}
693-
694-
=end code
688+
OUTAHERE: while True {
689+
for lines() -> $line {
690+
last OUTAHERE if $line ~~ /^$/;
691+
}
692+
}
695693
696694
=head2 X<next|control flow>
697695

0 commit comments

Comments
 (0)