use strict; use warnings; use DBI; my $dbh = DBI->connect("DBI:mysql:bugs:localhost", "bugs", "sockmonkey", {RaiseError => 1}) or die $!; $dbh->trace(2); my $sth = $dbh->prepare('UPDATE sometable SET value1=? WHERE value2=?'); $sth->execute('something with \n in it', 'something else which incidentally has +a \n in it');