Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^2: No DESTROY object.

by JavaFan (Canon)
on Jan 22, 2010 at 14:36 UTC ( #818968=note: print w/replies, xml ) Need Help??

in reply to Re: No DESTROY object.
in thread No DESTROY object.

That prints two different addresses. But since it's a sub that does refer to a lexical variable, it neither proves, nor disproves your claim about optimization.

But note this:

$ perl5.10.1 -we 'sub f { our $t; sub { $t } }; $x = f(); $y = f(); wa +rn "$x $y";' CODE(0x95ca930) CODE(0x95ca930) at -e line 1.
Same address. But not so in 5.8.9
$ perl5.8.9 -we 'sub f { our $t; sub { $t } }; $x = f(); $y = f(); war +n "$x $y";' CODE(0x867218c) CODE(0x8672258) at -e line 1.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://818968]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2016-10-25 05:51 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (315 votes). Check out past polls.