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

perlver seems to do a good job of figuring out the syntax (except that --blame often fails to find the reason), but what about modules? Perl::MinimumVersion says "Future plans are to also add support for tracing module dependencies" but that hasn't happened yet. One might think corelist would help with core modules but it can be misleading. Let's say we use List::Util:
% corelist List::Util
List::Util was first released with perl v5.7.3
But 5.7.3 is not the version needed if uniq or uniqnum are used:

https://metacpan.org/dist/Scalar-List-Utils/changes:

1.44 -- 2016/03/17 23:08:46
        CHANGES
         * Added List::Util::uniq() and uniqnum()

% corelist -a List::Util | grep 1.44
NOPE

% corelist -r | grep 2016
v5.22.2     2016-04-29
...
5.22.2 is required to support uniq (or maybe an updated List::Util if that's possible). How do you determine what version of Perl your program requires? A robot told me this is a real gap in the Perl ecosystem...
  • Comment on How do you determine what version of Perl your program requires?

Replies are listed 'Best First'.
Re: How do you determine what version of Perl your program requires?
by LanX (Saint) on May 07, 2026 at 23:44 UTC
    I'd say: Every module you use should include a use VERSION ° for the minimal version needed.

    So descending and checking one level should give you the needed versions and you have to require the upper bound.

    Of course this requires that all those modules already did their "homework" by checking one level deeper, etc...

    If you want to automate this, maybe consider an @INC hook which is parsing all required modules for VERSIONs before evaluating them and emitting the max version found after compilation was done.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

    UPDATE

    °) actually require VERSION is the cleaner approach for exactly this semantic, because it doesn't also activate features like use VERSION does

Re: How do you determine what version of Perl your program requires?
by LanX (Saint) on May 08, 2026 at 00:56 UTC
    After rereading your question thrice, it seems you want to know the minimal module version which inserted a certain exported feature.

    The questions if it's in core and from which Perl version on are secondary.

    Please note that this is a different question to asking for the minimal Perl version, since you can list needed module versions in your distro and in the use MODULE VERSION syntax.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery