Subject: | Infinite loop if peek_my() called in conext of 'each' |
The following loops, printing the same value over and over forever:
#!/usr/bin/perl
use strict; use warnings;
use Data::Dumper;
use PadWalker;
sub f($) {
while (my ($vn, $vr) = each %{ PadWalker::peek_my(1) }) {
print " $vn = ", Data::Dumper->Dump([$vr]);
}
}
sub g { my $gvar = 123; f(shift); }
g(2);