Putting the capturing parens outside the lookahead captures only the characters actually consumed. Putting them inside the lookahead will capture what the lookahead would have consumed (had it not been zero-width). So you'd have to do something like
while ($str =~ /(?=(..{$len}))./g) {
print pos, "$1\n";
}
That reads the whole desired capture as a lookahead, then consumes the one char.
Caution: Contents may have been coded under pressure.