This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Deparse join("", pos) correctly
I optimised join into stringify if it had a list of one scalar-
returning op.
$ ./perl -Ilib -MO=Deparse -e '$_ = join $foo, $bar'
$_ = "$bar";
-e syntax OK
The problem, though, is that we now create op trees that didn’t happen
before,* and B::Deparse can’t handle them correctly:
$ ./perl -Ilib -MO=Deparse -e '$_ = join $foo, pos'
$_ = "pos($_)";
-e syntax OK
So we need to turn that into:
$_ = join('???', pos);
* Actually, in 5.8 it was possible to interpolate arbitrary expres-
sions after ‘$_[0]->’:
$_ = "\n,rekcah lreP rehtona tsuJ"; sub a{chop}
print "${[bless[]]}[0]->a . reverse $_";
And that, consequently, did not deparse properly.