benn has asked for the wisdom of the Perl Monks concerning the following question:
which prints field1='?0?there' only on our Redhat 7.3.2 (Perl 5.8,DBD::CSV 0.2002) box - not on the Windows machines (also Perl 5.8, DBD::CSV 2.002) or a Debian Perl 5.6 (DBD::CSV 1.030) machine.use DBI;use strict;use warnings; my $dbh = DBI->connect("DBI:CSV:f_dir=./;"); $dbh->do("create table mytable (field1 text,field2 text)"); $dbh->do("insert into mytable values ('','there')"); print "field1=",$dbh->selectrow_array("select field1 from mytable");
I therefore assumed it was something to do with Text::CSV_XS, but that seems to be fine as far as I can make out - this is OK...
...and it looks like could be something to do with placeholders - values('','something','','something'...) gives '?0?something','?1?something' etc.use Text::CSV_XS; use IO::Wrap; my $csv = Text::CSV_XS->new(); my $fh = wraphandle(STDOUT); $csv->print($fh, ['','test']);
Stangely also, even if csv_quote_char is set to \", the values are always single-quoted.
Has anybody else come across this? I'm not seriously worried, as we're only playing with CSV for initial prototyping fun, but it seemed a curious bug. I don't want to go mailing authors unless it's reproducible elsewhere, and not just us being dumb :)
Cheers,Ben.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBD::CSV empty fields problem on RedHat / Perl 5.8.
by Itatsumaki (Friar) on Jun 09, 2003 at 17:56 UTC | |
by benn (Vicar) on Jun 09, 2003 at 18:14 UTC |