#!/usr/bin/perl use strict; use warnings; use DBI; use Data::Dumper qw(Dumper); my $sql_query = "SELECT * FROM export"; my $dbh = DBI->connect ("dbi:CSV:f_dir:/root", undef, undef, { f_ext => ".csv", RaiseError => 1, } ); my $sth = $dbh->prepare($sql_query); $sth->execute(); while (my $ref = $sth->fetchrow_hashref()) { print "Found a row: id = $ref->{'id'}, name = $ref->{'service_name'}\n"; } print "\$sth->err: " . ($sth->err || ""); print("\n"); $sth->finish();