perl - Ignore lines in a file till match and process lines after that -


i looping on lines in file , when matched particular line, want process lines after current (matched) line. can :-

open $fh, '<', "abc" or die "cannot open!!";  while (my $line = <$fh>){    next if($line !~ m/important lines below line/);    last; } while (my $line = <$fh>){    print $line; } 

is there better way (code needs part of bigger perl script) ?

i'd use flip-flop operator:

while(<data>) {     next if 1 .. /important/;     print $_; } __data__ skip skip important lines below line keep keep 

output:

keep keep 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -