Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2018-03-20 02:24 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (247 votes). Check out past polls.