J
Jeremy Phillips
Hi,
I am writing one of my first perl scripts and would like to send
output to a logfile and stdout simultaneously. In addition, I'd like
to be able to specify that some output only be sent to STDOUT or only
to the logfile.
Currently, I am using the following to print to stdout and the logfile
simultaneously.
open(STDOUT, "| tee -a $logFileName");
To print only to the logfile, I create a filehandle for it in the
usual sense
open(LOGFILE, ">>$logFileName");
The problem is that I have no way of specifying output to only
standard output, leaving the logfile alone. Can anyone tell me how to
do this? I would greatly appreciate any help.
Thanks,
Jeremy
I am writing one of my first perl scripts and would like to send
output to a logfile and stdout simultaneously. In addition, I'd like
to be able to specify that some output only be sent to STDOUT or only
to the logfile.
Currently, I am using the following to print to stdout and the logfile
simultaneously.
open(STDOUT, "| tee -a $logFileName");
To print only to the logfile, I create a filehandle for it in the
usual sense
open(LOGFILE, ">>$logFileName");
The problem is that I have no way of specifying output to only
standard output, leaving the logfile alone. Can anyone tell me how to
do this? I would greatly appreciate any help.
Thanks,
Jeremy