open(my $fh, ">:raw", $file); binmode($fh, ":encoding(ucs2le)"); print $fh, "\r\n";