in reply to
counting overlapping patterns
Why not let Perl do the incrementing itself?
$count = () = "AAAA" =~ m/(?=AA)/g;
Comment on
Re: counting overlapping patterns
Download
Code
In Section
Seekers of Perl Wisdom