in reply to How do I extract this data structure?
Sounds to me like a perfect job for Parse::RecDescent. Get it from the CPAN.