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
In reply to Question about DBI and PPM/DB Driver Verify Code by curtisb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |