in reply to Best way check key availability
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Best way check key availability
by Anonymous Monk on Sep 11, 2003 at 17:09 UTC | |
by liz (Monsignor) on Sep 11, 2003 at 17:19 UTC | |
by hardburn (Abbot) on Sep 11, 2003 at 21:00 UTC |