in reply to nested loops

The tag you are looking for is <code> or <c> - wrap your entire source block in this and it will likely produce the result you are looking for. See Writeup Formatting Tips and/or Markup in the Monastery.

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
    Kenneth, ..not sure what you mean by "Post the sample code where perl cannot locate the label" ...could you elaborate? ..thanks!
      As per I know what I mean. Why don't you? and How do I post a question effectively?, proper diagnosis of an issue usually requires replicating it on a local machine. I can't truly know what's going on unless I see it on my box, so I need you to post code that demonstrates the problem. The code you did post seemed to be free of syntax errors as is the code I posted in response.