The point of a hash is that a hash itself can find a value for a given key trivially.
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.$value_you_are_looking_for = $category{$variable};
-- Randal L. Schwartz, Perl hacker
In reply to Re: Re: Re: Matching a KEY in a HASH
by merlyn
in thread Matching a KEY in a HASH
by SysAdm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |