I read from a delimited file and create a hash of a hash of an array.See and that exactly is the problem :) Use an AoA and the sort will become trivial.
my @data; for $colour (sort keys %hash){ for $device (sort keys %{ $hash{$colour}}){ push @data, [ $colour, $device, $hash{$colour}{$device}[0] ] +; } } @data = reverse sort { $a->[2] <=> $b->[2] } @data;
In reply to Re: Sorting multi-hash values
by holli
in thread Sorting multi-hash values
by papai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |