Re: Can Perl redirect STDOUT to file AND to command window?



**** SUMMARY **** (for those on the Google quest)

use strict;
use IO::Tee;

my $tee = IO::Tee->new(\*STDOUT,">out.txt");
select $tee;

print "Hello World\n"; # will print Hello World to both cmd window and
../out.txt

R

.