tags:

views:

93

answers:

3

I'm testing my project installation script on CentOS5.5. My project need Date::Manip module which requires feature module...

When I try to install it (feature) through CPAN, CPAN wants to install Perl 5.9.5...

*** WHOA THERE!!! ***

    This is an UNSTABLE DEVELOPMENT release.
    The version of this perl5 distribution is 9, that is, odd,
    (as opposed to even) and that signifies a development release.
    If you want a maintenance release, you want an even-numbered version.

    Do ***NOT*** install this into production use.
    Data corruption and crashes are possible.

    It is most seriously suggested that you do not continue any further
    unless you want to help in developing and debugging Perl.

    If you *still* want to build perl, you can answer 'y' now,
    or pass -Dusedevel to Configure.

How can I handle this kind of problem ?

+4  A: 

use feature is a Perl pragma that was first introduced in the 5.10 stable release.

This probably means that Date::Manip requires Perl 5.10.

CPAN is wrong here, don't let it install a development Perl release.

szbalint
"CPAN is wrong here" Unfortunately, that's the solution.
Axeman
How dare you question the great and powerful Wizard of CPAN!?!?! (sorry, just noticed today's Google Doodle :) +1
DVK
@DVK In my dreams, CPAN would only suggests modules that are compliant with the Perl version installed on the system... :)
sebthebert
+3  A: 

In your specific situation, you can of course go with Perl 5.10 which is the stable version next after 5.9.

In generic situation when there's no later stable version, first you should try to see if the module you want has an older version compatible with your Perl version.

If not, it's a risk/reward trade-off. In a production environment, I'd personally tend to avoid any development branches, unless the success of a critical project hindges on just the module you need AND you can't use another module or roll your own. So far, I never encountered a situation - and can't even concieve of a plausible one - where there's no workaround.

DVK
+4  A: 

Date::Manip requires Perl 5.10 to function, see the META.yml at http://cpansearch.perl.org/src/SBECK/Date-Manip-6.11/META.yml:

requires:
  ...
  perl: 5.010

The older version, at http://search.cpan.org/CPAN/authors/id/S/SB/SBECK/Date-Manip-5.56.tar.gz, instead only requires perl 5.001 to function and should therefore be safe for you to install.

In other words, if you want that latest version you'll have to update your system's perl to at least 5.10. CentOS comes with an old 5.8.8 version, unfortunately.

mfontani
How can I install the old version ? (from cpan cli not from cpan shell)
sebthebert
`cpan SBECK/Date-Manip-5.56.tar.gz`
daxim
Or, if you have App::cpanminus, cpanm http://search.cpan.org/CPAN/authors/id/S/SB/SBECK/Date-Manip-5.56.tar.gz
mfontani
@daxim Thanks, it works ! Just one more question: How CPAN handles older version ? I only see 2 versions for Date::Manip... If in 2 weeks a new version of Date::Manip is released, what will going on ?
sebthebert
Unless the author explicitly removes them from CPAN, they'll usually be there. The BackPAN, instead, indexes all the versions, even the ones removed from CPAN: see http://backpan.perl.org/authors/id/S/SB/SBECK/ for the modules from that author.
mfontani
@mfontani Never heard of backpan before ! :o You deserve the 'Accepted answer' ! :)
sebthebert