in reply to Parsing balanced parentheses
I would recommend you take a look at Some Parse::RecDescent Tutorials - the links therein contain many examples.
HTH,