YES! Mostly, we have goto LABEL and goto EXPR for the sake of completeness. People expect them to be there, and there they are. This is useful.
But much more importantly, goto can be used to eliminate / substitute one subroutine call for another. For example, suppose you have a subroutine which uses caller. Now, what if that sub is called by and AUTOLOAD in the same package. You've borked your caller. But, if you goto to the subroutine, then even caller can't figure out that AUTOLOAD itercepted the call.
Cheers,
Erik
Light a man a fire, he's warm for a day. Catch a man on fire, and he's warm for the rest of his life. - Terry Pratchet
| [reply] [d/l] [select] |
I think that's like "The -w switch is not mandatory."
If you know, what you do, it can be (in a very strange and unimaginable situation) usefull to have goto. | [reply] |
"unimaginable situation" is of course nonsense, as erik wrote about AUTOLOAD i remembered even i had used goto &$subref for nested AUTOLOAD routines in a module that exports an AUTOLOAD routine to the use()ing package but gives a possibility to specify a sub-reference that handles function that could not be found by the current AUTOLOAD routine.
| [reply] |