in reply to Best way to deal with quotes in string with DBI

Or maybe-

use SQL::Abstract; my $sql = SQL::Abstract->new; my $book_data = {}; # your data from above my ( $stmt, @bind ) = $sql->insert("books", $book_data); print $stmt, "\n\n"; print join(" : ", @bind), "\n"; my $sth = $dbh->prepare($stmt); my $rv = $sth->execute(@bind); die "FAIL! DBI, ur doin it rong!" unless $rv == 1;

SQL::Abstract is really quite nice and will save you from all kinds of weird contortions if you try to roll your own version.

(Sidenote: unless something has changed in the Amazon dev agreement in the last couple years, it's against their TOS to save the data on your side in any persistent way.)