Which cpan installer is the right one? (CPAN.pm/CPANPLUS/cpanminus)

前端 未结 5 1988
独厮守ぢ
独厮守ぢ 2020-11-29 22:05

There are multiple installers for cpan modules available; I know of at least CPAN.pm (comes with perl,) CPANPLUS, and cpanminus.

What is the difference between the t

相关标签:
5条回答
  • 2020-11-29 22:26

    It's impossible answer this question because it is too subjective. :)

    From my point of view: cpanm is the simplest way install perl modules. You can install cpanm with:

    curl -L http://cpanmin.us | perl - --sudo App::cpanminus
    

    and after it you can install modules with simple:

    cpanm Some::Module
    

    You can use cpanm for mirroring (part of) CPAN to you local machine too, so IMHO cpanm is the best for the most common CPAN needs.

    0 讨论(0)
  • 2020-11-29 22:29

    Are there other module installers I should know about?

    If you're using a Linux distribution that packages CPAN modules, then it's worth using their package installation program to install modules. For example, Ubuntu/Debian have a huge number of CPAN modules that you can install using 'apt' and Red Hat/Centos/Fedora have a number that you can install using 'yum'.

    0 讨论(0)
  • 2020-11-29 22:32

    CPAN.pm (cpan) is the original client. It comes with Perl, so you already have it. It has the most features. It has a lot of configuration options to customize the way it works, though virtually everyone accepts the default installation. It integrates easily with local::lib.


    cpanminus (cpanm) is an attempt to make a zero-configuration client that automatically does the right thing for most users. It's also designed to run well on systems with limited resources (e.g. a VPS). It doesn't come with Perl, but it's easy to install. It integrates easily with local::lib.

    Its biggest limitation is its lack of configuration. If you want to do something unusual, it may not support it.


    CPANPLUS (cpanp) is an attempt to make a CPAN API that Perl programs can use, instead of an app that you use from the command line. The cpanp shell is more of a proof-of-concept, and I don't know of any real advantages to using it.


    In summary, I'd recommend either cpan or cpanm. If you have trouble configuring cpan, try cpanm. If your situation is unusual, try cpan.

    0 讨论(0)
  • 2020-11-29 22:36

    cpanm uses much less memory. This makes it a better choice for environments where RAM is limited, such as shared hosting servers, where regular cpan might die before completing installation task, due to attempting to use more than available memory.

    According to cpanm's (1.7044) documentation "When running, it requires only 10MB of RAM"

    0 讨论(0)
  • 2020-11-29 22:48

    CPAN is the standard. cpanminus (cpanm) asks fewer questions (best most of the time). I don't know anyone that uses cpanplus.

    Since what these modules do is download, compile and install (place files in correct places) they all should do the same task. Some of the difference has to do with the permissions level you have. Perhaps you want to install some things local to your user and some things globally then you need a finer adjustment. Developers may also need to control/interrupt the process for debugging etc.

    For daily use, use cpanm, unless you are too lazy to install it, then CPAN is fine.

    0 讨论(0)
提交回复
热议问题