LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   perl @INC variable (https://www.linuxquestions.org/questions/programming-9/perl-%40inc-variable-462750/)

nodger 07-10-2006 06:30 PM

perl @INC variable
 
Ok, all I want to do is use the HTML::Parse module. I downloaded it off CPAN.org and installed it the way it said:

Code:

perl Makefile.PL
make
make test
make install

but when I try to run my program I get the following message:
Code:

Can't locate HTML/Parse.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i486-linux /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i486-linux /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at ./spider.pl line 3.
BEGIN failed--compilation aborted at ./spider.pl line 3.

I then read somewhere that if I recompile the entire Perl source that will fix it. So I downloaded the entire Perl source and compiled it (which took ages) and that still didn't work.

Whats the easiest way to fix this?
Thanks for any help

taylor_venable 07-10-2006 09:12 PM

Find the directory where that Perl module lives and append that to the @INC array. If that doesn't do it, then something else is wrong (unrelated to @INC).

jxi 07-10-2006 09:16 PM

first thing you need to do is find where (if make install succeeded) the modules were installed. if youre using $HOME/.cpan for your builds, cd to $HOME/.cpan/build/HTML-Parse-{versioninfo} <-adjust accordingly. then (hoping your locate database is up to date),

try this bash script from the command line:


Code:

for M in $(find . -type f -name '*.pm'); do
echo "....Looking for $M Installed....";
locate $(basename $M 2>/dev/null) |grep -v "^$HOME\/\.cpan";echo ''; done


chrism01 07-11-2006 12:17 AM

Personally I find this method easier:
1. sudo to root
2. perl -e shell -MCPAN
3. install HTML::Parse


All times are GMT -5. The time now is 05:00 AM.