in reply to Problem in using range operator
Note that in this case only your inner loop is doing any noticeable work (the printing), so you can just get rid of the outer loop.
...or if you are into the whole brevity thang:while ( <RULE> ) { if (/^STMT/.../^STMT/) { print unless /^STMT/; } }
I used the ... operator instead of .. so that I could get away with the same pattern for both the left and the right sides of the operator, but I could have also used:/^STMT/.../^STMT/ and !/^STMT/ and print while <RULE>; __END__ A B C Y Z
if (/^STMT\d+=BEGIN/../^STMT\d+=END/)
the lowliest monk
|
|---|