in reply to Escaping SQL correctly

SQL::Abstract might be able to help you out.