Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: weaken CODEREF

by Haarg (Chaplain)
on Nov 11, 2013 at 09:59 UTC ( #1061969=note: print w/replies, xml ) Need Help??


in reply to weaken CODEREF

Also, weaken is working properly on the coderef. You can see this by checking the ref counts using Devel::Peek. The ref count just never reaches 0 because perl itself is holding the last reference.

Weakening a non-closure sub is also not particularly useful. Weakening is meant to be used to prevent memory leaks, but the existence of a non-closure sub can't cause memory leaks. perl has to have a reference to the compiled sub anyway, and without a closure you can't create reference loops.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1061969]
help
Chatterbox?
[Corion]: Most likely Regexp::Debugger uses something in main:: ;)
[Corion]: Hmm - no, nothing jumps out immediately
Corion jumps into bed
[choroba]: On the indicated line, it uses (caller 1)10
[choroba]: (caller 1)[10] that is

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2017-09-25 21:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (291 votes). Check out past polls.

    Notices?