foreach $junk (sort {$b->{'count'} cmp $a->{'count'}} @data) { print "$junk->{'count'} --> $junk->{'type'} --> $junk->{'a_point'} --> $junk->{'z_point'} --> $junk->{'error'}\n"; }