my @phrases = qw{ one two three } ; my $in = 'three' ; if ( grep ( /$in/, @phrases ) ){ ... }