my $sql = q{INSERT INTO mytable VALUES ( ?,?,? )}; eval { $dbh->do( $sql, undef, ($val1, $val2, $val3) ); }; if ( $@ ) } # error trapping here ... }