>type foo.pl my $logfile = 'foo.log'; open(my $log_fh, ">>", $logfile) or die "Can't open logfile: $!\n"; print $log_fh scalar(localtime), "\n"; >type foo.log The system cannot find the file specified. >perl foo.pl >type foo.log Thu Feb 21 17:59:01 2008 >perl foo.pl >type foo.log Thu Feb 21 17:59:01 2008 Thu Feb 21 17:59:05 2008