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