johannp has asked for the wisdom of the Perl Monks concerning the following question:

I am creating a module where I provide both a Build.PL file and a Makefile.PL file. With Build.PL it is easy to require a minimum perl version by specifying some version string for the "perl" entry in the "requires" hash, but this does not work with Makefile.PL. How can this be done with Makefile.PL? What is the recommended way to make sure with Makefile.PL that the module is only used with a specific minimum perl version?
  • Comment on specify minimum perl version with Makefile.PL?

Replies are listed 'Best First'.
Re: specify minimum perl version with Makefile.PL?
by Anonymous Monk on Jan 14, 2010 at 09:01 UTC
    The same way you should in your module, with use
    use 5.6.1;
    Unless you're certain of the requirement, you should avoid specifying a minimum version. Perl::MinimumVersion can help you find a minimum required version of perl for Perl code
        Thank you -- that might have brought me on the right track. When I include this in Makefile.PL I get the message "WARNING: MIN_PERL_VERSION is not a known parameter.". However searching for the parameter I found http://wiki.cpantesters.org/wiki/CPANAuthorNotes so I am now using a simple use 5.008001; at the start of Makefile.PL.

        I do not understand why using MIN_PERL_VERSION shows that message about an unknown parameter though.

Re: specify minimum perl version with Makefile.PL?
by Herkum (Parson) on Jan 14, 2010 at 15:06 UTC

    You can use Module::Build to create your Makefile.PL which effectively is a wrapper to your Build.PL. Do this and you don't have to support two separate installers for your module.