my $dbh= DBI->connect('dbi:...', $user, $pass, { RaiseError => 1, PrintError => 0 }); # RaiseError is important so I can leave out all error handling my $sth= $dbh->prepare(<<'SQL'); INSERT INTO person SET id=?, first_name=?, last_name=?; SQL $sth->execute( undef, $first, $last ); $sth->finish;