in reply to Need to skip two lines
while (<DATA>){ <DATA> && <DATA> if (/3/); print; } __DATA__ 1 2 3 skipme skipme 4 5
Or in the general case:
do {<DATA> for (0..$x)} if (/3/);
where $x is the number of lines you want to skip -1
citromatik
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Need to skip two lines
by drodinthe559 (Monk) on May 06, 2009 at 20:11 UTC | |
by linuxer (Curate) on May 08, 2009 at 18:48 UTC |
In Section
Seekers of Perl Wisdom