Bug#627613: Mistaken aliasing of $& somewhere in the bowels of Perl

Niko Tyni ntyni at debian.org
Fri Jun 3 05:33:19 UTC 2011


On Sun, May 22, 2011 at 06:13:08PM +0100, Ian Jackson wrote:
> Package: perl
> Version: 5.10.1-17
> 
> Observe the transcript below.  You'll see that the other match against
> $thing seems to somehow pollute the use of $& in the assignment to
> Num, but only in the simple case.

It looks like the $& fetch magic gets called too late. Evaluating
it earlier, for instance with stringification, fixes things.

  % perl -E '$_="not ok"; for my $m ( (/ok/ and $&), /$_/) { say $m; last }'
  not ok
  %  perl -E '$_="not ok"; for my $m ( (/ok/ and "$&"), /$_/) { say $m; last }'
  ok

Still happens with 5.14.0. I'll forward this upstream.
-- 
Niko Tyni   ntyni at debian.org






More information about the Perl-maintainers mailing list