#!/usr/bin/perl use strict; use warnings; use DBI; # Connect to the database, (the directory containing our csv file(s)) my $dbh = DBI->connect("DBI:CSV:f_dir=.;csv_eol=\n;"); # Associate our csv file with the table name 'prospects' $dbh->{'csv_tables'}->{'prospects'} = { 'file' => 'test.csv'}; my $sth = $dbh->do("SELECT avg(ERWWCOMMUNITIES_Memory_Pages_sec) FROM prospects"); print ("$sth \n");