こんなのでどうだろう

open(OUT, ">>", "test.dat") or die "cannot open/create `test.dat': $!";
print OUT "NEW LINE\n";
close(OUT);