Safety by example
use DBI;
use Text::Wrap;
$dbh = DBI->connect(…, …, …, {
    AutoCommit => 0, RaiseError => 1
});
eval {
    $sth = $dbh->prepare('insert into table values (?)');
    foreach (@array_of_long_strings) {
        $text = wrap($_);
        $sth->execute($test);
    }
};
$@ ? $dbh->rollback : $dbh->commit;
17