use strict; use warnings; use Data::Dumper; use DBI; my $dbh = DBI->connect('dbi:CSV:', undef, undef, { f_dir => '/tmp', # where your files live f_ext => '.txt', }) or die $DBI::errstr; my $select = $dbh->prepare( 'SELECT * FROM Die1_10k' ) or die "Failed to prepare - " . $dbh->errstr; $select->execute or die "Failed to execute - " . $select->errstr; print Dumper $select->{NAME}, $select->fetchrow_hashref();