use Date::Calc qw(Decode_Date_US); use Data::Dumper; sub convertdate { return sprintf '%04d%02d%02d', Decode_Date_US($string) } # ST @sorted = map{ $_->[1] } sort{ $a->[0] <=> $b->[0] } map{ [ convertdate($_->{birth_date}), $_ ] } @list; print Dumper(\@sorted); # @keys array { my @keys = map convertdate($_->{birth_date}), @list; @sorted = @list[ sort {$keys[$a] cmp $keys[$b]} (0..$#list) ]; } print Dumper(\@sorted); # GRT @sorted = map{ ## Chop off the bit we added. substr( $_, 8 ) } sort map{ ## Note: No comparison block callback. ## Extract the field as before, but concatenate it with the original element ## instead of building an anonymous array containing both elements. convertdate($_->{birth_date}) . $_ } @list; print Dumper(\@sorted);