in reply to Re: Does redo create a new dynamic scope?
in thread Does redo create a new dynamic scope?

Probably so, but why was the enclosing block exited? Keep in mind the block enclosing the regexp is NOT the curlies, it's a larger one that includes the whole for loop.

According to what you are saying, the output of the loops below should both be the same ([a][]). They should both be the same ([a][a]), but the second is producing the wrong ouput. The answer to "why do these two loops have different outputs" is answer to the OP.

print("norm: "); for (my $i; $i ? $i<2 : 'a'=~/./g; ++$i) { print("[$&]"); } print("\n"); print("next: "); for (my $i; $i ? $i<2 : 'a'=~/./g; ++$i) { print("[$&]"); next; } print("\n");
norm: [a][a] next: [a][]