in reply to Re: Re: Matching a KEY in a HASH
in thread Matching a KEY in a HASH

I must not be making myself clear.

The point of a hash is that a hash itself can find a value for a given key trivially.

$value_you_are_looking_for = $category{$variable};
There's no searching required. If there's an element with a key of $variable, then $value_you_are_looking_for has it. Otherwise, it gets undef.

-- Randal L. Schwartz, Perl hacker