in reply to foreach loop with nested

Another way (and I hope your using strict and warnings if this is part of a larger script) (:
my @companies = ("AOL Time Warner", "Genetech","Broadwing"); my $companies = join('|',map(quotemeta, @companies)); $companies = qr/($companies)(.*?)/is; while ($content =~ /$companies/g) { print "Company: $1 new coverage: $2\n"; }