Вопрос

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?

Это было полезно?

Решение

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.

Другие советы

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top