use warnings; use strict; use DBI; # just using an SQLite in-memory DB as an example here my $dbh = DBI->connect("dbi:SQLite:dbname=:memory:", '', '', { RaiseError=>1, AutoCommit=>0 } ); my @values = qw/ CAT DOG BIRD COW bl'ah /; my $str = join ',', map { $dbh->quote($_,'VARCHAR') } @values; print $str, "\n"; __END__ 'CAT','DOG','BIRD','COW','bl''ah'