foreach my $i (sort { $hash{array1}[$b][1] <=> $hash{array1}[$a][1] } @{$hash{array1}}) { print @$i[1], "\n"; }