use File::Temp; use File::Spec; print "hello1\n"; # defaults to CRLF, as documented. open F, ">", "out2.txt"; # ditto. print F "hello2\n"; open F, "> :utf8", "out3.txt"; # still CRLF print F "hello3\n"; open F, ">", "out4.txt"; binmode F, ":utf8"; # still OK! print F "hello4\x{b6}\n"; $h= new File::Temp( TEMPLATE => 'helloXXXXX', SUFFIX => $suffix, UNLINK => 0, DIR => File::Spec->tmpdir()); $fname= $h->filename; print "sending out5 to $fname\n"; # binmode $h, ":utf8"; # no CR, shows 0x0A only. But :utf8 silences warning. print $h "hello5\x{b6}\n";