in reply to Re: use HTTP::Cookies?
in thread use HTTP::Cookies?

I installed expat. Then I typed in 'perl -MCPAN -e shell' and then installed XML::Parser. All went well until I tried to install XML::Simple
It seemed to find all the files necessary, but at the end it failed to test and install.
Could somebody enlighten me...
-touch

Replies are listed 'Best First'.
Re: Re: Re: use HTTP::Cookies?
by chiller (Scribe) on Sep 14, 2001 at 21:58 UTC
    What exactly is the error? Compile-time or . . .?

    What platform are you using?

    chiller

      Alright, I'm using Perl v5.6.0 on red hat linux 7.0
      It gives me an error that says "Running make test" and that make test won't run. Then it says "Running make install", and then says it can't install. I was reading about these errors and I was told to run perl Makefile.pl but when I try, it tells me that Makefile.Pl doesn't exist. I tried looking for it on my system, and the only thing I found was a "...Makefile.htm" I'm sure that I'm missing something small and probably very easy to fix, but of course, I can't figure it out for the life of me. Thanks in advance for all your help and for helping me out before. (All the other stuff worked and I was able to run some other scripts)

      -touch

        I think you just made one small typo, but maybe it is worth going through "Installing Modules 102", as the existing docs, like perlmodinstall or perldoc -q module, or perlmodinstall2 seem to cover how to install a module but not quite what happens when you chant the magic words.

        The README files gives you the complete procedure, which is the same nearly all modules (with modules like XML::Parser, which rely on external libraries, you have to install those libraries first):

              perl Makefile.PL
              make
              make test
              make install
        

        So the typo you made seems to be that you typed perl Makefile.Pl (lower case l) while you should have typed perl Makefile.PL (upper case L).

        Now let's go through the installation instructions:

        • perl Makefile.PL will use the installation information from perl to generate a proper Makefile. After this file is generated, every time you use make in the directory it will get it's instructions from that file. It will for example know where it should later install the module so that all Perl programs can use it.
        • make builds the module in the current directory (and it's sub-dirs), if it's a pure-perl module not much happens here, except that the module file, the .pm file get copied from the current directory or from the lib/ directory to the appropriate place in the blib/lib/ directory (Simple.pm would be copied to blib/lib/XML/Simple.pm). The man page for the module also gets generated here. If the module includes C code that's also when it gets compiled and linked.
        • make test runs the test that the module author has provided, to check that it runs properly on your system. The tests can be either in the test.pl file in the current directory, or in the *.t files in the t/ directory.
        • make install installs the module. Under a multi-user OS this is often done as root to install in the Perl common directories, accessible though @INC, so it can be accessed by any user on the system. Simple.pm might be copied to /usr/local/lib/perl5/site_perl/5.6.1/XML/Simple.pm for example. Modules can also be installed in private directories, see How do I keep my own module/library directory?.