# either this: open( my $fh, ">:encoding(ucs2le):crlf", "filename" ); # or if that doesn't work, then this: open( my $fh, ">:raw:encoding(ucs2le):crlf", "filename" );