Hello,

sub readDataObject {

  my $dir = shift;
  my $table = shift;
  my $dbh = DBI->connect("DBI:CSV:f_dir=$dir");
  $dbh->{"csv_tables"}->{"$table"} = 
{'eol'=>"\n",'file'=>"$table.csv"};
  my $sth = $dbh->prepare("SELECT * FROM $table");
  my $rv = $sth->execute;
  return $sth;
}

I get the results I want, but I also get a long list of error messages:

Use of uninitialized value at /usr/local/perl/lib/site_perl/DBD/CSV.pm line 197.

Went into the CSV.pm file:

sub fetch_row ($$) {
    my($self, $data) = @_;
    my $fields;
    if (exists($self->{cached_row})) {
        $fields = delete($self->{cached_row});
    } else {
        undef $!;
        my $csv = $self->{csv_csv};
        local $/ = $csv->{'eol'};
        $fields = $csv->getline($self->{'fh'});
        if (!$fields) {
            die "Error while reading file " . $self->{'file'} . ": $!" 
if $!;
            return undef;
        }
    }
    $self->{row} = (@$fields ? $fields : undef);

The problem appears to be with the undef $!; statement. (In a previous version of 
DBD::CSV, the line undef $!; was just not there) I'm more an user than a developer and 
I just want to get rid of this specific error message, which is repeated many many 
times. How can I do that? (I prefer not to edit CSV.pm because there are other users.)


Thanks,

Pierre


______________
Pierre Gilbert
[EMAIL PROTECTED]


---------------------------------
Do You Yahoo!?
Get your free @yahoo.ca address at Yahoo! Mail.

Reply via email to