in reply to Garbage Collection on Hash delete

Assignment, %hash = (); is quicker and neater. It may be neater yet to make the hash lexical and just let it go out of scope:

{ my %hash = ( foo => 'bar' ); # do stuff }
I generally use delete only when I know I want what remains of the hash later on.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Garbage Collection on Hash delete
by netoli (Initiate) on Jan 12, 2003 at 12:43 UTC
    Thanks. This is a neat approach you showed.
    In my case I have a hash with a lot of entries which is used in as object and I want to reuse the hash object afterwards.
    So I cannot use your approach.
    Any hints ?
    netoli