Will yield and endless loop of:#!/usr/bin/perl use strict; no warnings; use DBD::CSV; my $file = shift; my $dbh = DBI->connect('DBI:CSV:f_dir=.') or die "Cannot connect $!"; $dbh->{'csv_tables'}{'current_table'} = { file => $file, quote_char => '~', eol=> "\r\n" }; my $sth = $dbh->prepare(q{SELECT * FROM current_table}); $sth->execute(); while ( defined ( my @row = $sth->fetchrow_array ) ) { print @row; } print $sth->errstr();
While removing the defined () makes the program silently exit printing nothing.DBD::CSV::st fetchrow_array failed: Attempt to fetch row from a Non-SE +LECT statement [for Statement "SELECT * FROM current_table"] at ./col +_proc.pl line 13. DBD::CSV::st fetchrow_array failed: Attempt to fetch row from a Non-SE +LECT statement [for Statement "SELECT * FROM current_table"] at ./col +_proc.pl line 13. DBD::CSV::st fetchrow_array failed: Attempt to fetch row from a Non-SE +LECT statement [for Statement "SELECT * FROM current_table"] at ./col +_proc.pl line 13. DBD::CSV::st fetchrow_array failed: Attempt to fetch row from a Non-SE +LECT statement [for Statement "SELECT * FROM current_table"] at ./col +_proc.pl line 13.
Don't know where you can take this, but removing quote_char and csv_quote_char all together, and the defined() bit, makes the program output this:
Which is correct less the quote_char, and csv_quote_char, is this problem specific to '~' as a quote char?evan@dealermade:/var/chrome/NVDv2_US_EN$ ./col_proc.pl problem.txt 282198 2007700803 16139 2007 1 ~ZMB67~ ~ +ZMB67~ ~2dr Conv~ ~Y~ 21319.80evan@dealermade: +/var/chrome/NVDv2_US_EN$ vim problem.txt
In reply to Re: A bug in DBD::CSV?
by EvanCarroll
in thread A bug in DBD::CSV?
by EvanCarroll
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |