in reply to Re: how to count the no of repeats in a string
in thread how to count the no of repeats in a string

if ($seen{$_}) { $seen{$_} += 1; } else { $seen{$_} = 1; }
can be simplified to
$seen{$_}++;

Your sort is also useless since hashes are unordered.