use DBI; use Text::CSV_XS; my $dbh = DBI->connect (...); my $sth = $dbh->prepare ("insert into table values (?, ?, ?, ...)"); my $csv = Text::CSV_XS->new ({ binary => 1 }); open my $dta, "<", "data.csv" or die "data: $!\n"; while (my $row = $csv->getline ($dta)) { $sth->execute (@$row); } $csv->eof or $csv->error_diag; $sth->finish; $dbh->commit;