in reply to Goto-labels for exception handling?
... did anybody ever try to use goto-labels for poor mans exceptions?
I didn't, because
{ test(); last; ERROR: warn "Caught Error..." , get_exception; some_func_which shouldn't::happen_after_exception() }
goto LABEL is poor man's flow control, and will introduce poor man's bugs. I never used labels other than for loops, e.g. to jump out of/resume an outer loop from within an inner, with last OUTER and such. I never used goto other than magic goto within AUTOLOAD blocks. For me, usage of goto LABEL is a code smell and a makeshift.
There are far better methods to handle exceptions. Why would you use goto LABEL if not for proving it can be done? what use cases do you have?
|
|---|