2009/3/17 Chas. Owens :
> On Tue, Mar 17, 2009 at 09:30, Dermot wrote:
> snip
>> if ($x{$x}) inspects the key's value, not simply the existence of a key?
> snip
>
> Yes, but beware of autovivification (i.e. the creating of keys by
> trying to look at their values). You are safe with this simple
On Tue, Mar 17, 2009 at 09:30, Dermot wrote:
snip
> if ($x{$x}) inspects the key's value, not simply the existence of a key?
snip
Yes, but beware of autovivification (i.e. the creating of keys by
trying to look at their values). You are safe with this simple case,
but when dealing with HoHs or
2009/3/17 Jay Savage :
> On Tue, Mar 17, 2009 at 8:16 AM, Dermot wrote:
>> Hi All,
>>
>> I am unsure if the following statement is going to do what I want.
>>
>> I want to test if there is a value in $hash_ref{'someval'} NOT if the
>> key is defined. I'd also like to avoid un-sightly "undefined va
On Tue, Mar 17, 2009 at 8:16 AM, Dermot wrote:
> Hi All,
>
> I am unsure if the following statement is going to do what I want.
>
> I want to test if there is a value in $hash_ref{'someval'} NOT if the
> key is defined. I'd also like to avoid un-sightly "undefined value"
> errors.
Hi Dermot,
It
Dermot :
Hi All,
I am unsure if the following statement is going to do what I want.
I want to test if there is a value in $hash_ref{'someval'} NOT if the
key is defined. I'd also like to avoid un-sightly "undefined value"
errors.
So which of the following is best:
if (defined($hash_ref{'some
Hi All,
I am unsure if the following statement is going to do what I want.
I want to test if there is a value in $hash_ref{'someval'} NOT if the
key is defined. I'd also like to avoid un-sightly "undefined value"
errors.
So which of the following is best:
if (defined($hash_ref{'someval'}) {}