in reply to nested loops
Assuming your label syntax follows the following prototype:
LOOP_A: for (my $i = 0; $i < @array1; $i++) { LOOP_B: for (my $j = 0; $j < @array2; $j++) { LOOP_C: for (my $k = 0; $k < @array3; $k++) { print "$i, $j, $k\n"; next LOOP_A if $j == $k and $i == $k; } } }
you do not have a syntax error in your labeling. Post the sample code where perl cannot locate the label, and we'll help you see the issue.
Side note: I am guessing from your for condition that you are using C-style for loops and not Perl-style for loops. It's not an error, but they are more error prone and require more typing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: nested loops
by Spooky (Beadle) on Apr 21, 2010 at 13:36 UTC | |
by kennethk (Abbot) on Apr 22, 2010 at 14:33 UTC |