use Unicode::Collate; my $alphasorter_modul = Unicode::Collate->new(); my $alphasorter_regex = qr{[^0-9 a-z!"ยง$%&/()=?\{\[\]\}\]><|_\-+*,.:;#'~\^]}ix; my $alphasorter = sub { $_[0] =~ $alphasorter_regex || $_[1] =~ $alphasorter_regex ? $alphasorter_modul->cmp($_[0],$_[1]) : lc $_[0] cmp lc $_[1] };