use Encode qw( encode_utf8 ); my $x = chr(1 << 63); my @Unsorted = ( 'Dog', 'Cat', 'Bird', undef, $x, 'Elephant', undef, 'Lizard' ); #### S:\Steve\Dev\PerlMonks\P-2017-06-12@0734-sort-undef>perl .\sort011.pl ------------------------------------------------------------------------------- Original: ------------------------------------------------------------------------------- Dog Cat Bird (undef) Wide character in print at .\sort011.pl line 58.  ÇêÇÇÇÇÇÇÇÇÇÇ Elephant (undef) Lizard ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Custom Sort: ------------------------------------------------------------------------------- Bird Cat Dog Elephant Lizard (undef) (undef) Wide character in print at .\sort011.pl line 58.  ÇêÇÇÇÇÇÇÇÇÇÇ ------------------------------------------------------------------------------- S:\Steve\Dev\PerlMonks\P-2017-06-12@0734-sort-undef>