There are 3 common approaches that I can think of:
- Read the file line-by-line and use a state variable to remember when you are inside a block of interest.
-
Read the file record-by-record by re-defining the $/ ($INPUT_RECORD_SEPARATOR) special variable.
-
Read the file record-by-record by using Range Operators.
Try one of these out, then post code if you are still having trouble.