- or download this
use FileHandle;
our $LOGFH; #can't figure out a way around using a global var here
...
$LOGFH->print(scalar localtime, ": running MyProgram.\n")
or carp 'Could not print to log.';
- or download this
$opt_v and $LOGFH->print("$count records were processed.\n")
or carp 'Could not print to log.';
- or download this
if ( !$opt_s ) {
$LOGFH->print(q{-} x 50, "\n") or carp 'Could not print to log.';
close $LOGFH or croak "Could not close the logfile: $!";
}