Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: The number of references to a variable

by jbert (Priest)
on Nov 26, 2007 at 11:54 UTC ( [id://652963]=note: print w/replies, xml ) Need Help??


in reply to The number of references to a variable

If you want objects which aren't referenced to go away, you could use store a 'weak' reference to each of your objects in your array, and the weak reference will become undef if there are no 'real' references left to the object. That might do what you need. (See Scalar::Util for weaken).

Otherwise, it seems an unusual route to go down and that makes me think it might not be the right path. Could you let us know more about your motivation for this, so we can offer an opinion on this?

  • Comment on Re: The number of references to a variable

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-24 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found