70 parse_config($path_to_conf_file) if $path_to_conf_file; 100 # declare LOG file handle 101 my $LOG; 102 sysopen ($LOG, $path_to_log_file, O_WRONLY | O_APPEND | O_CREAT) 103 or die "Can't open $path_to_log_file: $!"; 104 # We'll try and keep a lock on the log file for the duration of our script 105 flock($LOG, LOCK_EX) or die "Can't get a lock on $path_to_log_file"; 201 if (/^log-file\s*=\s*(.+)$/) { 202 if (-d $1) { 203 warn "in $conf_filename line $.: $1 is a directory"; 204 next; 205 } 206 unless (-e $1) { 207 unless (open(LOG, ">", $1)) { 208 warn "in $conf_filename line $.: Cannot open $1 for writing: $!"; 209 next; 210 } 211 print LOG "[" . scalar(localtime()) . "] Created logfile\n"; 212 } 213 close(LOG); 214 $path_to_log_file = $1; 215 next; 216 }