stevendel has asked for the wisdom of the Perl Monks concerning the following question:
Any thoughts/suggestions?use IO::Tee; use IO::File; open(OLDOUT, ">&STDOUT"); open(OLDERR, ">&STDERR"); my $output_file = new IO::File(">tt1.out"); my $TeeOut = new IO::Tee(\*OLDOUT, $output_file); my $TeeErr = new IO::Tee(\*OLDERR, $output_file); open(STDERR, ">&", \*$TeeErr); select(STDERR); $| = 1; print $TeeErr "This goes to both STDERR and to the file.\n"; print STDERR "I would like this to do the same as above, but it goes n +owhere.\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Redirect to STDOUT and file
by ikegami (Patriarch) on Jan 10, 2008 at 05:30 UTC | |
|
Re: Redirect to STDOUT and file
by pilcrow (Sexton) on Jan 09, 2008 at 18:19 UTC | |
by ikegami (Patriarch) on Jan 10, 2008 at 05:19 UTC | |
by pilcrow (Sexton) on Jan 10, 2008 at 21:54 UTC | |
by ikegami (Patriarch) on Jan 12, 2008 at 05:28 UTC | |
|
Re: Redirect to STDOUT and file
by alexm (Chaplain) on Jan 09, 2008 at 18:46 UTC | |
by stevendel (Novice) on Jan 09, 2008 at 19:18 UTC | |
|
Re: Redirect to STDOUT and file
by absolut.todd (Monk) on Jan 10, 2008 at 01:51 UTC | |
|
Re: Redirect to STDOUT and file
by starbolin (Hermit) on Jan 09, 2008 at 20:09 UTC |