[prog] @INC in Perl

Jacinta Richardson jarich at perltraining.com.au
Tue Apr 27 20:13:27 EST 2004

On Tue, 27 Apr 2004, David Sumbler wrote:

> > I'm not sure why you're getting this error.  Is the full path to
> > Parse.pm /usr/lib/perl5/vendor_perl/5.8.0/Parse/Yapp/HTML/Parse.pm?
> > A Parse.pm in a directory not called HTML will not be considered the
> > right file by Perl.
> No - I have:
> /usr/lib/perl5/vendor_perl/5.8.0/Parse/Yapp/Parse.pm

Okay.  This is NOT HTML::Parse and Perl will not look at this one to find
HTML::Parse.  This is probably Parse::Yapp which is a Perl extension for
generating and using LALR parses.

To get HTML::Parse you're going to have to install it.  HTML::Parse is a
wrapper around HTML::TreeBuilder.  You can get this by installing the
HTML-Tree-3.18 package.  Although earlier versions are probably
acceptable.  To download this go to it's CPAN page
(http://search.cpan.org/~sburke/HTML-Tree-3.18/) and grab the source, or
go to your favourite linux distribution site and see what package they
have for you.  Alternately you can use the CPAN module:

# perl -MCPAN -e 'install HTML::Tree'

> I have:
> /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/Parser.pm
> The only 'Parse.pm' I have is the one in
> /usr/lib/perl5/vendor_perl/5.8.0/Parse/Yapp/

Well, get yourself a copy of HTML::Tree and its friends and this problem
will be solved.

> > If you could also let me know how exactly you're calling lwp-request
> > from your bash script I can probably help you further.
> lwp-request -o text 'http://www.etc'

Thanks for that.  If you allow HTML::Tree to be installed in the place
that Perl picks for it, this should be found automatically.  If you
install HTML::Tree into a local location for whatever reason, then you can
help Perl find the library by modifying the environment (in your script)
before doing this.  IE:

export PERL5LIB=/path/to/local/location/
lwp-request -o text 'http://www.etc

This assumes you have something like:

As far as I can tell it's a bug that LWP is still using HTML::Parse.pm.
It appears that almost everything has been upgraded to use
HTML::TreeBuilder.  It also appears that HTML::TreeBuilder is accidently
omitted from the required modules to install when installing LWP.  I'll be
reporting both of these on your behalf.

Let me know how all the above goes.


   ("`-''-/").___..--''"`-._          |  Jacinta Richardson         |
    `6_ 6  )   `-.  (     ).`-.__.`)  |  Perl Training Australia    |
    (_Y_.)'  ._   )  `._ `. ``-..-'   |      +61 3 9354 6001        |  
  _..`--'_..-_/  /--'_.' ,'           | contact at perltraining.com.au |
(il),-''  (li),'  ((!.-'              |   www.perltraining.com.au   |

More information about the Programming mailing list