Mark wrote:

>>>-----Original Message-----
>>>From: mark sony [mailto:[EMAIL PROTECTED]
>>>Sent: mercoledì 20 agosto 2003 15.11
>>>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


I simply solve your problem in this manner (defining a sub log()...):

 . . .
 . . .
open (LOG, ">>my_log_file"); 
 . . .
&log("some text\n", 1, 1);      # log on screen AND log on file                 
 . . .
&log("some text\n", 1, 0);      # log on screen only                    
 . . .
&log("some text\n", 0, 1);      # log on file only                      
 . . .
close(LOG);
 . . .
 . . .
sub log() {
        my ($stg, $a, $b) = @_;
        print $stg if $a;
        print LOG $stg if $b;   
}

E.

LOQUENDO S.p.A. 
 Vocal Technology and Services 
 www.loquendo.it 
 [EMAIL PROTECTED] 



====================================================================
CONFIDENTIALITY NOTICE
This message and its attachments are addressed solely to the persons
above and may contain confidential information. If you have received
the message in error, be informed that any use of the content hereof
is prohibited. Please return it immediately to the sender and delete
the message. Should you have any questions, please contact us by
replying to [EMAIL PROTECTED] Thank you
====================================================================

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

Reply via email to