in reply to How do I use a hash as a set?

No need to store an actual 1 value in your hash. This works just fine:
  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.