Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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.


Comment on Re: Global destruction feature / bug ?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-11-28 02:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (192 votes), past polls