Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How can I save error message to a file?

by Zaxo (Archbishop)
on Jun 12, 2007 at 01:40 UTC ( [id://620616]=note: print w/replies, xml ) Need Help??


in reply to How can I save error message to a file?

If it's a special run, you can just redirect (./foo 2> /path/to/testlog.txt) from the command line. Otherwise,

open local(*STDERR), '>>', '/path/to/testlog.txt' or die $! if $TESTING;
You can remove the "if $TESTING" clause if you want to log all errors from this code. If you do that, you may want to include a timestamp in your warnings and dying words.

After Compline,
Zaxo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-25 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found