my @foo = ('hello\(\w+\)', ' ... '); my $foo = "Hello(world)"; for my $bar (@foo) { print "Matched ($foo, $bar)\n" if $foo =~ /$bar/i; }