http://www.perlmonks.org?node_id=502493


in reply to Anything Else Like SQL::Statement?

I think SQL::Statement is the most capable such module available.

You might be best off extending it to do some pre-processing of comments and figuring out a way to stuff included subqueries into their own parse trees.

Not trivial work, but you could probably get some community help with it if/when you got stuck...