"I rely on Makefile.PL do specify the minimum Perl version."
I didn't think that would be enough, so I ran some tests.
ken@titan ~/tmp/pm_11152747_min_ver
$ module-starter --module=Bod::Min::Ver
...
Created starter directories and files
$ cd Bod-Min-Ver
# Modified lib/Bod/Min/Ver.pm
package Bod::Min::Ver;
#use v5.36; <--- commented out
our $VERSION = '0.001';
print "$^V\n"; <--- newly added
# remainder unchanged
$ cat Makefile.PL
...
MIN_PERL_VERSION => '5.036',
...
$ perlbrew switch perl-5.34.0
$ perl -v | head -2 | tail -1
This is perl 5, version 34, subversion 0 (v5.34.0) built for cygwin-th
+read-multi
$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Warning: Perl version 5.036 or higher required. We run 5.034000.
Generating a Unix-style Makefile
Writing Makefile for Bod::Min::Ver
Writing MYMETA.yml and MYMETA.json
$ make
cp lib/Bod/Min/Ver.pm blib/lib/Bod/Min/Ver.pm
Manifying 1 pod document
$ make test
...
t/00-load.t ............. Perl v5.36.0 required--this is only v5.34.0,
+ stopped at t/00-load.t line 3.
... all other tests failed in a similar fashion ...
$ perldoc lib/Bod/Min/Ver.pm
... POD template shown correctly ...
$ perl -e 'use lib "./lib"; use Bod::Min::Ver'
v5.34.0
So, `perl Makefile.PL` only provides an advisory warning,
and module can still be loaded with a Perl version earlier than MIN_PERL_VERSION.
Recommendation: include "use VERSION;".
"Is there any data anywhere on how many people are actually using really old versions of Perl?"
It's possible that there's usage information somewhere, maybe from some sort of survey, but I'm unaware of such;
perhaps another monk knows.
My guesses would be (mostly based on SoPW posts that I remember):
-
5.6 and earlier:
a very small number; mostly academic interest and hobbyists.
-
5.8 & 5.10:
there seems to be a small number of ISPs, with minimal Perl support, who provide these versions.
-
5.12 and later:
probably depends on whether you categorise these as "really old versions".
My "Out-of-the box Perl version - lowest common denominator" post, from a couple of years ago, may provide some insights.
"Does CPAN collect it from install requests?"
That seems unlikely.
After downloading a module tarball (which may not even involve Perl) there's no further interaction with CPAN directly.
|