use Lingua::EN::Numbers qw(num2en); sub make_key { $_ = shift; s/^(?:The|An|A) // || s/^[^A-Z_]+(\d+)/num2en; return $_; } my @movies = ( '(500) Days of Summer', # F for Five hundred 'The Music Man', # M for Music 'The Good, the Bad, and the Ugly' # G for Good ); my @tmp = (); for (@movies) { push @tmp [ make_key($_), $_ ] # 2-element anonymous array } @tmp = sort { $a->[0] cmp $b->[0] } @tmp; # sort on first elements @movies = map { $_->[1] } @tmp; # pull off second element from each # anonymous array print "$_\n" for @movies; __END__ Prints: (500) Days of Summer The Good, the Bad, and the Ugly The Music Man