How to Manage Perl Modules When Using a Package Manager

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

Since this question was originally asked, perlbrew has been released. It makes installing custom, self-contained perl installs trivial. And switching between those versions is just as easy:

perlbrew switch $version

How can I package up my Perl app's dependencies for deployment?

As mentioned in the comments above, Pinto may suit your needs as it creates your own CPAN repo.

Pinto has two primary goals. First, Pinto seeks to address the problem
of instability in the CPAN mirrors. Distribution archives are
constantly added and removed from the CPAN, so if you use it to build
a system or application, you may not get the same result twice.
Second, Pinto seeks to encourage developers to use the CPAN toolchain
for building, testing, and dependency management of their own local
software, even if they never plan to release it to the CPAN.

Pinto accomplishes these goals by providing tools for creating and
managing your own custom repositories of distribution archives. These
repositories can contain any distribution archives you like, and can
be used with the standard CPAN toolchain. The tools also support
various operations that enable you to deal with common problems that
arise during the development process.


Second Answer

Alternatively, if you are only going to deploy to Ubuntu, you can turn CPAN modules - and your own into Debian packages with dh-make-perl. You can then host them in your own repo with reprepro. The beauty of this is that you can update the packages and do a

apt-get update
apt-get upgrade

on the client machines, so long as they have your own repo as a source

Windows batch file to install multiple perl modules - only the first line runs

In my Perl installation the command ppm is a batch file: ppm.bat (not an .exe)

When you call one batch file from another, the calling batch file is terminated together with the called batch file.

You need to use call in order to be able to run another batch file from within one batch file.


call ppm install Chart
call ppm install Template-GD
call ppm install MIME-tools
call ppm install XML-Twig
call ppm install PatchReader

What's the name of Perl distribution units?

Distribution (or "dist" for short).

The name for a Perl distribution unit is distribution, so cpanm XML::LibXML installs the XML-LibXML distribution, because it includes the specified XML::LibXML module.

Example 1

Screenshot of meta::cpan using the word "distribution"

Example 2

Screenshot of meta::cpan using the word "distribution"

Note that linux distributions usually have a package manager such as apt or yum, and many Perl distributions are made available as packages for those package managers. Someone using those package managers might refer to Perl distributions as packages, but that's not standard Perl jargon.



Related Topics



Leave a reply



Submit