Installing perl module: cpan shell vs rpm/deb

喜欢而已 提交于 2019-12-10 15:24:25

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/7964958/installing-perl-module-cpan-shell-vs-rpm-deb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!