# Array of hashes: Sort our data by age @people = sort { $a->{age} <=> $b->{age} } @people; print "\nUsing a hash, sorted by age\n"; for my $hr (@people) { print "$hr->{first} $hr->{last} $hr->{age}\n"; }