Spooky has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: nested loops
by kennethk (Abbot) on Apr 16, 2010 at 15:25 UTC
    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.

      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.
Re: nested loops
by toolic (Bishop) on Apr 16, 2010 at 15:23 UTC
Re: nested loops
by ikegami (Patriarch) on Apr 16, 2010 at 15:27 UTC

    Yes.

    Occasionally? Sounds like the internals got messed up or something.