my $database = new XBase $database_file;
my $records = $database->last_record() + 1;
This is most likely because the .dbf file could not be
opened/read/parsed, so the constructor fails and returns undef
instead of an object to indicate the error.
In other words, check for this case ($database
being undefined), and only continue with the rest of the routine if
things are ok.
And in case you can't simply skip those 2 files, I'm afraid there's
more trouble ahead, i.e. figuring out the underlying problem of why
the XBase constructor is failing...
|