while (<FF>) { next unless /XXXX/; print scalar <FF>; }
Note that scalar is required to turn the print statement into scalar context. There are other ways of accomplishing this (e.g. appending an empty string), but this is simple and clear, at least to me. Note that this is fragile in that it would miss consecutive lines.
In reply to Re: how to next line after the pattern in perl
by kennethk
in thread how to next line after the pattern in perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |