wolis has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

For the first time in my life I have to install modules under linux (I have had no problems with Windows PPM)

I searched and found 128077 some information here about using CPAN and I have sucessfully installed a couple of modules - so far so good.

Now I try installing XML::DOM and a whole bunch of dependencies arise which I answer 'yes'. However something is not quite right and it fails on the test saying is can't locate XML/parser.pm in @INC.

No probs.. I try installing that package:

Running install for module XML::Parser Running make for M/MS/MSERGEANT/XML-Parser-2.34.tar.gz Is already unwrapped into directory /root/.cpan/build/XML-Parser-2.3 +4 Has already been processed within this session Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible

Now one wise person said that:
2. Unfortunately, many CPAN authors are still not used to -- or don't know about -- setting PREREQ_PM in Makefile.PL. So be prepared to get the "Can't locate foo/bar.pm in @INC" error while running make test.

Can anyone tell me how I can prepare myself for this?

A) Should I try and find the author of the dependant module and ask for a sollution?

B) Is there a way of finding out exactly what went wrong?

C) Could it be my version of Perl - in which case I would need to updated it (how I dont know yet)

D) Is the test irrelevent and somehow 'forcing' it will suffice?

If you can answer any of these that would be a great help.

PS Thanks,

___ /\__\ "What is the world coming to?" \/__/ www.wolispace.com

Replies are listed 'Best First'.
Re: linux modules cpan and things not found
by chromatic (Archbishop) on Aug 10, 2004 at 03:59 UTC

    I bet you don't have a modern version of expat installed. Matt certainly knows what he's doing to bundle modules, but there's not much XML::Parser can do if you don't have a C library installed.

Re: linux modules cpan and things not found
by tachyon (Chancellor) on Aug 10, 2004 at 04:09 UTC

    Although you mention reading A Guide To Installing Modules you don't seem to have tried anything outlined there.

    CPAN and PPM are convenience tools. They are fine when they work, but they don't always do the job. The standard way to install software on *nix is:

    cd /usr/src (this is the standard location for source code) wget http://some.site.com/blah/software-1.01.tar.gz (we need to get th +e tarball) tar xzf software.tar.gz (ungzip and untar it) cd software-1.01 (now go to the dir) perl Makefile.PL (./configure for most C code) make (compile) make test (test) make install (install ;-)

    Give it a go. You will have to download dependencies and install them but all up it should be both educational and very useful to your Linux knowledge base as you will be able to escape RPM as well.

    As chromatic notes the likely issue is that XML::Parser uses the expat library (it is a wrapper on top). I needed to update expat it so following the steps above......

Re: linux modules cpan and things not found
by PodMaster (Abbot) on Aug 10, 2004 at 04:20 UTC
    A) Should I try and find the author of the dependant module and ask for a sollution?
    Nope, absolutely not. All you've shown us is that make failed, which is a pretty useless error message (you've managed to omit the more useful one).
    B) Is there a way of finding out exactly what went wrong?
    Yes, get rid of the intermediary(cpan) do a 'make realclean', and then report everything the make dance outputs (from perl Makefile.PL to make test) without omitting anything. You should also (for completeness) report the output of perl -V.
    D) Is the test irrelevent and somehow 'forcing' it will suffice?
    The test is always relevant, but forcing will sometimes suffice (it depends). There are a lot of poorly written tests out there, so you'll have to examine them and judge for yourself, but in my experience if the entire test suite is at least %90 ok, forcing is ok.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.