#!/usr/bin/perl use strict; use warnings; use DBI; my $file = 'test.csv'; my $dbh = DBI->connect('DBI:CSV:') or die $DBI::errstr; $dbh->{csv_tables}->{'info'} = { sep_char => ';', eol => "\n", file => $file, }; my $sth = $dbh->prepare('SELECT * FROM info') or die $dbh->errstr; $sth->execute() or die $sth->errstr; while(my @row = $sth->fetchrow_array()){ @row = grep{defined $_ }@row; print '<<', join("--",@row),">>\n"; } $sth->finish();