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

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

Thread Previous | Thread Next
patcat via RT
January 14, 2012 21:16
[perl #78194] Referencing a PADTMP twice produces two copies
Message ID:
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 . 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About