in reply to extracting substrings

I guess a real question is what do you want to do when they overlap, since you're storing them all into the same array. That said, it seems that you would do a lot better to use substr instead of going through the letters one at a time. Also, instead of using separate $start1, $start2, etc, I'd suggest using an array of start and stop positions.
for $i (0..$#start){ $seq[$i] = substr($sequence, $start[$i], $stop[$i]); }