in reply to Re: Ignoring/Trapping the DIE signal in thread Ignoring/Trapping the DIE signal
I tried $SIG{__DIE__} variations as you can see in my code above, but it seems to die eventually anyway, as shown.
I've also tried adding an 'eval {};' around the code above ie 'eval {' just after the $SIG{__DIE__} = .. and then end the block ie '};' at the end of the script, but it fails in almost exactly the same way ie prints pretty much the same msgs, prints 'SIGDIE caught', then dies anyway... grrrr
Re^3: Ignoring/Trapping the DIE signal
by ioannis (Abbot) on Jun 15, 2006 at 02:08 UTC
|
__DIE_ handlers are different from other handlers.
For one, you cannot "catch it", if you try it will still fly away!
What is the purpose of a __DIE__ handler then? There are
two reasons:
- to alter the die message,
- to goto a subroutine (this time with the handler disabled).
But your days are numbered: receive another die and you are dead,
once the subroutine finishes your life is also finished.
| [reply] [Watch: Dir/Any] |
|