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

I'm trying to install Spreadsheet::WriteExcel.
This package has prerequisites of
File::Spec and File::Temp.
So I download the following files...
File-Spec-0.82.tar.gz
File-Temp-0.12.tar.gz
Spreadsheet-WriteExcel-0.40.tar.gz
and do a gunzip and tar xf on all three.

For purposes of testing (so I don't have to bother
the sysadmins) I create a directory called perllib in
my home directory and start with File::Spec.
I do..
1. perl Makefile.PL LIB=~/perllib
2. make test
3. make install
everything is fine to this point. (except for complaints
about trying to install man pages in the real perl
directories)
Then I go to install File::Temp (which needs File::Spec).
I do..
1. perl Makefile.PL LIB=~/perllib
but I get a warning...
Warning: prerequisite File::Spec 0.8 not found at (eval 1) line 220.
Writing Makefile for File::Temp
so I continue with...
2. make test
but I get multiple errors from perl stating "File::Spec version 0.8 required"

So the question is, what do I change in the File::Temp
Makefile.PL (listed below) to make it look for File::Spec
in my library directory and not perl's?

contents of File::Temp Makefile.PL

use ExtUtils::MakeMaker;

# Write the makefile
WriteMakefile(
'NAME' => 'File::Temp',
'VERSION_FROM' => 'Temp.pm', # finds $VERSION

'PREREQ_PM' => {
File::Spec => 0.8,
Fcntl => 1.03,
File::Path => undef,
},
'dist' => { COMPRESS => "gzip -9f" },
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'Temp.pm',
AUTHOR => 'Tim Jenness <t.jenness@jach.hawaii.edu>') : ()),
);

Replies are listed 'Best First'.
Re: make install problems
by MadraghRua (Vicar) on Jan 10, 2003 at 19:07 UTC
    Try using the CPAN shell to do your install.
    >perl -MCPAN -e shell
    will open it up for you. Something like:
    cpan> info /Spreadsheet::WriteExcel/
    will get you information on the package(s) available.
    cpan> install Module.pm
    will install it. When you first run CPAN it will configure your your environment. One quesion it will ask is whether it should ask about dependencies or whether it should simply follow them. As the foreman said when pointing to the line of shovels, "Take your pick."

    It will really make your life much simpler if you get into the habit of using the CPAN module. See section 12.17 Perl Cookbook for examples of how to run it or look at the documentation.

    Finally, if you're using a different library depository than the standard perl site specific one, make sure to put your directory at the front of the $PERL5LIB environment variable, perhaps in your start up shell. Make sure the variable is set before running the makes or you'll error out. Try looking into Perl Cookbook, section 12.7 for possible suggestions.

    MadraghRua
    yet another biologist hacking perl....

      I tried doing the "perl -MCPAN -e shell" command
      you suggested but it asks for something that we
      do not have on our system.
      It was ncftpget.
      The prompt for this won't let me by it unless I
      type something.
        Try this link which will take you to the appropriate web site. You need the client - proabably just use one of the precompiled binaries. Make sure to install in a bin that is part of your $PATH. Its pretty standard and either you or the admins should be able to install it easily.

        MadraghRua
        yet another biologist hacking perl....

Re: make install problems
by pfaut (Priest) on Jan 10, 2003 at 18:14 UTC

    Try export PERL5LIB=$HOME/perllib before running perl on the Makefile.PL (or the equivalent for csh if that's your shell).

    --- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
      + export PERL5LIB=/home/erickn/perllib
      + echo /home/erickn/perllib
      /home/erickn/perllib
      + perl Makefile.PL LIB=/home/erickn/perllib
      Writing Makefile for File::Temp
      + make test
      PERL_DL_NONLAZY=1 /usr/local/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.00503/sun4-solaris -I/usr/local/lib/perl5/5.00 503 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
      t/mktemp............File::Spec version 0.8 required--this is only version 0.6 at blib/lib/File/Temp.pm line 124.
      BEGIN failed--compilation aborted at blib/lib/File/Temp.pm line 124.
      BEGIN failed--compilation aborted at t/mktemp.t line 12.
      dubious
      Test returned status 255 (wstat 65280, 0xff00)
      DIED. FAILED tests 1-9
      Failed 9/9 tests, 0.00% okay
      t/posix.............File::Spec version 0.8 required--this is only version 0.6 at blib/lib/File/Temp.pm line 124.
      BEGIN failed--compilation aborted at blib/lib/File/Temp.pm line 124.
      BEGIN failed--compilation aborted at t/posix.t line 8.
      dubious
      Test returned status 255 (wstat 65280, 0xff00)
      DIED. FAILED tests 1-7
      Failed 7/7 tests, 0.00% okay
      t/security..........File::Spec version 0.8 required--this is only version 0.6 at blib/lib/File/Temp.pm line 124.
      BEGIN failed--compilation aborted at blib/lib/File/Temp.pm line 124.
      BEGIN failed--compilation aborted at t/security.t line 20.
      dubious
      Test returned status 255 (wstat 65280, 0xff00)
      DIED. FAILED tests 1-13
      Failed 13/13 tests, 0.00% okay
      t/tempfile..........File::Spec version 0.8 required--this is only version 0.6 at blib/lib/File/Temp.pm line 124.
      BEGIN failed--compilation aborted at blib/lib/File/Temp.pm line 124.
      BEGIN failed--compilation aborted at t/tempfile.t line 35.
      dubious
      Test returned status 255 (wstat 65280, 0xff00)
      DIED. FAILED tests 1-20
      Failed 20/20 tests, 0.00% okay
      Failed Test Status Wstat Total Fail Failed List of failed
      -------------------------------------------------------------------------------
      t/mktemp.t 255 65280 9 9 100.00% 1-9
      t/posix.t 255 65280 7 7 100.00% 1-7
      t/security.t 255 65280 13 13 100.00% 1-13
      t/tempfile.t 255 65280 20 20 100.00% 1-20
      Failed 4/4 test scripts, 0.00% okay. 49/49 subtests failed, 0.00% okay.
      *** Error code 2
      make: Fatal error: Command failed for target `test_dynamic'

      just to make sure I did a test to see what version of File::Spec was installed in /home/erickn/perllib
      so, I ran the following program...
      use lib "/home/erickn/perllib";
      use File::Spec;
      print "$File::Spec::VERSION\n";

      and it returned
      0.82
Re: make install problems
by jk2addict (Chaplain) on Jan 10, 2003 at 20:56 UTC

    Just for giggles, are you using the base perl in a FreeBSD ~4.6 server?

    I had the same/similiar problem with p5-SpamAssassin and p5-File-Spec. Current p5-File-Spec was installed via ports, but it still wasn't seen.

    The problem turned out to ge that the base perl's @INC was compiled so it would check the base patchs first, then the site_perl paths next. I other works, base perl modules were found first. site_perl modules were never found it they also existed in the base paths.

    Shortly thereof, perl was patched and a recompile fixed the @IN path order.

    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/43557
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/39337

Re: make install problems
by tonkin (Initiate) on Jan 10, 2003 at 21:40 UTC
    Check out my recent post on FindBin and File::Spec for some observations. http://www.perlmonks.com/index.pl?node_id=225965