Now, I know one way of doing this, but I would like to see if there is an easier way.
I have some code such that:
my %hash2;
for my $key (sort {$hash1{$b} <=> $hash1{$a}} keys %hash1){
if (exists($hash2{$hash1{$key}})){
$hash2{$hash1{$key}}++;
} else {
$hash2{$hash1{$key}}=1;
}
}
Like I said, I can do it myself, just wondering is there was a easier way (easier being less lines/faster.) I know I loose the key that was put into my %hash1, but that's okay, becuase at this point I no longer need it.