[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [LANdb] csv script error
> That's what I thought, but apparently, the csv-building that I got with
> 0.80 thinks otherwise:
>
> require "/etc/landb.conf";
>
> $landbrequire= $cgi_binfs . "/" . "LANdb.pm";
> require "$landbrequire";
Ouch. Saw the "use DBI;" followed by a blank line, and turned back to the movie. Sorry
folks.
Anyway, the only reason to require LANdb.pm is for the DBLogin function so we get our DB
handle. The require of landb.conf is, of course, what causes the problem, in that landb.conf
doesn't have proper perl syntax, because it's used as a normal text file in LANdb.pm. Blah,
Blah, basically, since the new format of the config file, the CSV script obviously doesn't
work.
For now, here's a patch. Onto the list for v0.81.
John
--- csv-building.pl.old Thu Jan 13 23:50:43 2000
+++ csv-building.pl Thu Jan 13 23:47:09 2000
@@ -24,18 +24,23 @@
die "Usage: $0 <inputfile> <Building name, as entered in the database> \n\n";
}
-
use DBI;
-require "/etc/landb.conf";
-
-$landbrequire= $cgi_binfs . "/" . "LANdb.pm";
-require "$landbrequire";
-
print "\n\n Welcome to the LANdb CSV file convertor. This script will take
a filename specified on the command line, and enter them into the database.
It is essential that you read the INSTALL file to get the correct format for
these files. Let's begin...";
+
+print "\n\n Enter the path to the cgi-bin directory where LANdb is
+installed. Specifically, we need the location of LANdb.pm. \n: ";
+
+$cgi_binfs=<STDIN>;
+chop($cgi_binfs);
+
+$landbrequire= $cgi_binfs."/LANdb.pm";
+print $landbrequire;
+
+require "$landbrequire";
print "\n\n Enter the username you use to connect to LANdb. This must be the one
that gives you full write access to the database (by default, the 'admin'