while($line = ) { if ($line =~ /(?:$nameOne|$nameTwo)/i) { print "WEB PAGE ->\t$name\n"; $ct++; last; } } close FLE;