can be simplified toif ($seen{$_}) { $seen{$_} += 1; } else { $seen{$_} = 1; }
$seen{$_}++;
Your sort is also useless since hashes are unordered.
In reply to Re^2: how to count the no of repeats in a string
by ikegami
in thread how to count the no of repeats in a string
by koleti
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |