http://www.perlmonks.org?node_id=640345


in reply to Re^2: Forcing stack trace?
in thread Forcing stack trace?

You can override the global __DIE__ handler something like (untested):
use Carp; $SIG{ __DIE__ } = sub { Carp::confess( @_ ) };

See perlvar for more info on %SIG.