in reply to Need to skip two lines
#!/usr/bin/perl use strict; my $skip_count = 0; while (<DATA>) { if ( $skip_count > 0 ) { $skip_count--; next; } $skip_count = 2 if ( /^abc/ ); print; } __DATA__ def abc skip_1 skip_2 xyz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need to skip two lines
by codeacrobat (Chaplain) on May 06, 2009 at 05:52 UTC | |
|
Re^2: Need to skip two lines
by drodinthe559 (Monk) on May 05, 2009 at 22:55 UTC |