Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: close on STDERR

by archon (Monk)
on Jul 10, 2003 at 15:17 UTC ( [id://273011]=note: print w/replies, xml ) Need Help??


in reply to close on STDERR

no need to open or close it manually. just use warn() instead.

Replies are listed 'Best First'.
Re: Re: close on STDERR
by ChrisR (Hermit) on Jul 10, 2003 at 18:16 UTC
    I agree with that however it appears that Zaxo wants all his warnings and errors to go to a specific file. Warn just sends it to STDERR. I do not believe that opening and closing STDERR will cause any real problems though in his situation (redirection of standard error). However, the Camel book says that standard error is, "The default output stream for nasty remarks that don't belong in standard output. Represented within a Perl program by the filehandle STDERR. You can use this stream explicitly, but the die and warn built-ins write to your standard error stream automatically."

    However it also says, "Although filehandles STDIN, STDOUT, and STDERR start out with file descriptors of 0,1, and 2 (the Unix standard convention), even they can change if you start closing and opening them with wild abandon."

    I usually just pipe errors warnings to my log files using command line notation, ie:
    /usr/bin/perl script.pl 2>>/path/logfile

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-19 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found