in reply to How can I sort my array numerically on part of the string?

You're one line away from the standard hash sorting idioms:
use strict; use warnings; use Data::Dumper (); my @list = ( '1,cat', '2,dog', '22,mouse', '11,eel', '001,elk', '13,mi +nk'); my %list = map { split /,/,$_ } @list; #<-- dis print Data::Dumper::Dumper(\%list);