When the parsing gets as complicated as in your case I tend to use a finite state machine
If the parsing gets even more complicated and not line oriented any more Parse::RecDescent gets interesting, but I think you are still in fsm territory here.
Comment on Re: split a file into records and process it