in reply to Requring minimum perl version in a cpanfile

What build tool are you using? I use ExtUtil::MakeMaker, and in my Makefile.PL, I add the following directive:

MIN_PERL_VERSION => 5.010,

...and that seems to work for me.

Replies are listed 'Best First'.
Re^2: Requring minimum perl version in a cpanfile
by Anonymous Monk on Jan 19, 2017 at 22:46 UTC
    It's not going on cpan, so it's not going to use a build tool. No EUMM, no MB. Just "cpanm --installdeps ."

      If you were to use EUMM instead of cpanfile, cpanm --installdeps . would still work but you could specify your minimum Perl version.

      Your Makefile.PL can be as simple as

      use inc::Module::Install; name 'Dist-Name'; all_from 'lib/Dist/Name.pm'; do 'cpanfile'; ## as cpanfile uses Module::Install syntax perl_version '5.666'; ## make it die WriteAll;

      See Module::Install

        I think if you want to

        use inc::Module::Install;

        You will need to push '.' onto @INC starting with Perl 5.26.

        So likely the belt-and-suspenders approach would be

        use lib '.'; use inc::Module::Install;