in reply to Re: Debugging My Perl
in thread Debugging My Perl

Another way would be to install die() and warn() handlers in %SIG to log to a file. Localise them to just the bit of code that you're interested in:
local $SIG{__DIE__} = sub { open LOGFILE, '>>logfile'; print LOGFILE 'die: ', @_; die("Died, errors logged to file\n"); } local $SIG{__WARN__} = sub { open LOGFILE, '>>logfile'; print LOGFILE 'warn: ', @_; close LOGFILE; }
It may also be useful to log a timestamp for all die()s and warn()s, and spit out stack traces.