chdir $f_path; foreach my $file_name (glob "*.*") { lc $file_name eq lc $csvfile or next; $csv_file = $file_name; last; } my $dbh = DBI->connect ("dbi:CSV:", undef, undef, { f_dir => $f_path, f_ext => ".csv/r", f_encoding => "utf-8", f_schema => undef, RaiseError => 1, PrintError => 1, }); $cellh->{csv_tables}{cells} = { file => $csv_file }; my $sth = $sbh->prepare ("select * from cells"); $sth->execute; print "fields: @{[@{$sth->{NAME_lc}}]}\n";