in reply to Re: Desparate behavior in loop labels
in thread Desparate behavior in loop labels

Just to make sure that I understand what is going on:

The "last LABEL" (in this case "quit") looks around locally for the label, and doesn't find it. It then jumps back through the stack to look for the label, and drops a warning when it does so?

I'd no idea that was possible. It sounds a little wonky, honestly, but I guess that's why it tosses a warning.

  • Comment on Re^2: Desparate behavior in loop labels

Replies are listed 'Best First'.
Re^3: Desparate behavior in loop labels
by mr_mischief (Monsignor) on Aug 29, 2007 at 16:03 UTC
    I think you've hit the nail on the head there.

    Contorted control flow can sometimes be handy, but as it can lead to a maintenance nightmare it deserves a warning.

    Perhaps more importantly, there's probably some history to why last works that way in Perl, too. Raising the warning and providing the former functionality rather than breaking the functionality is a good compromise for features that have been declared as questionable practice.

    Update: s/questionably/questionable/; to clarify that last sentence a bit.