snafu has asked for the wisdom of the Perl Monks concerning the following question:
The following is what I am currently using. The latter is what I changed .
And what I changed from:if ( exists $ARGS{'q'} ) { $CRON_MODE = 1; sysopen(LOG,"$LOGDIR$LOGFILE", O_CREAT | O_APPEND | O_WRONLY) or die("Unable to open logfile: $LOGDIR$LOGFILE\n"); *STDOUT = \*LOG; print "Now running in cron/quiet mode to $LOGDIR$LOGFILE.\n"; }
Which of these ways is more preferred, if there is such a thing in this subject?if ( exists $ARGS{'q'} ) { $CRON_MODE = 1; close(STDOUT); sysopen(STDOUT,"$LOGDIR$LOGFILE", O_CREAT | O_APPEND | O_WRONL +Y) or die("Unable to open logfile: $LOGDIR$LOGFILE\n"); print "Now running in cron/quiet mode to $LOGDIR$LOGFILE.\n"; }
TIA
_
_
_
_
_
_
_
_
_
_
- Jim
Insert clever comment here...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Which is a better, more prudent way to redirecting STDOUT?
by belg4mit (Prior) on Jun 25, 2002 at 19:50 UTC | |
|
Re: Which is a better, more prudent way to redirecting STDOUT?
by Jenda (Abbot) on Jun 25, 2002 at 20:19 UTC | |
|
Re: Which is a better, more prudent way to redirecting STDOUT?
by Zaxo (Archbishop) on Jun 26, 2002 at 02:15 UTC |