LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-10-2006, 06:30 PM   #1
nodger
Member
 
Registered: Oct 2003
Location: Ireland
Distribution: Slackware 9.1, Ubuntu
Posts: 192

Rep: Reputation: 30
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
 
Old 07-10-2006, 09:12 PM   #2
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
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).
 
Old 07-10-2006, 09:16 PM   #3
jxi
Member
 
Registered: Feb 2003
Location: Richmond VA
Distribution: Slackware 11 -- CentOS 4.4
Posts: 115

Rep: Reputation: 15
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
 
Old 07-11-2006, 12:17 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,697

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl wont print my Variable!!! socceroos Programming 10 03-15-2006 06:04 PM
Tainted variable problem (PERL) rajatgarg Programming 1 07-29-2004 02:54 PM
Perl variable string search ugenn Programming 1 05-07-2004 09:19 PM
Perl Message board variable cadj Programming 3 04-21-2004 07:23 AM
question about $_ (default variable) in Perl realos Programming 4 07-04-2003 06:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration