On Jan 29, 2008 1:26 AM, Andrew Limareff <[EMAIL PROTECTED]> wrote:
> Chas. Owens wrote:
>
> > You initialize a hash with a list.  So if you want an empty hash then
> > you need to assign an empty list to it:
> >
> > %hash = ();
> >
>
> Couldn't you go
>
> undef( %hash );
>
> to get an undefined ref - leaving the old contents for the system to
> free up?

Yes, TIMTOWTDI.  I chose the way closest to one in the original
posters code; however, I still hold that the desire to empty a hash of
all keys is a red flag that the hash has too large of a scope and you
should be examining why you want to do it rather than how to do it.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to