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

wise monks

I'm a perl beginner using perl 5.10. i am trying to use a program which says it has a dependency on file::stat so i tried to install this and got this message

pan[5]> install File::stat Running install for module 'File::stat' The most recent version "1.02" of the module "File::stat" is part of the perl-5.12.2 distribution. To install that, you need to +run force install File::stat --or-- install J/JE/JESSE/perl-5.12.2.tar.gz Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: JESSE/perl-5.12.2.tar.gz : make NO isa perl
I don't know whether to do the force install suggested as I don't know whether there will be any problems

thanks for your help

Replies are listed 'Best First'.
Re: should i force install
by moritz (Cardinal) on Dec 04, 2010 at 18:06 UTC

    File::stat has been a core module since perl 5.004. So your perl 5.10 should come with File::stat installed.

    If not, your perl installation is broken or incomplete, and should be fixed. (For example on Debian there's a minimal perl package, and you need to install perl-modules too to get all core modules).

    If File::stat is indeed available, you shouldn't need to install anything.

Re: should i force install
by ww (Archbishop) on Dec 04, 2010 at 18:02 UTC
    Conventional wisdom: don't force install the version for 5.12 in a 5.10 Perl...or any other version > 5.n into a 5.n Perl.

    There are exceptions, but as a general rule, mismatched modules are not likely to be compatible.

    Instead, try for the 5.10 version. And per (your line 12), you may still need a good "make"
    and, minor afterthought, but your text refers to "file::stat" which ignores the fact that Perl is case sensitive.

Re: should i force install
by Khen1950fx (Canon) on Dec 04, 2010 at 23:29 UTC
    File::stat 1.01 is probably what you have. It's core, but when you're a beginner, it can be confusing, especially when some of the core modules are dual-lived, meaning that they can be upgraded or reinstalled.

    If you use App::DualLivedList, it'll tell you the current version, installed version, installed path, if it's dual-lived or not, or if it's just a core module. Just do dual-lived File::stat.