in reply to Problems using DBD::CSV

I wish you had included the code that opens and reads the CSV files. Are the CSV files empty?

After the execute() call, try adding this:

use Data::Dumper; print STDERR Dumper $sql->selectall_arrayref();
watch your error log and see if you are even pulling data out.

Hope this helps ...

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Re: Problems using DBD::CSV
by MrCromeDome (Deacon) on Feb 14, 2002 at 16:38 UTC
    The CSV files all have data. . . same files that display ok on my Win2k machine.

    Some more code for your viewing (dis)pleasure:

    my $files = $info{PATH_BASE} . $info{PATH_DATA}; my $filehandle = DBI->connect("DBI:CSV:f_dir=$files"); or die "Could not connect to database: " . DBI->errstr; $script = "SELECT Drafted, " . " Team, " . " Owner, " . " Location, " . " Age " . " FROM owners " . " ORDER BY Drafted ASC " ; $sql = $filehandle->prepare($script) || die "Couldn't prepare SQL: " . $filehandle->errstr; $sql->execute() || die "Couldn't prepare SQL: " . $filehandle->errstr; while (my $row = $sql->fetchrow_hashref) { my %row_data; $row_data{TEAM} = $row->{'Team'}; push(@table, \%row_data); } $sql->finish(); $tmpl_owners->param( LEAGUENAME => $info{LEAGUENAME}, TEAMS => \@table ); return $tmpl_owners->output;
    $info{PATH_BASE} . $info{PATH_DATA} turn out to be /www/cromedome.net/data/, which is what they should have been. It seems I never make it into while loop - I don't think that I'm pulling any data whatsoever. Should I execute that after the execute() and before the while()?

    MrCromeDome