in reply to move down 2 lines in file?
open (file.....) while (<FILE>) { my $skip_next = 0; if /blah/ { $skip_next = 1; } elsif ( ... something else ... ) { } elsif ( ... third condition ... ) { $skip_next = 1; } .... $_ = <FILE> if $skip_next; } # while reading through the file
Revised: If you need to skip a variable number of lines, you could set $skip_next to the number of lines you wish to skip, and use a loop rather than the final assignment.
|
|---|