my $logfile = "/var/log/my.log" my $text = "Log entry text!" open(LOG, ">>$logfile") or die "Could not open file: $!"; print LOG $text; close LOG;