Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How does one redirect STDERR to a file? ((Filehandle

by Fastolfe (Vicar)
on Sep 26, 2000 at 23:20 UTC ( [id://34090]=note: print w/replies, xml ) Need Help??


in reply to How does one redirect STDERR to a file? ((Filehandle, redirection, logging))

Redirect STDERR into a log file as the first thing your script does. Unfortunately, it's likely some module compile-time errors will go un-seen as a result, and get bumped into this stderr.log. Be sure to take a look there when you're debugging problems.
BEGIN { open(STDERR, ">stderr.log"); }

Replies are listed 'Best First'.
RE: Re: How does one redirect STDERR to a file? ((Filehandle
by ncw (Friar) on Sep 26, 2000 at 23:33 UTC
    That probably wanted to be :-
    BEGIN { open(STDERR, ">>stderr.log") or die "Failed to open log file"; }
    Note the >> and the or die.

    You could do this with a tied file handle too, as demonstrated recently by tilly - here

Log In?
Username:
Password:

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

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

    No recent polls found