use open ':encoding(UTF-8)'; open(my $fh, '>', $qfn) or die("Can't create \"$qfn\": $!\n"); local $\ = "\x01"; print($fh $_) for @values;