in reply to Existing in hash
if ($hash{$var1} == $var2) { print "You are in\n"; } else { print "Bad, monkay, bad!\n"; }
If you insist on more checks, you can do
if (defined($var1)) { ... }
thingy. Or you can even do
if (defined($hash{$var1}) && length($hash{$var1}) > 0) { ... }
staff. It's all up to you... :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Existing in hash
by bart (Canon) on Apr 28, 2003 at 09:50 UTC | |
by halley (Prior) on Apr 28, 2003 at 12:02 UTC | |
by bart (Canon) on Apr 28, 2003 at 12:54 UTC |