in reply to Getting STDIN and writing to a file
I would check for error on open. open FILE, ">file.txt" or die $!;
cheers
SK