use strict; use FileHandle; my $LOG = "/tmp/log.txt"; my $fh = FileHandle->new(">> $LOG"); print $fh "this is a test"; $fh->close;