in reply to Re: Are defined or // garantee not to autovivify?
in thread Are defined or // garantee not to autovivify?
I do defined $hashtest{abc} and $hashtest{abc} because I want the false condition to be based on more than $hashtest{abc} being undef.
In that case, simply using $hashtest{abc} in boolean context is enough to cover undef as well. (Personally I'd add the defined test if I'm going to be using an operator that will give me a warning when used with an undef value.)
I would not use the mere existence of the key to mean anything
The difference between defined and exists becomes quite significant if one iterates over the hash (keys, values, each).
|
|---|