or download this
You can arrange for a callback to be run just before th
+e "die"
does its deed, by setting the $SIG{__DIE__} hook. The
...
feature was to be run only right before your program wa
+s to
exit, this is not currently the case--the $SIG{__DIE__}
+ hook is
currently called even inside eval()ed blocks/strings!