http://qs1969.pair.com?node_id=580750


in reply to What magic is this?

Yes, when you use $SIG{__DIE__} it will get called if the program would die irrespective of whether there is an eval { } around the point that is dying, as you can see from:

$SIG{__DIE__} = sub { print "die handler: " , @_ }; + eval { die "DIE NOW"; }; + print "Still alive";
The program doesn't "die" but the "__DIE__" handler gets called nonetheless. This is the documented behaviour. You'll need to rethink the way you are handling errors.

/J\