Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
If for some reason (teacher, boss, lack of OO knowledge, etc.) you cannot use holli's excellent solution to your problem, you should at least have been able to extract the techniques you need from that code.
Now please do as holli suggested here: Re^3: Split file based on tag.