Larry Guest [LG], on Tuesday, January 11, 2005 at 15:40 (-0800)
contributed this to our collective wisdom:

LG> I have a script that does all kinds stuff.
LG> When its running it outputs all kinds of useful information to the
LG> screen and exits.
LG> What I want to do is have this also sent to a file.
LG> Any thoughts?

We have module for that, and here is also small example:

use IO::Tee;

my $tee = new IO::Tee(\*STDOUT, ">log.txt");
print join(' ', $tee->handles), "\n";  #could go away
for (1..10) { print $tee $_, "\n" }    #print to $tee handles
$tee->flush;
__END__

helps ?


-- 

 ...m8s, cu l8r, Brano.

[Anybody can win, unless there is a second entry.]



-- 
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