## capture next 10 chars without advancing, then advance by 3: while ( $dna =~ /(?= (.{10}) ) .{3}/gx ) { print "current window: $1\n"; }