How do I force a stack backtrace for all fatal errors in Perl?
See also the module "Carp::Always", which turns all dies and warns in your code to stacktraces.
Install a SIGDIE handler that calls Carp::confess? Or just set up Carp::confess as the handler for DIE?
Beware of the standard gotchas related to eval. There is an even weirder gotcha with regard to BEGIN blocks. Also note the ominous warning in perlvar.
See this question for more information on generating stack traces.