my $regex = join ('|', @check_vals); if ($val =~ m/$re/) { do_foo (); }