in reply to Re: How do I output error messages to a file?
in thread How do I output error messages to a file?
which I will be coupling this withopen STDERR, ">", "/path/to/log";
I debug more with print statements than with the perl debugger, so this allows me to see my debugging statements along with the more serious perl complaints to see where my code is acting up.open STDOUT, ">", "path/to/log";
Thanks again to everyone who enlightened me.
UPDATE: Here's a simple demonstration that may be helpful to newbies.
#errorToOut.pl use strict; use warnings; open STDERR, ">>", "log.txt"; open STDOUT, ">>", "log.txt"; #outputted to stderr warn "warning!"; #outputted to stdout print "Test."; #Log.txt winds up looking like: #warning! at errorToOut.pl line 9. #Test.
|
|---|