my $dbh = DBI->connect ("dbi:CSV:", undef, undef, { f_dir => $_ENV::TempFilesDIR, csv_sep_char => "~", # not "\\~" # You might want to add f_ext => ".csv", csv_auto_diag => 1, # And if you want NULL support csv_null => 1, # And add these to see what is going wrong RaiseError => 1, PrintError => 1, ShowErrorStatement => 1, }) or die $DBI::errstr;