my $file = "computernames.txt"; open FILE, "$file"; while ($line=){ if ($line=~Servername){ print $line; } }