Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Logging the results of 'die'

by lestrrat (Deacon)
on Jun 08, 2001 at 23:57 UTC ( [id://87039]=note: print w/replies, xml ) Need Help??


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( $! )

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://87039]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-25 10:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found