Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Global destruction feature / bug ?

by moritz (Cardinal)
on Apr 03, 2008 at 14:00 UTC ( #678166=note: print w/replies, xml ) Need Help??

in reply to Global destruction feature / bug ?

I can't answer your questions, but I would expect that the compiler/interpreter is free to destroy any object that isn't used anymore.

If you use the variable $foo in the END block, it's only destroyed afterwards.

Since lexical variables are only accessible from their scope, it's much easier for the compiler to proof that they aren't used from somewhere else anymore. our variables could still be referenced from END blocks in other packages.

BTW perlobj says

Since DESTROY methods can be called at unpredictable times, it is important that you localise any global variables that the method may update.

That's a pretty bold statement that should shouldn't rely on any particular order.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://678166]
[Corion]: I think there's always some Dell coupon around, at least I got one the last two times I bought a machine from them
[1nickt]: I have been an apostate in the Apple orchard for almost 15 years. But Dells are still high quality it seems, unlike Macs these days.
[1nickt]: And you can still configure the system at will, on the "Small Business" site.
[Corion]: 1nickt: I bought a 2015 XPS 13, which is a very nice and shiney (and somewhat overpriced) machine, but I think it's still better priced than an Apple machine. Now it just has to hold up 10 years like the old one did ;)

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (13)
As of 2017-03-27 12:58 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.