Or if you don't have the option of installing a new module, you can make a
poor man's version with a sub.  The example below will take a string passed
to it and print it to tee.txt and the screen.

#######################################

sub Tee{
  open(TEEFILE,">>tee.txt");
  print TEEFILE $_[0];
  print $_[0];
  close TEEFILE;
}

#######################################

-----Original Message-----
From: Jenda Krynicky [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002 9:30 AM
To: '[EMAIL PROTECTED]'
Subject: Re: printing to 2 seperate places simultaneously


From:                   "HENRY,MARK (HP-Roseville,ex1)" <[EMAIL PROTECTED]>
> I want a script to print log messages to a file, and within the same
> statement, to the screen (STDOUT) simultaneously.  Can the print
> statement be coerced into doing this, or is there another way of
> achieving the same result?

http://Jenda.Krynicky.cz/#Local::TeeOutput
or
http://search.cpan.org/search?dist=IO-Tee

Jenda
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
                                        --- me


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to