in reply to Are There Error Handlers in Perl?

You can actually set $SIG{__DIE__} with your handler, and it will be called before die does its deed. See perldoc -f die for more details....

Also, if you just want to trap just certain exceptions, then you will probably want to use eval { expression } which will trap die and set $@ to appropriate message.

If for some reason you want to use both of these in the same script, you'll want to be sure to read through the eval documentation to make sure you keep strangenesss to a minimum (would you really want to trap an error and have a SIG handler called and have die rethrown AGAIN???)

cephas