⭐ in reply to How do I use a hash as a set?
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"; }
|
|---|