Dec 27, 2010, 6:57 AM
Post #3 of 7
shawnhcorey's solution will work often, but is strictly speaking not a general solution to your problem, because it will fail if an intermediary sub catches the exception. This could be the case if, for example, you are using a 3rd party framework, where you write the main program and the call back functions, but where the framework itself sits in "middle ground".
Re: [alexb] Any way to exit all subroutines at once?
[In reply to]
I have to impression that you are using something like setjmp/longjmp in C. This is (fortunately) not possible in Perl.
If however you have control over your whole application, an exception policy like shawnhcorey described will be the best solution.