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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.