in reply to Deallocating HASH pointer

You only need to worry about memory if you have a circular reference (say a "parent" link).
$tree = undef;
might be better. You'll get a warning later if you try to use it.

See WeakRef and Data::Structure::Util's has_circular_ref

Replies are listed 'Best First'.
Re: Re: Deallocating HASH pointer
by ysth (Canon) on May 11, 2004 at 09:31 UTC
    You'll get a warning later if you try to use it.
    Not necessarily:
    #line 1 use strict; use warnings; our $tree; $tree = {}; $$tree{autov} = "ivify"; warn %$tree; # vs. $tree = undef; $$tree{autov} = "ivify"; warn %$tree;
Re: Re: Deallocating HASH pointer
by Steve_p (Priest) on May 11, 2004 at 11:17 UTC
Re: Re: Deallocating HASH pointer
by eXile (Priest) on May 11, 2004 at 15:15 UTC
    you might even want to do:
    undef $tree
    this will remove the complete $tree variable from your scope, not just 'undef' it.