my @lines; while (<DATA>) { my $is_key = /KEY/; @lines = () if $is_key; if (my $in_range = $is_key .. /PATTERN/) { push @lines, $_; print @lines if $in_range =~ /E0\z/; } }
If one continues to simplify the above, one gets the parent's code.
In reply to Re^2: pattern matching (greedy, non-greedy,...)
by ikegami
in thread pattern matching (greedy, non-greedy,...)
by cacophony777
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |