The databases/p5-SQL-Abstract port
p5-SQL-Abstract-1.87 – generate SQL from Perl data structures
This module generates SQL, while retaining complete control
over statement handles and uses the DBI interface. The
underlying idea is for this module to do what you mean,
based on the data structures you provide it. The big
advantage is that you don't have to modify your code every
time your data changes, as this module figures it out.