Steffen Beyer wrote:

> Basically, after building your data structure, you save the current
> ref-count (minus 1) of the object in question somewhere (in a private
> attribute of that object) and set the ref-count to one.
> 
> When the user abandons his/her last reference to this object, DESTROY()
> gets called. DESTROY() must then add the previously stored ref-count
> (minus 1) to the current ref-count in order to restore the correct
> ref-count. Then you can deconstruct your object's data structure.

I'm sorry, but I think this really is fundamentally evil.  At some level
the need to explicitly diddle refcounts in this manner reflects some
level of brokenness either in your module or in perl.  Whilst it might
work for you, I really don't think you should recommend this practice to
others.

Alan Burlison

Reply via email to