2
votes

How would I know if a particular module is recommended for use with my older Perl version? Does CPANM or CPAN have argument to check that everything that will be brought in is valid for the version of Perl in use? I have old version of Perl and am hesitant bringing in additional libraries.

2
Attempting to install a module will not damage your Perl. If the module has tests, and they fail, it will simply not be installed. If its tests are not enough to detect an incompatibility with an old Perl version, the worst that can happen is that it's installed, and if you use it, your particular program will crash, not work or work in an unreliable way. But your Perl and all your other programs are not actually touched by that. - simbabque

2 Answers

3
votes

Check the CPAN Testers Matrix for the distribution(s) you are interested in. If the module will build and pass its tests on a particular version of perl and a particular OS, this page will tell you.

3
votes

If the distribution specified a minimum required version of Perl, it will be found in ->{prereqs}{runtime}{requires}{perl} in the META.json or META.yml file found in the distribution. For example, GFUJI/Mouse-v2.4.10 states a dependency on Perl 5.8.5.

Beyond that, you can view the results of volunteers that donate hardware and time to test every version of every module on CPAN. They are found in the CPAN Testers Matrix. Both search.cpan.org and metacpan.org link to the test result matrix of each distribution.

cpan and cpanm will heed the minimum version found in the META.json or META.yml; they won't even try to install a module that's requires a newer perl. cpan and cpanm will also run the test suite the distribution provides. Only if the test suite passes without error will they install the distribution.