in reply to how to next line after the pattern in perl
To:while (<FF>) { next unless /XXXX/; $. += 1; ### obviously this does not work ... print $_ ; }
and it should work. (not tested)while (<FF>) { next unless /XXXX/; print <FF>; }
Update: it does not work, prints way too much, see moritz and kennethk below.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to next line after the pattern in perl
by moritz (Cardinal) on Jun 09, 2010 at 19:14 UTC | |
|
Re^2: how to next line after the pattern in perl
by ww (Archbishop) on Jun 09, 2010 at 19:19 UTC |