my %foo; undef @foo{@foo}; if (exists $foo{$bar}) { ... }