You can use the range operator (aka flip-flop):
while ( <$fh> ) { print if /X/ .. /^\s*$/ and not /^\s*$/; }
Edit: updated to fix a precedence problem with if ( $line =~ /X/i .. /^\s*$/ ), thanks Eily!
In reply to Re: How to find content between KEYWORD and BLANKLINE then print it
by 1nickt
in thread How to find content between KEYWORD and BLANKLINE then print it
by ChrisCK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |