use Carp qw/ cluck confess longmess /; # die of errors with stack backtrace confess("title: ($title)") # warn of errors with stack backtrace cluck("Before escaping title ($title)"); $title = $self->escape($title); cluck("After escaping title ($title)"); # longmess - return the message that cluck and confess produce $self->log_error( "title not set: " . longmess() ); #### perl -MCarp::Always your_program.pl #or, depending on the shell/CMD export PERL5OPT=-MCarp::Always set PERL5OPT=-MCarp::Always