cpan

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

北城以北 提交于 2019-11-27 06:43:19
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 three? What situations call for using one over the other? Are there other module installers I should know about? cjm 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

How can I install a specific version of a set of Perl modules?

被刻印的时光 ゝ 提交于 2019-11-27 06:06:30
I'm tasked with replicating a production environment to create many test/sit environments. One of the things I need to do is build up Perl, with all the modules which have been installed (including internal and external modules) over the years. I could just use CPAN.pm autobundle, but this will result in the test environment having much newer versions of the external modules that production has. What is the easiest/best way to get and install (a lot of) version specific Perl modules. Make your own CPAN mirror with exactly what you want. Stratopan.com , a service, and Pinto , tools that's built

How do I tell CPAN to install all dependencies?

坚强是说给别人听的谎言 提交于 2019-11-27 05:48:41
How do I tell CPAN to install all dependencies? I tried setting these in cpan : cpan> o conf prerequisites_policy follow cpan> o conf commit I still had to answer "y" a couple of times (but fewer than before it feels like). Is there a way to get it to always go ahead and install? I want to make it unattended. It would seem that I want a flag to always trust CPAN to do the right thing, and if it suggests an answer I would like to follow it (always hit Enter when it asks something). Atento Here is the one-liner making these changes permanent including automatic first-time CPAN configuration:

How can I find the version of an installed Perl module?

馋奶兔 提交于 2019-11-27 04:12:39
问题 How do you find the version of an installed Perl module? This is in an answer down at the bottom, but I figure it important enough to live up here. With these suggestions, I create a function in my .bashrc function perlmodver { perl -M$1 -e 'print "Version " . $ARGV[0]->VERSION . " of " . $ARGV[0] . \ " is installed.\n"' $1 } 回答1: Why are you trying to get the version of the module? Do you need this from within a program, do you just need the number to pass to another operation, or are you

How can I install CPAN modules locally without root access (DynaLoader.pm line 229 error)?

本秂侑毒 提交于 2019-11-27 03:57:38
问题 Doesn't work with other modules, but to give an example. I installed Text::CSV_XS with a CPAN setting: 'makepl_arg' => q[PREFIX=~/lib], When I try running a test.pl script: $ perl test.pl #!/usr/bin/perl use lib "/homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi"; use Text::CSV_XS; print "test"; I get Can't load '/homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/Text/CSV_XS/CSV_XS.so' for module Text::CSV_XS: /homes/foobar/lib/lib64/perl5/site

How do I choose a package name for a custom Perl module that does not collide with builtin or CPAN packages names?

醉酒当歌 提交于 2019-11-27 03:43:38
I have read the perldoc on modules , but I don't see a recommendation on naming a package so it won't collide with builtin or CPAN module/package names. In the past, to develop a local Session.pm module, I have created a local directory using my company's name, such as: package Company::Session; ... and Session.pm would be found in directory Company/. But I'm just not a fan of this naming convention. I would rather name the package hierarchy closer to the functionality of the code. But that's how it's done on CPAN generally... I feel like I am missing something fundamental. I also looked in

How can I install CPAN modules locally without root access (DynaLoader.pm line 229 error)?

你离开我真会死。 提交于 2019-11-27 02:10:07
Doesn't work with other modules, but to give an example. I installed Text::CSV_XS with a CPAN setting: 'makepl_arg' => q[PREFIX=~/lib], When I try running a test.pl script: $ perl test.pl #!/usr/bin/perl use lib "/homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi"; use Text::CSV_XS; print "test"; I get Can't load '/homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/Text/CSV_XS/CSV_XS.so' for module Text::CSV_XS: /homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/Text/CSV_XS/CSV_XS.so: cannot open shared object file: No

How do I set up a local CPAN mirror?

£可爱£侵袭症+ 提交于 2019-11-27 02:03:33
问题 What do I need to set up and maintain a local CPAN mirror? What scripts and best practices should I be aware of? 回答1: This could be useful: http://www.cpan.org/misc/cpan-faq.html#How_mirror_CPAN 回答2: CPAN::Mini is the way to go. Once you've mirrored CPAN locally, you'll want to set your mirror URL in CPAN.pm or CPANPLUS to the local directory using a "file:" URL like this: file:///path/to/my/cpan/mirror If you'd like your mirror to have copies of development versions of CPAN distribution, you

How do YOU manage Perl modules when using a package manager?

偶尔善良 提交于 2019-11-26 22:06:00
A recent question here on SO got me thinking. On most Linux distributions that I tried, some Perl modules would be available through the package manager. Others, of course, not. For quite a while I would use my package manager whenever I needed to install some CPAN module to find out whether a package was available or not and to install it when it was. The obvious advantage is that you get your modules updated whenever a new version of the package becomes available. However, you get in trouble when the module is not available in pre-packaged form and there are dependencies for that module that

Which Perl module would you recommend for JSON manipulation?

Deadly 提交于 2019-11-26 21:47:40
问题 As usual, I'm happy to deal with CPAN because it got all we need. As usual, I'm lost because there is plenty of stuff. I can find the core JSON one by myself, and feel enthusiastic by a JSON::Tiny other. My needs are very simple (parsing stuffs from the Open Library API) and, maybe someday, expose our own data. Is there any other modules that you like for this task? 回答1: JSON module works like a champ, but if you need a faster parser, use this one: JSON::XS, which requires a native