http://www.perlmonks.org?node_id=221032


in reply to count sort & output

1. by nature keys in hashes are unique. so if your key is www.yahoo.com, it can only appear once in your hash. so just increment $hash{$key} each time the key appears. (i.e. $hash{$key}++;).

2. You can use sort.

@descending_values = sort {$hash{$b} <=> $hash{$a} } keys %hash;

3. Show us what you have already, and we can help you from there.

-enlil