[prog] @INC in Perl

Marize Pommot-Maia marize at pommot.net
Mon Apr 26 17:59:54 EST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here's what I see as a possible cause of your problem.  The error message 
lists nothing for the contents to @INC?  Please, check it by typing:
  perl -e 'print join "\n", @INC, "\n";'

Here's the output in my machine:
/etc/perl
/usr/lib/perl5/site_perl/5.8.3/i686-linux
/usr/lib/perl5/site_perl/5.8.3
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.3/i686-linux
/usr/lib/perl5/vendor_perl/5.8.3
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.3/i686-linux
/usr/lib/perl5/5.8.3
/usr/local/lib/site_perl
.

I'd try adding the line
use lib "/path-to-where-your-modules-are-installed";

and see what happens.  

- -- 
- ------------------------------------------------------------------------
				Marize Pommot-Maia
				marize at pommot.net
On Monday 26 April 2004 03:33 pm, David Sumbler wrote:
++> On Mon, 26 Apr 2004, Dominik Schramm wrote:
++>
++> > David Sumbler <david at aeolia.co.uk> wrote:
++> >
++> > > In a bash script, I have used the command 'lwp-request' to get the
++> > > contents of a web-page.  This works fine.
++> > >
++> > > But if I add the option '-o text', I get this error message:
++> > >
++> > > Can't locate HTML/Parse.pm in @INC (@INC contains:
++> > > [...]
++> > > I imagine that I need to add this directory to @INC.  How do I do
++> > > this?  (Sorry, I'm not familiar with Perl.)
++> >
++> > I doubt that you need to add a directory manually. Chances are
++> > that HTML::Parse is really not installed. It's not part of libwww-net,
++> > see this list of libwww components:
++> > http://cpan.uwinnipeg.ca/dist/libwww-perl
++>
++> I wasn't sure that this was the problem - so far as I could see it is
++> already installed.
++>
++> 'rpm -qa | grep perl' gives:
++>
++> perl-XML-Dumper-0.4-25
++> perl-HTML-Tagset-3.03-28
++> perl-XML-Encoding-1.01-23
++> perl-libxml-enno-1.02-29
++> perl-URI-1.21-7
++> perl-Filter-1.29-8
++> perl-Parse-Yapp-1.05-30
++> perl-libxml-perl-0.07-28
++> perl-5.8.3-16
++> perl-SGMLSpm-1.03ii-12
++> perl-XML-Parser-2.31-16
++> perl-DateManip-5.40-30
++> perl-libwww-perl-5.65-6
++> perl-HTML-Parser-3.26-18
++>
++> 'rpm -ql perl-HTML-Parser-3.26-18' gives:
++>
++> /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML
++> /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/Entities.pm
++> /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/Filter.pm
++>
 /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/HeadParser.pm
 ++>
 /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/LinkExtor.pm
 ++> /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/Parser.pm
 ++>
 /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/PullParser.pm
 ++>
 /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/TokeParser.pm
 ++> /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/HTML ++>
 /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/HTML/Parser/Pa
rser.bs ++>
 /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/HTML/Parser/Pa
rser.so ++> /usr/share/man/man3/HTML::Entities.3pm.gz
++> /usr/share/man/man3/HTML::Filter.3pm.gz
++> /usr/share/man/man3/HTML::HeadParser.3pm.gz
++> /usr/share/man/man3/HTML::LinkExtor.3pm.gz
++> /usr/share/man/man3/HTML::Parser.3pm.gz
++> /usr/share/man/man3/HTML::PullParser.3pm.gz
++> /usr/share/man/man3/HTML::TokeParser.3pm.gz
++>
++> Looking at this, and the original error message, it seemed to my
++> inexpert eye that the problem is that the file being looked for is
++> HTML/Parse.pm, whereas the file that actually exists is called
++> HTML/Parser.pm .  So I tried making a symbolic link 'Parse.pm'
++> pointing to 'Parser.pm'.  When I ran my embryonic script again, the
++> original error message had disappeared, but I got a whole lot of other
++> errors (29 lines).
++>
++> What on earth is going on, I thought?  Is lwp-request hopelessly
++> broken?  Since the man page is in section 1 of the manual, I would
++> have expected it to work as described from the command line.
++>
++> > To install this module, do (as root):
++> >
++> > # perl -MCPAN -e 'install HTML::Parse'
++>
++> So I tried what you suggested.  After going through all the questions,
++> things whirred away for a short while, and I finally got:
++>
++> HTML::Parse is up to date.
++>
++> But when I run my script (with the -o option for lwp-request) I still
++> get my original error message.  Very frustrating, when all I want to
++> do is to convert HTML to plain text, which sounds easy!
++>
++> David
++>

- -- 
- ------------------------------------------------------------------------
				Marize Pommot-Maia
				marize at pommot.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAjYZa4y2uvMn0AkcRAg5qAJ9tKFT11ExAjxk6IyLhJg39uu9rMgCfVcFV
OrEyzVXrQeEDvCtN9ALb2zs=
=uc+q
-----END PGP SIGNATURE-----


More information about the Programming mailing list