in reply to Re: Printing keys from a hash by value?
in thread Printing keys from a hash by value?
I'm confused! How is sort {$top_words{$b} <=> $top_words{$a}} different from reverse sort {$top_words{$a} <=> $top_words{$b}}?
Also how are the values being clobbered? I would understand this if we were 'reversing' the hash by creating a new hash where the values of the original hash were the keys of the derived hash. However I applied a reverse to a sort based on the values in the original hash. This is different from something like my %top_words = reverse %words;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Printing keys from a hash by value?
by aaron_baugher (Curate) on Jan 30, 2012 at 20:28 UTC |