develooper Front page | perl.perl5.porters | Postings from June 2011

[perl #78194] Referencing a PADTMP twice produces two copies

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
June 5, 2011 16:05
Subject:
[perl #78194] Referencing a PADTMP twice produces two copies
Message ID:
rt-3.6.HEAD-16080-1307315093-1574.78194-14-0@perl.org
On Sun Oct 03 14:08:37 2010, sprout wrote:
> $ perl  -le' for( "$y" ){print \$_.\$_}'
> SCALAR(0x8039f0)SCALAR(0x8038d0)
> 
> (The same address should be printed twice.)
> 
> It looks as though the TARG ought to be stolen by S_refto, and then
> replaced via pad_swipe or something similar.

It might be cleaner for not only S_refto, but also any op that aliases a
PADTMP to copy it. That would include for, map, grep, arguments to
subroutines, and the lhs of (...)x...


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About