greatshots has asked for the wisdom of the Perl Monks concerning the following question:

Hi PerlGurus

How to write the same content in 2 or more filehandles including STDOUT ?

Replies are listed 'Best First'.
Re: Writing in more FILEHANDLES
by tirwhan (Abbot) on Jun 27, 2007 at 10:52 UTC

    Well, you could just implement it yourself

    sub tee { my ($fh1,@output) = @_; print $fh1 @output; print @output; } open my $fh,">","thefile.txt" or die "horribly"; tee ($fh,"What I wanted to say");

    Or use IO::Tee

    use IO::Tee; my $tee = new IO::Tee(\*STDOUT,">thefile.txt"); print $tee "What I wanted to say";

    All dogma is stupid.