develooper Front page | perl.perl5.porters | Postings from January 2012

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

Thread Previous | Thread Next
From:
patcat via RT
Date:
January 14, 2012 21:16
Subject:
[perl #78194] Referencing a PADTMP twice produces two copies
Message ID:
rt-3.6.HEAD-14510-1326489401-77.78194-14-0@perl.org
On Sun Jan 08 14:21:34 2012, sprout wrote:
................................
> Taking a reference to $_ twice should not create references to two
> different variables.  The implementation details are leaking through.
> 
I'll add my PerlMonks discussion to this
http://www.perlmonks.org/?node_id=941973 . PADTMPs should always be
copied (or sv body stolen ??), not referenced. srefgen/S_refto and newRV
do different things but they should be the same. PADTMPs are supposed to
be allocated and dealloced on block enterance/leaving, but under the
hood are effectively closures or C function level static. Its a mess.




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