in reply to Printing matched lines
to:while (<PINGALLIP>) { if (/is alive/) { chomp; print ALIVEIP $_; } }
That will apply the m// operator to magic variable $_, which is the current line of your while loop.while (<PINGALLIP>) { if ($_ =~ /is alive/) { chomp; print ALIVEIP $_; } }
|
|---|