1. Put a handler in $SIG{__DIE__}. You will get the fatal error message but the program will still die. (Unless you do some extra work. See the perlvar entry on %SIG for details.)
2. Wrap your possible fatality-producing code in an eval. Any fatal error will be put in $@ which you can send to your logging function. For example:
eval { $self->NonExistingFunction(); }; print "FATAL ERROR: $@" if $@;
In reply to Re: Catching warnings
by friedo
in thread Catching warnings
by Marcello
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |