Anonymous user
Loops/Continue: Difference between revisions
→{{header|Perl}}
(adding gap) |
|||
Line 641:
}
print ', ';
}</lang>
It is also possible to use a goto statement to jump over the iterative code section for a particular loop:
<lang perl>foreach (1..10) {
print $_;
if ($_ % 5 == 0) {
print "\n";
goto MYLABEL;
}
print ', ';
MYLABEL:
}</lang>
|