#!/usr/bin/perl # # Die with backtrace # use Carp; $SIG{__DIE__} = \&Carp::confess; callMethod(); sub callMethod { # blah blah someMethod(0); } Sub someMethod { 1/shift; } #### sub callMethod { local $SIG{__DIE__} = sub {confess ("error calling someMethod: $_[0]")}; someMethod(0); }