in reply to Re^4: Re Execute Lines of Code ("loops")
in thread Re Execute Lines of Code

After thinking about that for a while, I'm coming to like the idea. It clues in the reader that some unusual flow is going to happen with this loop so they can't assume the loop conditional is the end of the story. And it makes the unusual, mid-loop flow changes easier to spot.

I still prefer to just avoid such. But next time I find the desire to use one, I'll consider that option.

- tye        

  • Comment on Re^5: Re Execute Lines of Code (labels)

Replies are listed 'Best First'.
Re^6: Re Execute Lines of Code (labels)
by hipowls (Curate) on Jan 28, 2008 at 06:36 UTC

    Other advantages are that it doesn't break when

    LOOP: while(1) { last LOOP; }
    becomes
    LOOP: while(1) { while ( condition ) { last LOOP; } }
    and does the right thing in
    THING: for my $thing (@things) { redo THING; }