# assumes RaiseError eval { $dbh->begin_work; ... inserts here $dbh->commit; } or do { $dbh->rollback; }