Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing perl module: cpan shell vs rpm/deb

Tags:

perl

yum

deb

I just wonder - are there any advantages to installing perl modules from the cpan shell compared to installing them by package management? Apart from occasionally having quicker access to the latest modules version?

like image 876
moodywoody Avatar asked Nov 01 '11 10:11

moodywoody


People also ask

What is CPAN shell?

CPAN (Comprehensive Perl Archive Network) is is a repository of over 250,000 Perl modules, written by over 12,000 contributors. See CPAN Website at https://www.cpan.org for more information. CPAN Shell is Perl module that provides an shell interface to manage installations of CPAN Perl modules.

How do I know what CPAN modules are installed?

Available commands are: l - List all installed modules m - Select a module q - Quit the program cmd? Sample outputs: Installed modules are: JavaScript::SpiderMonkey Log::Log4perl Perl cmd?


2 Answers

Well, it all depends on the intended use of the modules.

The native package management has many advantages:

  • The Perl modules will integrate perfectly with your system, e.g. files are in the right (system-dependant) place, scripts added to the PATH, etc.
  • Automatic upgrades and security patching.
  • Probably a maintainer or maintainer group that care about your modules (e.g. the Debian Perl group).
  • Distribution-specific bugs can be fixed before reaching mainstream (that may or not have the platform specific knowledge).
  • When deploying to machines with the same OS-version, you can take the packages dependencies for granted.

When installing directly from CPAN, you also have some advantages:

  • You can install the latest release of the module.
  • You can install an specific version (older or developers's release) of the module.
  • You can fine-tune the compilation or installation parameters of the module.

Nowadays, local::lib and perlbrew (howto) has made the CPAN way a lot more interesting for a developer. local::lib lets you have your private module tree while using the system's perl binary and perlbrew lets you easily create your own complete Perl installations (also several Perl releases in parallel).

Both ways are valid, and as said, the advantage depends on the intended usage.

like image 125
nxadm Avatar answered Sep 24 '22 00:09

nxadm


Using a native CPAN client gives you access to all modules on CPAN, most of which probably aren't packaged by your distro, but at the cost of your distro's package manager not knowing that they're installed (for dependency resolution, etc.). I know that Debian provides the dh-make-perl package for converting CPAN modules to debs, which seems like it should give you the best of both worlds, but I've never tried it myself.

The most important thing, though, is to pick one method or the other and stick with it.

like image 25
Dave Sherohman Avatar answered Sep 21 '22 00:09

Dave Sherohman