my $newline = "\n"; $newline = "\r\n" if grep $_ eq "crlf", PerlIO::ge­t_layers(*­STDOUT);