This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use concat overloading for "foo$_->$*"
authorFather Chrysostomos <sprout@cpan.org>
Tue, 17 May 2016 08:24:03 +0000 (01:24 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 17 May 2016 08:24:03 +0000 (01:24 -0700)
commitc3492809fd2c796c3cdab4de49e6c47560ce7f23
tree52ecf6394a62074cd13276651094a815f17907cd
parent94f9945d6a41925a75e4133e35315328b8f6dc39
Use concat overloading for "foo$_->$*"

This is the only discrepancy between $$_ and $_->$* that I know about.

To get ->@... interpolation to work, we have to emit a special
POSTJOIN token, which has just the right precedence to get it to apply
to the right amount of code before it, which perly.y then turns into a
regular join(...).

->$* and ->$#* were also going through that same code path, though it
turns out that simply omitting the POSTJOIN token for these dollar
tokens Just Works.  (I thought the fix would be more complicated.)

Now $_->$* within quotes becomes a direct argument to the concat ope-
rator, instead of being wrapped in a stringify(...) (what join(...)
optimises to with a single-item list).
t/op/postfixderef.t
toke.c