for (@myfile) { if (/$filename/) { print "Found pattern.\n"; } }