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 $_; } }
In reply to Re: Printing matched lines
by dug
in thread Printing matched lines
by zuinc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |