http://www.perlmonks.org?node_id=331277


in reply to Sorting a hash by 3 different keys

So you want sorting based on comparison of ITEM1, 2, and 3 in that order? Try:
@sorted = sort { $hash{$a}{ITEM1} <=> $hash{$b}{ITEM1} || $hash{$a}{ITEM2} <=> $hash{$b}{ITEM2} || $hash{$a}{ITEM3} <=> $hash{$b}{ITEM3} } keys %hash;



Code is (almost) always untested.
http://www.justicepoetic.net/