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


in reply to Re^4: How does 'goto LABEL' search for its label? (yow?)
in thread How does 'goto LABEL' search for its label?

I didn't say it should be disallowed. I said it is squirrely. In particular, it is easy to see doing this by accident. So it is appropriate to issue a warning which even provides the opportunity to add a line indicating "yes, I really did intentionally use 'goto' to exit this subroutine".

And die is a less squirrely way to unwind a stack.

- tye        

  • Comment on Re^5: How does 'goto LABEL' search for its label? (yow!)

Replies are listed 'Best First'.
Re^6: How does 'goto LABEL' search for its label? (yow!)
by LanX (Saint) on Jan 17, 2013 at 04:11 UTC
    > I didn't say it should be disallowed.

    I didn't say you did! :)

    Just wanted to show a motivation for this technique.

    > And die is a less squirrely way to unwind a stack.

    ehm ... you mean within an eval block?

    Well tastes differ...

    EDIT: Hmm ... at least die can easily send a message...

    Cheers Rolf