in reply to Re: restricting values to a nested datastructure
in thread restricting values to a nested datastructure
if (exists $a{'abd'} and exists $a{'abd'}->[0] and defined $a{'abd'}->[0])
There's no need to use exists. You know that $a{abd} is a reference if it exists, so just check if it is true. exists on array elements is deprecated, and doesn't really make much sense. So you can reduce this to:
if ($a{abd} && defined $a{abd}[0])
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: restricting values to a nested datastructure
by Marshall (Canon) on Dec 14, 2011 at 15:28 UTC | |
by zwon (Abbot) on Dec 15, 2011 at 02:21 UTC |