in reply to Re: Capturing all (and I mean all) output to a file
in thread Capturing all (and I mean all) output to a file
Looks good...
Only thing I can't do now is redirect STDERR to the $tee filehandle... Not sure if I've misinterpreted the IO::Tee instructions, or just have a poor grasp of IO operations!
See test code here:
use IO::Tee; use strict; my $tee = new IO::Tee(\*STDOUT, ">outfile.out"); #Test normal output print $tee "normal data\n"; #Test system commands my $cmdout = `dir /w`; print $tee $cmdout."\n"; #Check input questions work print $tee "Enter some data\n"; my $input = <>; print $tee $input; #Check stderr also goes to the file + screen. warn "Warning here\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Capturing all (and I mean all) output to a file
by chb (Deacon) on Jan 12, 2005 at 11:31 UTC | |
by flippy (Novice) on Jan 12, 2005 at 11:38 UTC | |
by gellyfish (Monsignor) on Jan 12, 2005 at 11:44 UTC | |
by flippy (Novice) on Jan 12, 2005 at 12:01 UTC | |
by gellyfish (Monsignor) on Jan 12, 2005 at 12:18 UTC | |
|