eval { ... $db->commit; 1; } or do { say $@ if length $@; $db->rollback; };