- or download this
use IO::Tee;
$tee = IO::Tee->new($handle1, $handle2);
print $tee "foo", "bar";
- or download this
$tee = IO::Tee->new(\*STDOUT, \*OUTFILE);
print $tee "Your data here" if .....
- or download this
use strict;
use warnings;
...
print $_ "Test string.\n" for \*STDOUT, $fh;
close $fh;