admitted this is more of a rough draft, but the method should be clear from these few lines.use Symbol 'gensym'; our $log = gensym; open $log, ">/path/to/logfile" or die $!; our $DEBUG = 1; sub add_log; local $SIG{__WARN__} = sub { &add_log(shift) }; local $SIG{__DIE__} = sub { &add_log(shift); exit 1 }; sub add_log { print $log, shift(); flush $log if $DEBUG; } sub DESTROY { close $log; }
In reply to Re: error report
by TOD
in thread error report
by steph_bow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |