Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List::MoreUtils::XS::pairwise allows variables to pollute into next iteration #10

Open
bleargh45 opened this issue Dec 22, 2020 · 0 comments

Comments

@bleargh45
Copy link

While testing updates to CPAN modules recently, I ran across a case where variables can persist and pollute across into the next iteration of a pairwise { ... } evaluation.

The following one-liner shows this pollution:

$ perl -MList::MoreUtils=pairwise -e '@let=qw(a b c); @num=qw(1 2 3); pairwise { my $out; $out.=$a; print "$out\n" } @let, @num'
a
ab
abc

When run with just the PP code, however, it works as intended:

$ LIST_MOREUTILS_PP=1 perl -MList::MoreUtils=pairwise -e '@let=qw(a b c); @num=qw(1 2 3); pairwise { my $out; $out.=$a; print "$out\n" } @let, @num'
a
b
c

Going back through past releases, I was able to trace this issue back to between 0.418 and 0.420_001; 0.418 works as intended, but 0.420_001 and all subsequent releases allow the value to pollute into the next iteration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant