in reply to Logging the results of 'die'
I personally would opt for the most straight forward way: Create a sub that logs the results to a file, and then call die.
# excuse the sloppy code... sub log_and_die { my $msg = shift; # suppose $fh is an already defined, opened # file handle. of course, you can open one here # as well... print $fh $msg; die $msg; } DBI->connect( ... ) || log_and_die( $! )
|
|---|