open(FILE,">c:/temp/file.txt") or die "Unable to open file.txt for writing: $!"; print FILE "woohoo!\n"; close(FILE);