'; close outFile; # The real sample code my $dbh = DBI->connect(qq{DBI:CSV:csv_sep_char=\\\t}) or die "Cannot connect: " . $DBI::errstr; my $sth = $dbh->{'csv_tables'}->{'info'} = { 'file' => 'sample.csv'}; $sth = $dbh->prepare("SELECT * FROM sample.csv") or die "Cannot prepare: " . $dbh->errstr(); $sth->execute() or die "Cannot execute: " . $sth->errstr(); while (my $row = $sth->fetchrow_hashref) { print("$row->{'Date'}, $row->{'Time'}, $row->{'Recipient-Address'}, $row->{'Message-Subject'}, $row->{'Sender-Address'}, \n"); } $sth->finish(); $dbh->disconnect();