in reply to Printing matched lines

while is not setting $_ for you. in

while (<PINGALLIP>) { if (/is alive/) { chomp; print ALIVEIP $_; } }
Try this instead:
/is alive/ and print ALIVEIP for <PINGALLIP>;
If the match is true then print $_ for all lines. I omitted chomp since the record delimiters will probably be handy in the file.

After Compline,
Zaxo