in reply to A bug in DBD::CSV?

Hi Evan,
Change:

while( defined ( my @row = $sth->fetchrow_array ) ) {
to:
while( my @row = $sth->fetchrow_array ) {
and an endless loop problem is fixed.
I think the other problem is your peculiar choice of quote_char.
I found that specifying the general quote char on DBI connection options makes the error go away. As you probably know, this is a general setting, not per table/csv handle.
my $dbh = DBI->connect('DBI:CSV:f_dir=.;csv_quote_char=~;') or die .. +.
I didn't have time to investigate on this one, though it would be interesting to do.