in reply to How to find content between KEYWORD and BLANKLINE then print it

I know you already have your answer but this is what I do in instances like those

my $flag; while(<$fh>){ chomp; if (/this/) { $flag = 1; next;} elsif (/^\s*$/) {$flag = 0;} print "$_\n" if $flag; } close($fh);

In this case it would print everything BETWEEN the line "this" (but not include that line) and would end once a blank line is found (and not include it)

  • Comment on Re: How to find content between KEYWORD and BLANKLINE then print it
  • Download Code