Skip to content

Latest commit

 

History

History
79 lines (63 loc) · 3.43 KB

find_out_what_your_perl_minimum_version_requirement_is.md

File metadata and controls

79 lines (63 loc) · 3.43 KB

Find out what your Perl minimum version requirement is

This can be done quite easily using the magnificent tool: Perl::MinimumVersion by Neil Bowers.

The distribution includes the CLI tool perlver.

You can use it on a single file:

± perlver lib/Test/Timer.pm

   ------------------------------------------------
 | file              | explicit | syntax | external |
 | ------------------------------------------------ |
 | lib/Test/Timer.pm | ~        | v5.6.0 | n/a      |
 | ------------------------------------------------ |
 | Minimum explicit version : ~                     |
 | Minimum syntax version   : v5.6.0                |
 | Minimum version of perl  : v5.6.0                |
   ------------------------------------------------

Or you can use it on a directory, your distribution for example. Do note that this is not as fast as it is useful.

$ perlver .

   -----------------------------------------------------------------
 | file                               | explicit | syntax | external |
 | ----------------------------------------------------------------- |
 | t/test-tester.t                    | ~        | v5.6.0 | n/a      |
 | t/time_alert.t                     | ~        | v5.6.0 | n/a      |
 | t/_benchmark.t                     | ~        | v5.5.3 | n/a      |
 | t/Test/Timer/Test.pm               | ~        | v5.6.0 | n/a      |
 | prototypes/benchmark.pl            | ~        | v5.6.0 | n/a      |
 | prototypes/time_ok.pl              | ~        | v5.6.0 | n/a      |
 | prototypes/time_between.pl         | ~        | v5.6.0 | n/a      |
 | prototypes/time_atleast.pl         | ~        | v5.6.0 | n/a      |
 | prototypes/time_atmost.pl          | ~        | v5.6.0 | n/a      |
 | prototypes/list_context.pl         | ~        | v5.6.0 | n/a      |
 | prototypes/time_nok.pl             | ~        | v5.6.0 | n/a      |
 | prototypes/regex.pl                | ~        | v5.6.0 | n/a      |
 | lib/Test/Timer.pm                  | ~        | v5.6.0 | n/a      |
 | lib/Test/Timer/TimeoutException.pm | ~        | v5.6.0 | n/a      |
 | ----------------------------------------------------------------- |
 | Minimum explicit version : ~                                      |
 | Minimum syntax version   : v5.6.0                                 |
 | Minimum version of perl  : v5.6.0                                 |
   -----------------------------------------------------------------

And as you can read the minimum is provided to you.

If you want to find out as to why a certain version is required you can use the --explain flag.

$ perlver --blame lib/Test/Timer.pm

 ------------------------------------------------------------
 File    : lib/Test/Timer.pm
 Line    : 3
 Char    : 1
 Rule    : _perl_5006_pragmas
 Version : 5.006
 ------------------------------------------------------------
 use warnings;
 ------------------------------------------------------------

Remember to specify in your minimum requirements in your distribution requirements or similar afterwards.

Resources and References