my %match; @match{@strings) = (); # to test a var, $check_this if (exists $match{$check_this}) { # ... }