in reply to algorithm question: want to sort keys of hash by their values.

for my $key (sort { $hash{$b} <=> $hash{$a} } keys %hash) { print $hash{$key}; }
substitute <=> with cmp for string sort instead of numeric sort.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.