use strict; use warnings; my $output = "output2.txt"; die "can't open output file: $!" unless open FH, ">$output"; printf(FH "%s\r\n", "I wonder any junk charcter will be printed to the file on windows"); close FH;