Redirecting file handler to STDOUT
- From: funkytwig@xxxxxxxxx (Ben Edwards)
- Date: Fri, 22 Jun 2007 10:57:34 +0100
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)
.
- Follow-Ups:
- Re: Redirecting file handler to STDOUT
- From: Paul Lalli
- Re: Redirecting file handler to STDOUT
- From: Xavier Noria
- Re: Redirecting file handler to STDOUT
- Prev by Date: Re: Proper class setup?
- Next by Date: Re: Proper class setup?
- Previous by thread: Proper class setup?
- Next by thread: Re: Redirecting file handler to STDOUT
- Index(es):
Relevant Pages
|