in reply to Re: Sorting and ranking
in thread Sorting and ranking
$rank[ $data{$_} ] .= "$_\n" for sort keys %data; defined and $n += print s/^/$n - /gmr for reverse @rank;
Clever as always :-) It should be noted, however, that memory usage (and speed) gets worse for increasingly large values in the hash, since it causes @rank to grow accordingly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Sorting and ranking
by tybalt89 (Monsignor) on Jan 23, 2018 at 00:50 UTC |