in reply to Can't locate DBI.pm in @INC

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.

Replies are listed 'Best First'.
Re^2: Can't locate DBI.pm in @INC
by Anonymous Monk on Sep 13, 2007 at 20:35 UTC
    there may be multiple perl binaries installed on your machine check your PATH which one are you accessing. I went thru this frustration once.
Re^2: Can't locate DBI.pm in @INC
by Anonymous Monk on Dec 28, 2010 at 09:58 UTC
    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.