In unix there is a program called tee.

It works something like
program.pl | tee log.file

you just have program.pl write to STDOUT

alternatively, in your program, you could just do

my $log = "log.file";

open( LOG, ">>log.file" );
print "THING\n";
print LOG "THING\n";
close LOG;

( basically print twice for everything you print.


-----Original Message-----
From: mark sony [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 20, 2003 8:11 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: create log as well as print on screen

Hi All,

    I wrote a script which is running perfectly fine providing 
many outputs on the screen . Only glitch is that it does not print 
in a log file . Now what I want is that it would print on the 
screen as well as create a log file . At the end of the program  I 
will output that the above output can also be seen at the 
$log_File_position . Hope I am clear with my question . Any type 
of pointers and I would be over the moon ;)

Thanx in advance

Mark
___________________________________________________
Meet your old school or college friends from
1 Million + database...
Click here to reunite www.batchmates.com/rediff.asp



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