For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > September 2006 > CPAN sees XML::Parser, require does not









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author CPAN sees XML::Parser, require does not
strombrg

2006-09-19, 6:57 pm


What might cause a scenario where CPAN thinks you have a module but
require thinks you don't?

Thanks!

root@strombrg-desktop:~/src/jpilot/0.99.9# perl
-MCPAN -e 'install XML::Parser::Expat' CPAN: Storable loaded ok Going to
read /big/strombrg/.cpan/Metadata
Database was generated on Mon, 18 Sep 2006 06:29:55 GMT
XML::Parser::Expat is up to date.
root@strombrg-desktop:~/src/jpilot/0.99.9# perl -MCPAN -e 'install
XML::Parser' CPAN: Storable loaded ok Going to read
/big/strombrg/.cpan/Metadata
Database was generated on Mon, 18 Sep 2006 06:29:55 GMT
XML::Parser is up to date.
root@strombrg-desktop:~/src/jpilot/0.99.9# perl -MCPAN -e 'require
XML::Parser' Can't locate loadable object for module XML::Parser::Expat in
@INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.7
/usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5
/usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl) at
/usr/local/lib/perl/5.8.7/XML/Parser.pm line 14 Compilation failed in
require at /usr/local/lib/perl/5.8.7/XML/Parser.pm line 14. BEGIN
failed--compilation aborted at /usr/local/lib/perl/5.8.7/XML/Parser.pm
line 18. Compilation failed in require at -e line 1.
root@strombrg-desktop:~/src/jpilot/0.99.9#


harryfmudd [AT] comcast [DOT] net

2006-09-19, 6:57 pm

strombrg wrote:
> What might cause a scenario where CPAN thinks you have a module but
> require thinks you don't?
>
> Thanks!
>
> root@strombrg-desktop:~/src/jpilot/0.99.9# perl
> -MCPAN -e 'install XML::Parser::Expat' CPAN: Storable loaded ok Going to
> read /big/strombrg/.cpan/Metadata
> Database was generated on Mon, 18 Sep 2006 06:29:55 GMT
> XML::Parser::Expat is up to date.
> root@strombrg-desktop:~/src/jpilot/0.99.9# perl -MCPAN -e 'install
> XML::Parser' CPAN: Storable loaded ok Going to read
> /big/strombrg/.cpan/Metadata
> Database was generated on Mon, 18 Sep 2006 06:29:55 GMT
> XML::Parser is up to date.
> root@strombrg-desktop:~/src/jpilot/0.99.9# perl -MCPAN -e 'require
> XML::Parser' Can't locate loadable object for module XML::Parser::Expat in
> @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.7
> /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5
> /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl) at
> /usr/local/lib/perl/5.8.7/XML/Parser.pm line 14 Compilation failed in
> require at /usr/local/lib/perl/5.8.7/XML/Parser.pm line 14. BEGIN
> failed--compilation aborted at /usr/local/lib/perl/5.8.7/XML/Parser.pm
> line 18. Compilation failed in require at -e line 1.
> root@strombrg-desktop:~/src/jpilot/0.99.9#
>
>


Sounds like a bad install of XML::Parser::Expat to me, or at least one
that can't find the expat library.

See 'perldoc perldiag' for your exact message. If Perl couldn't find
XML/Parser/Expat.pm at all, you'd get a different message than the one
you're seeing. Compare and contrast your message to the one you get from

$ perl -e 'require Foo::Bar'

Tom Wyant
strombrg

2006-09-19, 6:57 pm

On Tue, 19 Sep 2006 16:40:59 -0400, harryfmudd [AT] comcast [DOT] net
wrote:

> strombrg wrote:
>
> Sounds like a bad install of XML::Parser::Expat to me, or at least one
> that can't find the expat library.
>
> See 'perldoc perldiag' for your exact message. If Perl couldn't find
> XML/Parser/Expat.pm at all, you'd get a different message than the one
> you're seeing. Compare and contrast your message to the one you get from
>
> $ perl -e 'require Foo::Bar'
>
> Tom Wyant


perl newbie that I am, my first thought in response to what you've
written was to remove XML::Parser (and XML::Parser::Expat if it doesn't
go with XML::Parser), but the program at
http://www.cpan.org/misc/cpan-faq.h...te_Perl_modules believes
that XML::Parser and XML::Parser::Expat aren't installed, much like
require.

Is there a CPAN command to blow away a module, since it seems to believe
these modules exist?

Can I "just" remove the relevant files under /usr/local/lib/perl? I can
get a list of likely suspects from strace, but does anyone know for sure
what would need to be removed to delete a typical perl module via rm?

Thanks!

Sisyphus

2006-09-20, 3:57 am


"strombrg" <strombrg@gmail.com> wrote in message
..
..
>
> Is there a CPAN command to blow away a module, since it seems to believe
> these modules exist?


There might be ... I don't use CPAN.pm, so I don't really know.

>
> Can I "just" remove the relevant files under /usr/local/lib/perl?


Not generally recommended, but I think that should be ok in your case.
Removing /usr/local/lib/perl/5.8.7/XML/Parser.pm should be enough to
convince CPAN.pm that you don't have XML::Parser installed. Then it should
fetch, build and install XML::Parser for you (overwriting any other remnants
of the bad XML::Parser installation in the process).

Note that you'll need expat installed to build XML::Parser -
http://sourceforge.net/projects/expat/ .

Cheers,
Rob


harryfmudd [AT] comcast [DOT] net

2006-09-20, 7:57 am

Sisyphus wrote:
>
> Note that you'll need expat installed to build XML::Parser -
> http://sourceforge.net/projects/expat/ .
>
> Cheers,
> Rob
>
>


Which may be the original problem.

You can use "force" in front of a CPAN command to make it do something
it does not want to do, e.g.

cpan> force install XML::Parser

This overrides everything: the up-to-date-module check, test failures,
dependency failures, pretty much everything.

But you might want to try not using CPAN. The incantation is:

download.

$ tar -xzf distribution.tar.gz
$ cd distribution
$ # read README, and Makefile.PL
$ perl Makefile.PL
$ make
$ make test
$ sudo make install

Tom Wyant
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com