Front page | perl.perl5.porters |
Postings from July 2020
From: Matt S Trout
July 4, 2020 12:49
Message ID: 20200704120513.GD20268@vps-6c71e929.vps.ovh.net
An alternative idea to the 'vX' approach - some years ago, we coined syntax.pm
with the intent of that being usable to do "either use an XS module or a core
feature depending on whether there was a core feature for $whatever yet" - so
repurposing that namespace seems entirely fine.
What that would look like is:
use syntax v5;
use syntax v7;
use syntax v8-preview;
Note that all three of these parse as-is so it should be possible to make
syntax.pm dual-life and thereby allow support for that on older perls where
a too-new version would simply throw an error.
This would also make it feasible to provide Todd's desire of
use syntax -latest;
to provide the latest stable syntax set, and possibly also
use syntax -blead;
or similar to opt in to the current syntax preview (whether that one's a good
idea or not is left as an exercise to the audience).
I think this might be easier for packagers trying to keep things sensible
across multiple versions, and would leave 'use v8;' able to mean "a perl
interpreter of at least version 8" rather than conflating that and "a perl
interpreter that supports syntax version 8".
Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue
Email me now on mst (at) shadowcat.co.uk and let's chat about how our CPAN
commercial support, training and consultancy packages could help your team.
by Matt S Trout