in reply to Catching perl warnings and errors
Take a look at the __WARN__ and __DIE__ signal handlers in perlvar for one way to catch die & warn messages.
However, be careful of the die handler since it can cause problems in shared environments like mod_perl. If used incorrectly it can also foul up people using die for exception handling. Read the docs in perlvar and on die carefully.
It may be simpler to override the CORE::GLOBAL::die() routine and substitute your own that does the appropriate logging calls.
|
|---|