[Perl] delete hash key

Shlomo Yona shlomo at cs.haifa.ac.il
Sun Oct 13 03:53:32 PDT 2002

On Sun, 13 Oct 2002, Pinkhas Nisanov wrote:

> Last pm meeting Shlomo said that "delete" function on
> some hash key will not free memory allocated for this
> key's value ( Shlomo said he is not sure for it ) and
> garbage collector will free memory only when hole hash
> will undef.
> Does anyone know how it really works?

I believe it should be available for garbage collection.
Once you "delete" an element - it should remain orphan,
meaning its reference count is 0, thus being a candidate
for garbage collection.

This is what I understood.

Shlomo Yona
shlomo at cs.haifa.ac.il

More information about the Perl mailing list