开发者

How to handle modules that require Perl devel version on CPAN?

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 ?


Date::Manip requires Perl 5.10 to function, see the META.yml:

requires:
  ...
  perl: 5.010

The older version (5.56) 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.


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.


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.


@sebthebert if you want CPAN.pm to only try to install modules that are known to work with your version of perl, see http://cpxxxan.barnyard.co.uk/.


The Centos project provides a version of Date::Manip that works with their version of Perl. It's pre-packaged to work with yum. Currently that seems to be Date::Manip version 5.44 (which predates the requirement for Perl 5.10).

$ sudo yum install perl-Date-Manip

As an aside, are you sure you want to use Date::Manip? DateTime is usually a better choice.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜