my (%fruits,%vegetables); $fruit{apple}=1; $fruit{orange}=1; $fruit{banana}=1; $vegetable{corn}=1; $vegetable{carrot}=1; #test whether apple is in the set fruit if($fruit{apple}){ #test for inclusion in a set print "apple is a fruit"; }
In reply to Re: How do I use a hash as a set?
by vroom
in thread How do I use a hash as a set?
by vroom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |