in reply to Re: Synchronizing STDERR and STDOUT
in thread Synchronizing STDERR and STDOUT
That's been suggested, but it doesn't work :(
From perlfaq8:
Note that you cannot simply open STDERR to be a dup of STDOUT in your Perl program and avoid calling the shell to do the redirection. This doesn't work:
open(STDERR, ">&STDOUT"); $alloutput = `cmd args`; # stderr still escapes
This fails because the open() makes STDERR go to where STDOUT was going at the time of the open(). The backticks then make STDOUT go to a string, but don't change STDERR (which still goes to the old STDOUT).
Cheers,
Ovid
New address of my CGI Course.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Synchronizing STDERR and STDOUT
by shmem (Chancellor) on Sep 21, 2006 at 11:27 UTC | |
|
Re^3: Synchronizing STDERR and STDOUT
by nothingmuch (Priest) on Sep 21, 2006 at 11:10 UTC | |
by Ovid (Cardinal) on Sep 21, 2006 at 11:12 UTC | |
by nothingmuch (Priest) on Sep 21, 2006 at 11:20 UTC | |
|
Re^3: Synchronizing STDERR and STDOUT
by xdg (Monsignor) on Sep 21, 2006 at 15:58 UTC |