Redirecting file handler to STDOUT



I am opening a log file:

open( LOGFILE, ">>cronlog.txt" );

This is being written to in lots of places.

I have been asked to change the program so if -m (manual) flag is
passed the stuff that goes to the log file is send to standard out
instead. Is it possible to change the above command to redirect
LOGFILE to STDOUT (i.e. make the two the same thing.

i.e.

if ( defined( $opt_m ) ) {
open( LOGFILE, STDOUT );
} else {
open( LOGFILE, ">>cronlog.txt" );
}

I even tried:

LOGFILE = STDOUT;

But I get:

Bareword "STDOUT" not allowed while "strict subs" in use

Whjenever I try to use STDOUT;(

Any ideas?
Ben
--
Ben Edwards - Bristol, UK
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)
.



Relevant Pages

  • Re: Redirecting file handler to STDOUT (SOLVED)
    ... On 22/06/07, Paul Lalli wrote: ... > passed the stuff that goes to the log file is send to standard out ... > LOGFILE to STDOUT (i.e. make the two the same thing. ...
    (perl.beginners)
  • Re: Loading mulitple files
    ... I removed logPath and included it as a Const for logFile. ... I now notify the admin with a result status and where the log file was ... dim logXML, logtext, arrLogs, arrText ... set att = logXML.createAttribute ...
    (microsoft.public.scripting.vbscript)
  • Re: Need Some Quick SBS/Exchange Help!
    ... This logfile has been damaged and is unusable. ... log-file fill pattern first appeared in sector 5452. ... Is there an antivirus program on this box that does not have the Exchange folders excluded? ... check the quarantined folder for the ..e00 log file. ...
    (microsoft.public.windows.server.sbs)
  • Re: Separate output for log file and stdout
    ... a function stdout ... Will this be possible using the built in python logging ... If you want to log the output of other commands in your log file, ... def createLogFile: ...
    (comp.lang.python)
  • Re: Separate output for log file and stdout
    ... a function stdout ... Will this be possible using the built in python logging ... If you want to log the output of other commands in your log file, ... def createLogFile: ...
    (comp.lang.python)