in reply to logically recurse parentheses

Perhaps Text::Balanced or Regexp::Common::balanced could help? I don't know what kind of content will be in the parens or how you will test for true/false, but the modules may help with tokenizing and the order of operations. Parse::RecDescent, as friedo mentioned, may also be helpful.