[prog] @INC in Perl

David Sumbler david at aeolia.co.uk
Mon Apr 26 20:33:39 EST 2004

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:


'rpm -ql perl-HTML-Parser-3.26-18' gives:


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!



More information about the Programming mailing list