Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Installing packages

Status
Not open for further replies.

GezH

Programmer
Aug 7, 2002
68
Hello all.

I'm using CPAN to install packages. Once I've done so, I write a small script to test them, and Perl doesn't seem to have any idea that they're there, or where they are. How do I tell Perl where to look for the new packages installed?

Thanks.
 
You shouldn't have to tell perl where to look for modules unless you are installing them to a user directory instead of perls default library director(ies). Maybe more detail on how you are installing modules will help someone come up with a suggestion for you.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Fair enough! Cpan.pm is downloading and installing modules, into a user directory as you mentioned above. So perl says "can't find xxx.pm in @INC" and lists all the directories it looks in, but of course my user directory isn't there.
 
Use the lib module to add your own directories to the search path.

i.e.

Code:
use lib "/home/whoever/lib";
use lib "./lib"; # if you have a lib folder next to your pl scritp

# etc...

Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top