in reply to Count of Repeated Characters

It's customary to show what you've tried and to explain where you're stuck. Providing actual sample input and output is also helpful. The specification you have provided is incomplete; for example, what output do you want if the string is "aaa"? Are overlaps included or excluded from your result set?

But most importantly, this site is about helping people to understand and grow as Perl programmers. Questions that don't demonstrate an interest in that process are often off-topic here.


Dave

Replies are listed 'Best First'.
Re^2: Count of Repeated Characters
by santu4frnds (Initiate) on Apr 27, 2015 at 04:13 UTC

    Thanks for the reply. I tried splitting the two characters at a time from the string and able to get the count. But my requirement is to include the overlap as well that's where I am struck.

        while("dftaatzaaadfaa" =~ /aa/g) {$count++}