Issue
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?
Solution
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.
Answered By - nxadm Answer Checked By - Gilberto Lyons (WPSolving Admin)