Your example shows you indexing the hash keys in the wrong order; it was trying to find the key named "1" in the %$results hash, which didn't exist. Use: foreach my $router ( sort {$results->{$a}{1}{cpu} <=> $results->{$b}{1}{cpu} } keys %$results ).
In reply to Re: Sorting hash
by pryrt
in thread Sorting hash
by bartrad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |