## capture 10 chars (with advancing), then move back 7: while ( $dna =~ /(.{10})/g ) { print "current window = $1\n"; pos $dna -= 7; }