From: brian m. carlson Date: Wed, 04 Nov 2026 22:28:30 GMT Subject: Re: [PATCH] CodingGuidelines: update the required Perl version Message-ID: In-Reply-To: On 2026-11-04 at 19:56:57, Junio C Hamano wrote: > Tuomas Ahola writes: > > > Junio C Hamano wrote: > > > >> Tuomas Ahola writes: > >> > >> > - - We try to support Perl 5.8.1 and later ("use Perl 5.008001"). > >> > + - We try to support Perl 5.26.0 and later ("use Perl 5.026000"). > >> > >> Is this in line with what 702d8c1f3b did? Shouldn't we say > >> > >> > + - We try to support Perl 5.26.0 and later ("require v5.26"). > >> > >> "require v5.26" instead? > >> > > > > Frankly, I don't make head nor tail of such Perl minutiae. I would find that > > parenthetical much more useful if it told exactly when we are supposed to use > > such incantations. > > I do not claim to be intimately familiar, but you can consult the > commit you cited as the reason why you decided to make this update. > > $ git show 702d8c1f3b > commit 702d8c1f3b5377a64670b0f22add157b0bfc33dd > Author: brian m. carlson > Date: Wed Oct 23 00:45:59 2024 +0000 > > Require Perl 5.26.0 > > Our platform support policy states that we require "versions of > ... > Use require instead of use to avoid changing the behavior as the latter > enables features and the former does not. > > Signed-off-by: brian m. carlson > Signed-off-by: Taylor Blau > > ... > diff --git a/contrib/diff-highlight/DiffHighlight.pm b/contrib/diff-highlight/DiffHighlight.pm > index 636add6968..3d061bc0b7 100644 > --- a/contrib/diff-highlight/DiffHighlight.pm > +++ b/contrib/diff-highlight/DiffHighlight.pm > @@ -1,6 +1,6 @@ > package DiffHighlight; > > -use 5.008001; > +require v5.26; > use warnings FATAL => 'all'; > use strict; > > It looks to me that the "parenthetical" you called was designed to > be useful by telling you what to have near the top of your Perl > source files. Replacing it with "require v5.26" is exactly in line > with that, I would think. As mentioned above, you want `require`, not `use`, with Perl versions. The latter enables the relevant features, which include Unicode strings as of 5.12, and that will change the behaviour of our code in ways we're probably not expecting. That didn't happen in 5.8.1 because features didn't exist, so the `use` for that version was okay. You effectively always want `require v5.26` or something equivalent such as `require 5.026` in our codebase. The former is nicer to read, though. -- brian m. carlson (they/them) Toronto, Ontario, CA Speaking for myself only