in reply to SQL/DBI

You should check out the SQL::Statement module. It will validate generic SQL with no database connection required. Of course, w/o a DB it won't be able to validate table and col names, but it will make sure you're syntactically valid.