in reply to DBI debugging: SQL dumping?

Look for "trace" in the DBI man page.

There's a whole section on tracing, and I'm sure it has all you need.

(As a side note, if you do many inserts with the same SQL you should use prepare_cached(), execute(), execute(), ... instead of do(), do(), ...).