Can't call method "close" on an undefined value at ...... line ...... #### use strict; use FileHandle; my $LOG = "/tmp/log.txt"; my $fh = FileHandle->new(">> $LOG"); print $fh "this is a test"; $fh->close;