in reply to Sort a Hash 3 Levels Deep

Something like this perhaps?
foreach my $key1 (sort keys( %hash ) ) { foreach my $key2 (sort keys( %{$hash{$key1}} ) ) { foreach my $key3 (sort keys( %{$hash{$key1}{$key2}} ) ) { } } }
PS: If it is not actually three levels deep, and you simply want to sort based on three different hash values, then you'll want to do something more like this:
@SortedArrayOfHashes = sort { return $a->{'key1'} cmp $b->{'key1'} or # if these are eq +ual try the comparison below $a->{'key2'} cmp $b->{'key2'} or # if these are eq +ual try below $a->{'key3'} cmp $b->{'key3'} #if these are equal, + then we give up; they're the same. } @ArrayOfHashes;