#!/usr/bin/perl use strict; use warnings; my @myTerms = ( 'foo bar', 'blah' ); my $term = "foo"; my ($match) = ( grep /\Q$term\E/, @myTerms ); print "$term does match with $match\n" if ($match);