See Re: How can I print part of a line between two different lines which applies equally here.
In reply to Re: Scripting in perl by hippo in thread Scripting in perl by Anonymous Monk