Ectaris has asked for the wisdom of the Perl Monks concerning the following question:
I was looking to do the same thing for STDERR and the answer I came up with seemed a little simpler:
open( logFile, ">log.txt"); *STDERR = *logFile;
Any reason why this shouldn't be used?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how do i redirect STDOUT, STDIN, or STDERR to a FILE? (*A=*B sucks)
by tye (Sage) on Dec 28, 2011 at 20:24 UTC | |
|
Re: how do i redirect STDOUT, STDIN, or STDERR to a FILE?
by ikegami (Patriarch) on Dec 28, 2011 at 17:45 UTC | |
|
Re: how do i redirect STDOUT, STDIN, or STDERR to a FILE?
by mr.nick (Chaplain) on Dec 28, 2011 at 17:48 UTC | |
|
Re: how do i redirect STDOUT, STDIN, or STDERR to a FILE?
by NetWallah (Canon) on Dec 28, 2011 at 18:35 UTC |