[Melbourne-pm] CPAN Vs Package managers

Craig Sanders cas at taz.net.au
Wed May 9 21:09:03 PDT 2007

On Thu, May 10, 2007 at 11:10:32AM +1000, Leigh Sharpe wrote:
> Just wanted some people's thoughts on what the 'best' way to install
> perl modules on linux is: CPAN or your distro's package manager.
> A large number of perl modules have been packaged and made part of the
> distro. When setting up a virgin system, am I better to use CPAN to
> install my modules, or use the package manager?

if the distro has a package for the perl module you want, then use the
distro's package - that way all dependancies will end up being satisifed
(both packages that your module depends on and packages that depend on
your module)

for modules that aren't already packaged, there are two basic choices -
depending on what tools the distro provides.

on a decent distribution (i.e. debian or debian-based), you'll have a tool
called dh-make-perl  use it like so:

  dh-make-perl --build --cpan Perl::Module::Name

it will download Perl::Module::Name from CPAN and build a debian package
for it that will meet all relevant policy standards. the newly created
package can be installed with dpkg, and can be copied to other servers
that need it (e.g. with scp), or placed in your own local package

this works without any additional effort for most perl modules. for
some, modules, though, you will need to either package it by hand or
(better) use dh-make-perl to do the bulk of the packaging work and edit
the packaging control files by hand.

alternatively, or on distros without such automated packaging tools, install
it using the CPAN tools.

there's also a third option, of course - submit a bug report or request
to your distro's bug/request-tracking system asking for the perl module
to be packaged.

> others are of the opinion that using CPAN gives better control over
> upgrades and versioning, etc. 

only on unixes and/or linux distros that have crappy package management


craig sanders <cas at taz.net.au>

"In Christianity neither morality nor religion come into contact with
reality at any point."
		-- Friedrich Nietzsche

More information about the Melbourne-pm mailing list