my %fruit;
@fruit{qw/apple orange banana/} = ();
warn "I know how to defend myself\n"
if exists $fruit{banana};
Note that the actual values stored here are undef. But in any case we just want to know if the key is there or not.
In reply to Re: How do I use a hash as a set?
by ariels
in thread How do I use a hash as a set?
by vroom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |