On Jul 29, Brian Volk said:

>Is there a way to print to both the STDOUT and a physical file. other than

If you want to make it transparent, use the IO::Tee module.  It's not
standard, though.

  use IO::Tee;
  my $tee = IO::Tee->new(\*STDOUT, ">> log.txt");
  print $tee "some line of text\n";

See:

  http://search.cpan.org/author/KENSHAN/IO-Tee-0.64/Tee.pm

-- 
Jeff "japhy" Pinyan         %  How can we ever be the sold short or
RPI Acacia Brother #734     %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %    -- Meister Eckhart


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to