while (<>) { if (my $name = /Servername (.*)/) { next if /^Context Servername/; next if /Servername Context/; print $name, "\n"; } }