Try taking out trailing slash in the
use lib ('/home/sites/site10/users/esickafus/perllib/');
statement so that it will read:
use lib ('/home/sites/site10/users/esickafus/perllib');
that might work
dat_sources.al I believe is loaded somewhere in dbi but I might be wrong.
Anton Kokarski
-----Original Message-----
From: Ed Sickafus [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 11:20 AM
To: [EMAIL PROTECTED]
Subject: May I trouble you again?
Help! Again? So soon? Yes, but I find no similar errors via GOOGLE or in
CPAN.
Ran my still crippled cgi script and got an error mssg I don't know how to
handle ...
[esickafus esickafus]$ perl perl5/perlmod/lstdrvrs.cgi
Driver: ExampleP ##
Script works to here, but then ...
Can't locate auto/DBI/dat_sources.al in @INC ## <-- who loads
dat_sources.al?
(@INC contains:
/home/sites/site10/users/esickafus/perllib//i386-linux
/home/sites/site10/users/esickafus/perllib/
/usr/lib/perl5/5.00503 /usr/lib/perl5/5.00503/i386-linux
/usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386-linux
/usr/lib/perl5/site_perl/5.005 .) at perl5/perlmod/lstdrvrs.cgi line
31
I notice the double // in the first path in @INC ("
...../perllib//i386-linux"), and am suspect. I fjound DBI.pm in
$HOME/perllib/i386-linux and thought I should add the i386-linux directory
to the path in the script (see listing below). I appended it to the
statement use lib ('/home/sites/site10/users/esickafus/perllib/'); then
later removed it (as now shown). Apparently I've made a permanent alteration
to @INC. If I can figure out how to remove this path from @INC, should that
correct the error?
Who's responsible for loading dat_sources.al? And where should I look to
learn about such matters?
Thanks once again for your excellent considerations.
Ed Sickafus
-------------- cgi script
"lstdrvrs.cgi" ------------------------------------------
#!/usr/bin/perl -w
BEGIN {unshift @INC, '/usr/lib/perl5/5.00503'} ;
#
# lstdrvrs.cgi "Programming the Perl DBI", p.83
#
# cho4/listdsns: Enumerates all data sources and all installed drivers
#"perl /home/sites/www.yoursite.com/web/nameofscript.pl"
#"perl /home/sites/site61/users/esickafus/web/Tests_Debug/lstdrvrs.cgi"
## From Glen Accardo via [EMAIL PROTECTED] ...
# use lib ('$HOME/tmp/build/DBI-1.20/');
## From Anton Kokarski via [EMAIL PROTECTED] ...
use lib ('/home/sites/site10/users/esickafus/perllib/');
use DBI;
### Probe DBI for the installed drivers
my @drivers = DBI->available_drivers();
die "No drivers found!\n" unless @drivers; #should never happen
### Iterate through the drivers and list the data sources for each one
foreach my $driver (@drivers){
print "Driver: $driver\n";
my @dataSources = DBI->dat_sources ($driver);
foreach my $dataSource (@dataSources){
print "\tData Source is $dataSource\n";
}
print "\n";
}
exit;
-------------- end of cgi script "lstdrvrs.cgi" -------------------