my @data = ([11,12,13], [21,22,23], [31,32,33]); $sth = $dbh->prepare("insert into table values (?, ?, ?)"); # start new transaction # $dbh->begin_work(); #or perhaps $dbh->do("BEGIN"); foreach my $row (@data) { $sth->execute(@$row); } # end the transaction # $dbh->commit(); #or perhaps $dbh->do("COMMIT");