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";
In reply to Re^2: Capturing all (and I mean all) output to a file
by flippy
in thread Capturing all (and I mean all) output to a file
by flippy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |