Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

RE: Allowing object destruction even with an

by BlaisePascal (Monk)
on Sep 08, 2000 at 05:50 UTC ( [id://31530]=note: print w/replies, xml ) Need Help??


in reply to Allowing object destruction even with an

Check out the question I wrote about Flyweight Objects and garbage collection to see an implementation of a "flyweight class". I got the idea from Damian Conway, who suggested it as a method of data hiding.

It does what you are doing -- stores the object in a list -- but instead of returning a blessed reference to the object, it returns a blessed index into the list. Add a DESTROY that undefs the entry in the list, and you get the behavior you want.

  • Comment on RE: Allowing object destruction even with an

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-20 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found