On Tue, Jan 20, 2009 at 04:51:58PM -0800, mich...@bizsystems.com wrote: > If I build a multi level hash struct that include hashs and arrays > within the hash and then pass it out to the user, does each element > within the structure have to be made mortal or only the first object.
Just the root element. > How does one deal with the refcnts on a structure of this nature. When the refcount to the root element goes away (and sv_2mortal is basically a delayed SvREFCNT_dec), it will destroy itself. During that process, it will decrement the refcounts of all of its children, and the destruction will cascade. Marvin Humphrey