http://www.perlmonks.org?node_id=616966


in reply to Re: finding number of contiguous letters
in thread finding number of contiguous letters

The while loop worked fine with substring.

no need for such a complex route when using substr; map is your friend:

my @parts = map { substr $str, $_, 3 } 0..length($str)-3;