http://www.perlmonks.org?node_id=1012124


in reply to How does next label work?

I’m of the opinion that this sort of thing is the very worst kind of “Perl Golf” ... a game with all water-traps and no tee.   The construct is intended to go directly to the next iteration of a “real loop” as designated by the specified label-name.   If you are caught using it where no such loop exists (in the eyes of your co-workers, not Perl), and even if it so happens that Perl’s compiler accepts it, then you nevertheless richly deserve to be designated the one who gets to clean the coffee maker for the next full year.

(Urgh:   you do clean the coffee maker, don’t you??)

Replies are listed 'Best First'.
Re^2: How does next label work?
by LanX (Saint) on Jan 07, 2013 at 23:05 UTC
    The OP asked "How does next label work?" and provided an edge case example to emphasize his problem.

    Well that's perfectly normal ...and a well documented behavior is hardly "golf".

    And BTW Basic BLOCKs with redo at the end

    { ... ; redo if COND; }
    are a far saner way to realize do-while-loops.
    do { ... } while (COND)

    EDIT:

    I’m of the opinion that especially those coworkers which can't use perldoc -f should be restricted to clean the coffee maker. ;-)

    Cheers Rolf

Re^2: How does next label work?
by eyepopslikeamosquito (Archbishop) on Jan 08, 2013 at 08:19 UTC

    I'm of the opinion that this sort of thing is the very worst kind of "Perl Golf"
    Though it's been a while since I've agreed with your opinion, I strongly agree with you this time. It is shockingly bad golf; the label in "next label" is clearly unnecessary, an outrageous waste of precious strokes.

      ... and it is also reason enough to say that one should never, ever make coffee in the office.   Always go to Starbuck’s and order a triple-shot.   Because you never know when something sentient might emerge from the unwashed office coffee-pot ...