![]() |
|
P is for Practical | |
PerlMonks |
Re: Overwriting exit and similarby jhourcle (Prior) |
on Jul 26, 2005 at 11:55 UTC ( #478148=note: print w/replies, xml ) | Need Help?? |
The easiest way to trap die is to just put everything in an eval block. Also see die for info about what you can do with $SIG{'__DIE__'}. exit is a little trickier, but you might be able to set something up in an END block. (I've never tried, myself... I'm not sure what would happen if you did a goto in an END block). I'd think you'd be better off just removing calls to exit, or changing them to die where appropriate, if that's possible.
In Section
Seekers of Perl Wisdom
|
|