If the values of in the hash can all be considered "true" (as in your example), then you could simplify this further to:my $key = 'key01'; if (exists $hash{$key}) { print "$key is in hash"; }
my $key = 'key01'; if ($hash{$key}) { print "$key is in hash"; }
Liz
In reply to Re: Best way check key availability
by liz
in thread Best way check key availability
by banduwgs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |