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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.