Here is the format of my text from which i need to grab some part of the text.
As, you see above, each and every BEGIN has its own END, I want a snippet of the code from BEGIN hi to "its" END (not the end of "BEGIN hello"). The code i have written is shown below. But its pulling the lines from desired BEGIN to the END of the "other" BEGIN.
open DATA, "</hello.txt";
my @hello = <DATA>;
foreach my $k (@hello)
if ($k=~/BEGIN ps7_slcr/../END/)
Thanks in Advance,