Both of the following examples of code work, however, being new to this kind of thing in Perl I am curious what those among the monks who know more than I do think.
The following is what I am currently using. The latter is what I changed .
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";
}
And what I changed from:
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";
}
Which of these ways is more preferred, if there is such a thing in this subject?
TIA
_
_
_
_
_
_
_
_
_
_
- Jim
Insert clever comment here...