in reply to Help with CSV file parsing

To contruct your output:

If you're using DBI, use placeholders, or if you must, $dbh->quote.

If you're not, you'll have to write a quoting routine appropriate for the database your queries are targeting, or adapt one from the relevant DBD module.