in reply to $SIG{__DIE__} not working as expected

Perhaps this part of the perldoc -f die documentation explains what is going on:
    You can arrange for a callback to be run just before the "die"
    does its deed, by setting the $SIG{__DIE__} hook. ...
You can change the message by die-ing again in your handler, but you cannot prevent death.

If you need to continue, wrap your code in an eval block:

eval { ... die "Hi!"; }; print "cheated death!\n";

Replies are listed 'Best First'.
Re^2: $SIG{__DIE__} not working as expected
by educated_foo (Vicar) on Jun 09, 2008 at 01:06 UTC
    Or just override die:
    { local *CORE::GLOBAL::die = sub { print "Really die? "; if (($resp = <STDIN>) =~ /^y/i) { CORE::die @_; } else { print "narrowly averted: @_\n"; } }; # do the thing that dies }