in reply to Managing Dynamic SQL

Let onw of the existing modules build the SQL for you.

My DBIx::SQLEngine would do the trick, as would half a dozen similar modules...