Update 2: Nevermind. After deleting a bunch of modules from /usr/lib/perl5/site_perl and reinstalling them, it now works. <sigh>
This has me a bit baffled... I suppose the best way to explain it is an example. Here is my "database", in a file called "MyTable":
And the code:COLA,COLB,VALUE foo,bar,1 baz,bar,2
If I run this, I get:#!/usr/bin/perl use strict; use warnings; use DBI; use Data::Dumper; my $dbh = DBI->connect(qq{DBI:CSV:f_dir=.;csv_eol=\n}, undef, undef, { +RaiseError => 1}); my $sth = $dbh->prepare('SELECT VALUE FROM MyTable WHERE COLA = ? AND +COLB = ?'); $sth->execute('baz', 'bar'); my @r = $sth->fetchrow_array(); print Dumper \@r;
And yet if I change 'baz' to 'foo', I get:$ perl ./csvtest.pl $VAR1 = [];
In the example, I'm expecting to get a '2', but that's not what I'm getting.$ perl ./csvtest.pl $VAR1 = [ '1' ];
Any clues?
DBD::CSV, Text::CSV_XS, SQL::Statement all seem to be at the latest available...
(Apparently, I use CSV files for databases too much :->)
Update:
(Not sure what other levels may be pertinent...)$ perl -MDBI -e 'DBI->installed_versions' Perl : 5.008008 (i686-linux-thread-multi) OS : linux (2.6.16-gentoo-r12) DBI : 1.58 DBD::mysql : 4.005 DBD::Sponge : 12.008696 DBD::SQLite : 1.13 DBD::Proxy : 0.2004 DBD::Multiplex : 1.98 DBD::Gofer : 0.009560 DBD::File : 0.35 DBD::ExampleP : 12.009532 DBD::DBM : 0.03 DBD::CSV : 0.22 $ perl -MSQL::Statement -le 'print $SQL::Statement::VERSION' 1.15 $ perl -MText::CSV_XS -le 'print $Text::CSV_XS::VERSION' 0.32
In reply to Oddity with CSV query by Tanktalus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |