Help for this page

Select Code to Download


  1. 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.';
    
  2. or download this
     $opt_v and $LOGFH->print("$count records were processed.\n")
       or carp 'Could not print to log.';
    
  3. 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: $!";
    }