my %foo = map { $_ => 1 } @foo; if ($foo{$bar}) { ... } #### my %foo; undef @foo{@foo}; if (exists $foo{$bar}) { ... } #### if (grep $_ eq $bar, @foo) { ... }