in reply to cat "file" functionality within Perl
Is there not a way to redirect STDOUT to BOTH a file and STDOUT at the same time?
Usse IO::Tee
use IO::Tee; open (my $fh, ">","/cache/some/file.html") or errout(); # Note, don't use || here my $tee = IO::Tee->new(\*STDOUT,$fh); print $tee "content"; $tee->flush(); close $fh or errout();
|
|---|