G'day kp2a,
You may find one or more of these to be useful (some you may already know about):
-
The 'refs' stricture of the strict pragma. (The other strictures generate compile-time errors.)
-
Promote warnings to fatal errors.
-
Use eval to trap errors.
-
Use Carp routines to produce more verbose warning and error messages, including stack traces.
-
Use caller to get varying amounts of information from just the caller's package to a complete stack trace.
-
Write $SIG{__WARN__} and $SIG{__DIE__} handlers (see %SIG in perlvar).
-
Take a look at the information provided by the $!, $?, $@ and $^E Error Variables.
-
Use autodie to trap errors from specific functions.
-
CPAN modules such as TryCatch and Try::Tiny. Take a look at their SEE ALSO sections for similar modules.
-
A CPAN search for 'exception' may prove fruitful.