use DBD::CSV; my $input = "test.csv"; my $dbh = DBI->connect(qq{DBI:CSV:}); $dbh->{'csv_tables'}->{'info'} = { 'file' => "$input", 'eol' => "\n", 'col_names' => ["ID", "date"]}; my $sth = $dbh->prepare("SELECT * FROM info WHERE date=?"); print "Enter a date to seach for MM/DD/YYYY: "; my $date = ; chomp($date); $sth->execute($date); my @array; while(@array = $sth->fetchrow_array){ print "$array[0], $array[1]\n"; }