use strict; use warnings; my @arr = ('cool', 'guy', 'here'); my $str = "I am cool"; print "Matched.\n" if grep { $str =~ /$_/ } @arr;