$dbh->{mysql_insertid} #### my $id = $dbh->{mysql_insertid}; $sth = $dbh->prepare(<<"SQL"); UPDATE history SET history_conf = ? WHERE history_id = ? SQL $sth->execute($id, $id);