in reply to substr help

As davido says, you can do this with a regex too. Either play with pos a little bit:
## capture 10 chars (with advancing), then move back 7: while ( $dna =~ /(.{10})/g ) { print "current window = $1\n"; pos $dna -= 7; }
Or use a capture within a lookahead:
## capture next 10 chars without advancing, then advance by 3: while ( $dna =~ /(?= (.{10}) ) .{3}/gx ) { print "current window: $1\n"; }
For maintenance/readability reasons, you may be better off using a for loop and substr. I don't know, though; I kinda like the lookahead solution... it's cute.

blokhead