in reply to counting overlapping patterns
There's also the simple:
while ("AAAA" =~ /A(A+)/g) { $count += length($1); } [download]
Unlike C's strlen, Perl's length doesn't loop, so this snippet is compliant with your request for no further looping.