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

Hi monkses. What's the best way to put the minimum Perl version number required by a module into the Makefile.PL? For Module::Build I can simply add the version number to the "requires" hash reference, but the equivalent for ExtUtils::MakeMaker (PREREQ_PM) doesn't seem to have that option. Should I simply specify use 5.00x; at the top of the Makefile.PL?

The reason I'm asking is that I don't want the automatic CPAN testers to download and test my module if they've got a lower version of Perl installed than is required. I'm hoping that putting the minimum version somewhere into the build process will prevent this.

Update: seems the correct solution is indeed to add a use 5.00x; to the Makefile.PL. Thank you for your help (useful link that, ferreira!)


All dogma is stupid.

Replies are listed 'Best First'.
Re: Specifying the minimum Perl version for ExtUtils::MakeMaker
by ferreira (Chaplain) on Feb 29, 2008 at 23:39 UTC
Re: Specifying the minimum Perl version for ExtUtils::MakeMaker
by Tanktalus (Canon) on Feb 29, 2008 at 23:12 UTC

    I think the "use <version number>;" at the top is likely your best bet... or just skip the Makefile.PL altogether - CPAN seems to understand Module::Build-based modules.

    (I actually tried to create a new module with Build.PL specifying the minimum perl version, and then asked Build.PL to create the Makefile.PL - seems the Module::Build guys don't know how to do this, either.)

Re: Specifying the minimum Perl version for ExtUtils::MakeMaker
by almut (Canon) on Feb 29, 2008 at 23:30 UTC
    Should I simply specify use 5.00x; at the top of the Makefile.PL?

    The Makefile.PL of ExtUtils::MakeMaker itself has BEGIN { require 5.006; } at the top, so it can't be all that wrong... :)