Bumping your code's Perl version
Which Perl module do you want to write about: Perl::Version::Bumper (to be released)
Please give a short description of the article you want to write. Two to three sentences is fine:
The article would describe what use VERSION actually does, how Perl handles backward and forward compatibility, and how to use the above module to safely "bump" any Perl code to the desired version.
Not that it has to be part of the article, but I use PPI::App::ppi_version::BDFOY. Curious to see what you've come up with.
Curious to see what you've come up with.
The repository is here: https://github.com/book/Perl-Version-Bumper/.
I'd recommend looking at the test data to see the kind of transformation it does.
Also, before embarking on this journey, I did look for prior art. It seems I wasn't looking hard enough, or using the wrong keywords.
And I just realized that my description is very confusing. :sweat_smile:
This module is not about changing: our $VERSION = 1.23; into our $VERSION = 1.24; in random Perl files. It's about bumping the declared Perl language version of some source code to a more recent version.
For example, when asked to "bump" the following code snippet:
use v5.20;
use warnings;
use experimental 'signatures';
use feature 'lexical_subs';
no warnings 'experimental::lexical_subs';
no indirect;
For v5.26, it would produce:
use v5.26;
use warnings;
use experimental 'signatures';
no indirect;
because it knows that:
- the
lexical_subsfeature is enabled in the:5.26feature bundle (and it knows about experimental warnings)
For v5.32, it would produce:
use v5.32;
use warnings;
use experimental 'signatures';
no feature 'indirect';
because it knows that:
- the
indirectmodule is a compatibility module for theindirectfeature, - the
indirectfeature was introduced inv5.32
And for v5.36, it would produce:
use v5.36;
Because it knows that:
warningsare enabled by the:5.36feature bundle- the
signaturesfeature is enabled in the:5.36feature bundle (and it knows aboutexperimental) - the
indirectfeature is disabled in the:5.36feature bundle
That sounds pretty cool, along with Perl::MinimumVersion. I'd like to read this article.
As the author of Syntax::Construct, I'm interested, too.
Hello! This is your mid-November reminder that Advent is fast approaching. The first articles will go live in less than 3 weeks. We are very much looking forward to preparing your article for publication. If you could update this ticket with an ETA for your first draft that would be very helpful when it comes to planning ahead for editing, proofreading etc. π²π€Άπ π§
Hello! π This is your late November reminder that we are going live in just a few days. Could you update this ticket with a target date for your first draft? π
Article was already merged. \o/