open(my $fh, '>:utf8', $qfn) or die; print $fh "\x{FEFF}"; print $fh $text; #### open(my $fh, '>:bytes', $qfn) or die; print $fh "\xEF\xBB\xBF"; binmode($fh, ':utf8'); print $fh $text;