my ($line, $result); while($line = <HTMLFILE>) { if($line =~ /what_you_are_looking_for/) { $result = $line; for(0..3) { $result .= <HTMLFILE>; } last; } }
In reply to Re: grabbing N lines after matching one?
by cianoz
in thread grabbing N lines after matching one?
by jptxs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |