Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Can't locate in @INC

by krishjack (Initiate)
on Dec 10, 2001 at 20:40 UTC ( #130699=perlquestion: print w/replies, xml ) Need Help??
krishjack has asked for the wisdom of the Perl Monks concerning the following question:

Hai i am just new to perl. I installed activestate. I am trying to run one example from a book. The example uses DBI for getting the available drivers and connecting to a database. When i run the *.pl file from the browser, i am getting the error as:

Can't locate DBI.PM in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at c:/apache/cgi-bin/

So after that i tried to install DBI.PM using PPM. It's then saying that it could'nt find the path for the PPD. can anyone guide me in this aspect.

I am using apache as my webserver to run my *.pl

Thx in advance.

Replies are listed 'Best First'.
Re: Can't locate in @INC
by Ovid (Cardinal) on Dec 10, 2001 at 21:46 UTC

    If you have just installed ActiveState, you don't have DBI as this is not a standard module. Use ppm. At the command line, type 'ppm'. When the prompt comes up, type 'install DBI' and follow the prompts.

Re: Can't locate in @INC
by Anonymous Monk on Apr 16, 2004 at 08:51 UTC
    If you don't have active perl (and hence don't have ppm), you can also get DBI like this:

    perl -MCPAN -e 'install DBI'

    That fixed it for me. And then you might need to install drivers like this (for Postgres):

    perl -MCPAN -e 'install DBD::Pg'

    Hope that helps.

Can't locate in @INC
by Avitar (Acolyte) on Nov 24, 2004 at 19:15 UTC
    Perl is installed, but the eggheads in their infinate wisdom forgot to add the path variable for the lib's you need for your os.

    I was able to work around this by adding "C:\Perl\lib;C:\Perl\site\lib" to the 'PATH' and/or 'PERL5LIB' environment variable.

    In windows 2000/2003/xp it cen be found near: right click my computer->properties->avanced tab Environmental Var

    David Smith
Re: Can't locate in @INC
by Khen1950fx (Canon) on Jul 21, 2006 at 23:17 UTC
    Granted---this an old question, but I thought I would revisit it to see if I could help my friends. When I first started in Perl, I got the "Can't locate" warning a lot. In fact, most of the time. Then I discovered what it was that I was doing wrong. OK...I was a newbie...In my case, the answer was simple. I created a folder on my Desktop and named it, say Algorithm::Diff. Then I would put the tarball in it and extract it there. Then I would run perl Makefile.PL, then make---oops! "Can't locate" would pop up and up. Hmmm...I admit that it took me a long time to figure out this one---Perl accepts a double colon, but my system was looking for a single dash. The Algorithm::Diff folder on my Desktop was the problem. I renamed it to Algorithm-Diff, and then it worked. I learned my lesson---keep it simple. A simple mistake is usually the most deadly...

    If the path's ok, then the next thing I look at is dependencies. The output will usually tell you what module is missing. Sometimes the program will ask you if you want the module installed. Sometimes not. If not, then install it manually. Then I use pmvers from pmtools to make sure that the dependency is actually there. If it isn't, then pmvers will come back at you with it's own "Can't locate...". Check all the dependencies and the module that you're installing.

    Based on my own experience, the procedures above have solved my "Can't locate" problem 90% of the time. The remaining 10%---that's another question.

      there may be multiple perl binaries installed on your machine check your PATH which one are you accessing. I went thru this frustration once.
      Hi, On my case, my program works simetimes fine but simetimes i got the error "can't locate", all dependecies are installed. it's hard to find the source of this problem.
Re: Can't locate in @INC
by Anonymous Monk on Jun 18, 2004 at 03:16 UTC
    i have this problem..: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: Can't locate in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at \\\s002\\CGI-BIN\ line 6. mi mail is: I dont find the answer of this error
Re: Can't locate in @INC
by Anonymous Monk on Mar 06, 2010 at 22:01 UTC
    bash-2.05$ ./ Can't locate in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at ./ line 4. BEGIN failed--compilation aborted at ./ line 4.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://130699]
Approved by castaway
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2018-06-23 03:07 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.