in reply to Reading a part of text file between markers

You can use the .. operator like
use strict ; use warnings ; my $rule=1 ; while(<DATA>) { if(/RULE=$rule/../^END$/) { print } }
This will only print data for RULE=1. Inside the if loop, you can do whatever you'd like with $_.


Manav