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.

while ( <RULE> ) { if (/^STMT/.../^STMT/) { print unless /^STMT/; } }
...or if you are into the whole brevity thang:
/^STMT/.../^STMT/ and !/^STMT/ and print while <RULE>; __END__ A B C Y Z
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:
if (/^STMT\d+=BEGIN/../^STMT\d+=END/)

the lowliest monk