# where MyApp::DBIx is a sub-class of DBIx::Simple, my $csv = Text::CSV->new({ binary => 1 }); my $db = MyApp::DBIx->new(); my $sql = qq[ REPLACE INTO `mytbl` VALUES (??) ]; while (my $row = $csv->getline($csvfile)) { adjust_format($row); $db->query($sql, @{$row}); }