[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: exists $foo[7] and delete $foo[7]



On Thu, 13 Jan 2000 22:03:30 GMT, Alan Burlison wrote:
>I wasted nearly a day because of this on the first big perl program I
>wrote.  I use nested hashes quite often, and having to explicitly test
>all the way down the tree to avoid autoconfustication is a right royal
>pain,  i.e.
>
>if (! exists($h->{$a}) || ! exists($h->{$a}{$b}) || !
>exists($h->{$a}{$b}{$c}))
>
>instead of the much more obvious
>
>if (! exists($h->{$a}{$b}{$c}))

I suppose I ought to go and ask tchrist about how one would write:

   if (! exists($h->[$a][$b][$c]))

without a functional exists() on arrays, huh?  :-)


Sarathy
gsar@ActiveState.com


References to:
Alan Burlison <Alan.Burlison@uk.sun.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]