What's the easiest way to install a missing Perl module?
Otto made a good suggestion. This benefits Debian also, along with any kind of various other Debian by-product. The missing out on item is what to do when proper - cache search does not locate something.
$ sudo apt-get install dh-make-perl build-essential apt-file $ sudo apt-file update
Then whenever you have an arbitrary module you desire to install:
$ cd ~/some/path $ dh-make-perl --build --cpan Some::Random::Module $ sudo dpkg -i libsome-random-module-perl-0.01-1_i386.deb
This will certainly offer you a deborah plan that you can install to get Some:: Random:: Module. Among the large advantages below is male web pages and also example manuscripts along with the module itself will certainly be positioned in your distro is area of selection. If the distro ever before brings out a main plan for a more recent variation of Some:: Random:: Module, it will instantly be mounted when you proper - get upgrade.
Lots of referral for
CPAN.pm, which is wonderful, yet if you are making use of
Perl 5.10 after that you've additionally obtained accessibility to
CPANPLUS.pm which resembles
CPAN.pm yet far better.
And also, certainly, it is readily available on
CPAN for individuals still making use of older variations of Perl. Why not attempt:
$ cpan CPANPLUS
A number of individuals stated the cpan energy, yet it is greater than simply beginning a covering. Simply offer it the components that you intend to install and also allow it do it is job.
$prompt> cpan Foo::Bar
If you do not offer it any kind of debates it begins the CPAN.pm covering. This works with Unix, Mac, and also need to be simply great on Windows (specifically Strawberry Perl).
There are numerous various other points that you can do with the cpan device too. Below is a recap of the existing attributes (which could be more recent than the one that features CPAN.pm and also perl):
-a Creates the CPAN.pm autobundle with CPAN::Shell->autobundle. -A module [ module ... ] Shows the primary maintainers for the specified modules -C module [ module ... ] Show the Changes files for the specified modules -D module [ module ... ] Show the module details. This prints one line for each out-of-date module (meaning, modules locally installed but have newer versions on CPAN). Each line has three columns: module name, local version, and CPAN version. -L author [ author ... ] List the modules by the specified authors. -h Prints a help message. -O Show the out-of-date modules. -r Recompiles dynamically loaded modules with CPAN::Shell->recompile. -v Print the script version and CPAN.pm version.
I keep in mind some individuals recommending one run cpan under sudo. That made use of to be essential to install right into the system directory site, yet modern-day variations of the CPAN covering permit you to configure it to make use of sudo simply for mounting. This is much more secure, given that it suggests that examinations do not run as origin.
If you have an old CPAN covering, merely install the new cpan ("install CPAN") and also when you refill the covering, it needs to motivate you to set up these new instructions.
Nowadays, when I'm on a system with an old CPAN, the first point I do is upgrade the covering and also set it approximately do this so I can do a lot of my cpan job as a regular customer.
Additionally, I 'd highly recommend that Windows customers explore strawberry Perl. This is a variation of Perl that comes packaged with a pre - set up CPAN covering along with a compiler. It additionally consists of some tough - to - compile Perl components with their exterior C collection dependences, especially XML:: Parser. This suggests that you can do the very same point as every various other Perl customer when it involves mounting components, and also points often tend to "just work" a whole lot regularly.
2 manner ins which I recognize of:
With Windows (ActivePerl) I've made use of ppm
from the command line type ppm. At the ppm punctual
ppm> install foo
ppm> search foo
to get a checklist of foo components readily available. Type aid for all the commands
you can additionally make use of CPAN similar to this ( * nix systems ):
perl -MCPAN -e 'shell'
obtains you a punctual
at the punctual
cpan> install foo (again to install the foo module)
type h to get a checklist of commands for cpan
If you get on Ubuntu and also you intend to install the pre - packaged perl module (as an example, geo:: ipfree) attempt this:
$ apt-cache search perl geo::ipfree libgeo-ipfree-perl - A look up country of ip address Perl module $ sudo apt-get install libgeo-ipfree-perl
On Unix :
generally you start cpan in your covering:
and also type
or basically kind:
On Windows :
If you are making use of ActivePerl on Windows, the PPM (Perl Package Manager) has a lot of the very same capability as CPAN.pm.
ppm> search net-smtp¢
ppm> install Net-SMTP-Multipart
see How do I install Perl modules? in the CPAN FAQ
Many circulations deliver a great deal of perl components as plans.
apt-cache search 'perl$'
- Arch Linux:
pacman -Ss '^perl-'
- Gentoo: group
You need to constantly favor them as you gain from automated (protection) updates and also the convenience of elimination . This can be rather complicated with the cpan device itself.