in reply to Re: Forcing Array Context
in thread Forcing Array Context

Thanks. One follow-up question: would the %hash = ( foo => []); blank the rest of %hash if it were used in a loop like I posted?

Replies are listed 'Best First'.
Re: Re: Re: Forcing Array Context
by broquaint (Abbot) on Jun 25, 2003 at 09:51 UTC
    Yep, %hash would be blanked. That particular line was just verbose initialization as push will auto-vivify the key and the array reference (i.e it will create both automatically). So assuming you're happy to initialize each key then a simple $hash{foo} = [] will suffice.
    HTH

    _________
    broquaint