in reply to sorting an array of hashes by the value of the keys
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;
|
|---|