Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
or simply delete the tree (assume all the nodes are automatically recovered)?sub deletenode { $node = shift; if ($node->{'child'}) { foreach ($node->{'child'}) { deletenode($_); } } else { $node = {}; } }
thanks in advance :)$tree = {};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Deallocating HASH pointer
by bsb (Priest) on May 11, 2004 at 09:20 UTC | |
by ysth (Canon) on May 11, 2004 at 09:31 UTC | |
by Steve_p (Priest) on May 11, 2004 at 11:17 UTC | |
by eXile (Priest) on May 11, 2004 at 15:15 UTC | |
|
Re: Deallocating HASH pointer
by hv (Prior) on May 11, 2004 at 09:49 UTC | |
by Doraemon (Beadle) on May 11, 2004 at 12:56 UTC | |
|
Re: Deallocating HASH pointer
by ysth (Canon) on May 11, 2004 at 09:22 UTC | |
|
Re: Deallocating HASH pointer
by mirod (Canon) on May 11, 2004 at 10:08 UTC |