7

I'm working on my Net::Prober distribution, using dzil. From the next version I'd like to enforce a minimum requirement of perl 5.10+ (was 5.006), because I'm using named captures :-)

Now I have put use 5.010; at the top of my main module, and that's fine, but I was wondering: is there a way to specify a minimum perl interpreter version in the dist.ini file?

My current dist.ini is:

name    = Net-Prober
version = 0.07
...

[Prereqs]
Carp = 0
Data::Dumper = 0
Digest::MD5 = 0
IO::Socket::INET = 0
IO::Socket::SSL = 0
IO::Socket::UNIX = 0
LWPx::ParanoidAgent = 0
Net::Ping = 2.34
Sys::Syslog = 0

[Prereqs / TestRequires]
Test::More = 0
LWP::Online = 0

...

Can I just add perl = 5.010 to the [Prereq] block?

3
  • Dist::Zilla seems to accept perl = 5.010 in the [Prereq] block AFAICS :) Commented Jul 20, 2012 at 7:27
  • 1
    You could use the distmeta function to add a MIN_PERL_VERSION => '5.010' directive to your module's metadata. The CPAN installers (any fairly recent version) will respect it. Commented Jul 20, 2012 at 9:08
  • [AutoPrereqs] will also detect use 5.010; in any module. Commented Jul 24, 2012 at 19:48

1 Answer 1

8

Can I just add perl = 5.010 to the [Prereq] block?

Yes, you can. Alternatively, there's the MinimumPerl plugin that autodetects the minimal version of perl that's required.

Sign up to request clarification or add additional context in comments.

3 Comments

The MinimumPerl plugin (via Perl::MinimumVersion) is a bit out of date though.. for example it doesn't detect any features introduced in 5.14 (and possibly 5.12) or later.
@Ether: It does detect features from 5.12 (including the ... operator), but you're right it hasn't been updated for 5.14 or higher. I'm sure Adam accepts patches ;-)
Looks like NEILB adopted this module in the meantime, so it has had some updates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.