in reply to Printing matched lines
while is not setting $_ for you. in
Try this instead:while (<PINGALLIP>) { if (/is alive/) { chomp; print ALIVEIP $_; } }
If the match is true then print $_ for all lines. I omitted chomp since the record delimiters will probably be handy in the file./is alive/ and print ALIVEIP for <PINGALLIP>;
After Compline,
Zaxo
|
|---|