in reply to Playing with the Reference Count of variables (to create a POOL of objects wihtout mess with DESTROY).

Perhaps I'm exposing my ignorance, but I don't understand why you wish to implement such complicated VooDoo. You're going to be maintaining a hash containing references to all your objects anyways right? Therefor none of the objects can go out of scope till this hash does, as they're always going to have at least one ref count, right?

Am I just completely missing what your trying to do?
  • Comment on Re: Playing with the Reference Count of variables (to create a POOL of objects wihtout mess with DESTROY).

Replies are listed 'Best First'.
Re: Re: Playing with the Reference Count of variables (to create a POOL of objects wihtout mess with DESTROY).
by adrianh (Chancellor) on Apr 16, 2004 at 21:46 UTC
    Perhaps I'm exposing my ignorance, but I don't understand why you wish to implement such complicated VooDoo.

    It can be useful in maintaining object caches. If you want to only ever have one object of a specific value extant at any one time then a hash is an obvious choice, but you don't want the values in the hash interfering with the object collected when it falls out of scope.