use strict; use warnings; my %hash = ( doc1 => 2345, doc2 => 1234, doc3 => 5678, doc4 => 4567, ); my @sorted_docs = sort { $hash{$a} <=> $hash{$b} } keys %hash; print join " " => @sorted_docs;
In reply to Re: sorting an array of hashes by the value of the keys
by artist
in thread sorting an array of hashes by the value of the keys
by campbell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |