carsonholt has asked for the wisdom of the Perl Monks concerning the following question:
I have a strange error that occurs in code I wrote. I'm trying to redirect STDOUT and STDERR to a log file. When I run the program, sometimes it works and sometimes I continue to get STDOUT to the screen in addition to the log file. I don't change the code. I just re-run the program and I get different results each time. Here's how I redirected the output. If someone knows why this would be happening, please let me know.
warn "QUIET MODE: Program operations and errors are being redirected t +o the file arbol.log\n"; close (STDERR); open (STDERR, "> ".$outpath."/arbol.log"); open (NEW_OUT, ">&STDOUT"); open (STDOUT, ">&STDERR");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Redirecting output
by almut (Canon) on Jul 18, 2007 at 21:37 UTC | |
|
Re: Redirecting output
by carsonholt (Initiate) on Jul 18, 2007 at 21:38 UTC | |
by FunkyMonk (Bishop) on Jul 18, 2007 at 23:07 UTC | |
|
Re: Redirecting output
by Akoya (Scribe) on Jul 18, 2007 at 21:26 UTC | |
|
Re: Redirecting output
by wojtyk (Friar) on Jul 18, 2007 at 21:28 UTC | |
by chromatic (Archbishop) on Jul 19, 2007 at 02:57 UTC |