JohnMG has asked for the wisdom of the Perl Monks concerning the following question:
and it seems to work.open MY_LOG, ">> /var/log/mylog.log" or die "Gah! $!"; open STDERR, ">&MY_LOG" or die "Couldn't redirect. $!";
I've also seen this funny notation that seems to do the same thing:
*STDERR = *MY_LOG;
What's that star-filehandle notation mean? Is it really doing the same thing as open STDERR, ">&MY_LOG"?
Finally, how to do I do $| = 1 on MY_LOG, so the STDERR messages and the messages printed to MY_LOG end up in the right order in the log file?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: redirect STDERR to my log file, also funny *FOO notation.
by chromatic (Archbishop) on Nov 14, 2005 at 20:51 UTC | |
by JohnMG (Beadle) on Nov 15, 2005 at 15:34 UTC | |
|
Re: redirect STDERR to my log file, also funny *FOO notation.
by Zaxo (Archbishop) on Nov 14, 2005 at 21:29 UTC | |
by JohnMG (Beadle) on Nov 15, 2005 at 15:42 UTC | |
|
Re: redirect STDERR to my log file, also funny *FOO notation.
by chrism01 (Friar) on Nov 15, 2005 at 00:42 UTC | |
by JohnMG (Beadle) on Nov 15, 2005 at 15:48 UTC | |
by OfficeLinebacker (Chaplain) on May 20, 2006 at 06:15 UTC |