curtisb has asked for the wisdom of the Perl Monks concerning the following question:
Hello, Everyone
I have a question! I just installed DBD:Sybase module into ActiveState Perl using PPM. When I run the code that I have copied out of "Programming the Perl DBI" (not a plug for the book), I get the following errors.
Can't locate DBI.pm in @INC (@INC contains: C:/Program Files/Perl/lib C:/Program Files/Perl/site/lib .) a
t C:/Program Files/Perl/site/lib/DBD/Sybase.pm line 16.
BEGIN failed--compilation aborted at C:/Program Files/Perl/site/lib/DBD/Sybase.pm line 16.
Compilation failed in require at datasources.pl line 3.
BEGIN failed--compilation aborted at datasources.pl line 3.
Now is this because the book has bad code in it or have I missed copied something? I have doubled check the book and everything looks right.
What this code is suppost to do is check for which DBI drivers I have running on my machine.
Here is the code:
#!/usr/bin/perl -w use DBI::Sybase; use strict; my @drivers = DBI->available_drivers(); die "No drivers found!\n" unless @drivers foreach my $driver (@drivers) { print "Driver: $driver\n"; my @DataSources = DBI->$data_sources($driver); foreach my $DataSources(@DataSources) { print "\tData Source is $DataSources\n"; } print "\n"; } exit
So, my questions are:
1. Where is this @INC varible and how do I change it,if needed?
2. How can I get this code to work correctly?
3. Has anyone else ever used PPM from Active State?
Thanks.
Curtisb
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question about DBI and PPM/DB Driver Verify Code
by MZSanford (Curate) on Nov 29, 2001 at 21:02 UTC | |
by curtisb (Monk) on Nov 29, 2001 at 21:16 UTC | |
by MZSanford (Curate) on Nov 29, 2001 at 21:22 UTC | |
by buckaduck (Chaplain) on Nov 29, 2001 at 21:25 UTC | |
by mpeppler (Vicar) on Nov 29, 2001 at 22:27 UTC | |
|
Re: Question about DBI and PPM/DB Driver Verify Code
by curtisb (Monk) on Nov 30, 2001 at 00:31 UTC | |
by buckaduck (Chaplain) on Nov 30, 2001 at 00:53 UTC | |
by curtisb (Monk) on Nov 30, 2001 at 01:46 UTC |