Wednesday, October 22, 2014

sort hash by value and return the associated key

If instead you want to sort by numeric hash values, you'd write:
foreach my $key  (sort { $hash{$a} <=> $hash{$b} } keys %hashes)  {  do something; }

No comments:

Post a Comment