summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/tlperl/lib/experimental.pm
diff options
context:
space:
mode:
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tlperl/lib/experimental.pm')
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/experimental.pm70
1 files changed, 52 insertions, 18 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/experimental.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/experimental.pm
index 2d58dfdf25..3d89cbd5b1 100644
--- a/systems/texlive/tlnet/tlpkg/tlperl/lib/experimental.pm
+++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/experimental.pm
@@ -1,5 +1,5 @@
package experimental;
-$experimental::VERSION = '0.024';
+$experimental::VERSION = '0.031';
use strict;
use warnings;
use version ();
@@ -8,6 +8,7 @@ BEGIN { eval { require feature } };
use Carp qw/croak carp/;
my %warnings = map { $_ => 1 } grep { /^experimental::/ } keys %warnings::Offsets;
+my %removed_warnings = map { $_ => 1 } grep { /^experimental::/ } keys %warnings::NoOp;
my %features = map { $_ => 1 } $] > 5.015006 ? keys %feature::feature : do {
my @features;
if ($] >= 5.010) {
@@ -18,14 +19,19 @@ my %features = map { $_ => 1 } $] > 5.015006 ? keys %feature::feature : do {
};
my %min_version = (
+ args_array_with_signatures => '5.20.0',
array_base => '5',
autoderef => '5.14.0',
bitwise => '5.22.0',
+ builtin => '5.35.7',
const_attr => '5.22.0',
current_sub => '5.16.0',
declared_refs => '5.26.0',
+ defer => '5.35.4',
evalbytes => '5.16.0',
+ extra_paired_delimiters => '5.35.9',
fc => '5.16.0',
+ for_list => '5.35.5',
isa => '5.31.7',
lexical_topic => '5.10.0',
lexical_subs => '5.18.0',
@@ -38,14 +44,14 @@ my %min_version = (
signatures => '5.20.0',
state => '5.10.0',
switch => '5.10.0',
- try => '5.33.6',
+ try => '5.34.0',
unicode_eval => '5.16.0',
unicode_strings => '5.12.0',
);
my %removed_in_version = (
- array_base => '5.29.4',
- autoderef => '5.23.1',
- lexical_topic => '5.23.4',
+ array_base => '5.30.0',
+ autoderef => '5.24.0',
+ lexical_topic => '5.24.0',
);
$_ = version->new($_) for values %min_version;
@@ -68,16 +74,15 @@ sub _enable {
feature->import($pragma);
_enable(@{ $additional{$pragma} }) if $additional{$pragma};
}
+ elsif ($removed_warnings{"experimental::$pragma"}) {
+ _enable(@{ $additional{$pragma} }) if $additional{$pragma};
+ }
elsif (not exists $min_version{$pragma}) {
croak "Can't enable unknown feature $pragma";
}
elsif ($] < $min_version{$pragma}) {
- my $stable = $min_version{$pragma};
- if ($stable->{version}[1] % 2) {
- $stable = version->new(
- "5.".($stable->{version}[1]+1).'.0'
- );
- }
+ my $stable = $min_version{$pragma}->stringify;
+ $stable =~ s/^ 5\. ([0-9]?[13579]) \. \d+ $/"5." . ($1 + 1) . ".0"/xe;
croak "Need perl $stable or later for feature $pragma";
}
elsif ($] >= ($removed_in_version{$pragma} || 7)) {
@@ -135,12 +140,12 @@ experimental - Experimental features made easy
=head1 VERSION
-version 0.024
+version 0.031
=head1 SYNOPSIS
- use experimental 'lexical_subs', 'smartmatch';
- my sub foo { $_[0] ~~ 1 }
+ use experimental 'lexical_subs', 'signatures';
+ my sub plus_one($value) { $value + 1 }
=head1 DESCRIPTION
@@ -168,18 +173,26 @@ The supported features, documented further below, are:
=over 4
+=item * C<args_array_with_signatures> - allow C<@_> to be used in signatured subs.
+
+This is supported on perl 5.20.0 and above, but is likely to be removed in the future.
+
=item * C<array_base> - allow the use of C<$[> to change the starting index of C<@array>.
-This is supported on all versions of perl.
+This was removed in perl 5.30.0.
=item * C<autoderef> - allow push, each, keys, and other built-ins on references.
-This was added in perl 5.14.0 and removed in perl 5.23.1.
+This was added in perl 5.14.0 and removed in perl 5.24.0.
=item * C<bitwise> - allow the new stringwise bit operators
This was added in perl 5.22.0.
+=item * C<builtin> - allow the use of the functions in the builtin:: namespace
+
+This was added in perl 5.36.0
+
=item * C<const_attr> - allow the :const attribute on subs
This was added in perl 5.22.0.
@@ -188,17 +201,30 @@ This was added in perl 5.22.0.
This was added in perl 5.26.0.
+=item * C<defer> - enables the use of defer blocks
+
+This was added in perl 5.36.0
+
+=item * C<extra_paired_delimiters> - enables the use of more paired string delimiters than the
+traditional four, S<C<< < > >>>, S<C<( )>>, S<C<{ }>>, and S<C<[ ]>>.
+
+This was added in perl 5.36.
+
+=item * C<for_list> - allows iterating over multiple values at a time with C<for>
+
+This was added in perl 5.36.0
+
=item * C<isa> - allow the use of the C<isa> infix operator
This was added in perl 5.32.0.
=item * C<lexical_topic> - allow the use of lexical C<$_> via C<my $_>.
-This was added in perl 5.10.0 and removed in perl 5.23.4.
+This was added in perl 5.10.0 and removed in perl 5.24.0.
=item * C<lexical_subs> - allow the use of lexical subroutines.
-This was added in 5.18.0.
+This was added in 5.18.0, and became non-experimental (and always enabled) in 5.26.0.
=item * C<postderef> - allow the use of postfix dereferencing expressions
@@ -229,10 +255,18 @@ This was added in perl 5.20.0.
This was added in perl 5.10.0, but it should be noted there are significant
incompatibilities between 5.10.0 and 5.10.1.
+The feature is going to be deprecated in perl 5.38.0, and removed in 5.42.0.
+
=item * C<switch> - allow the use of C<~~>, given, and when
This was added in perl 5.10.0.
+The feature is going to be deprecated in perl 5.38.0, and removed in 5.42.0.
+
+=item * C<try> - allow the use of C<try> and C<catch>
+
+This was added in perl 5.34.0
+
=item * C<win32_perlio> - allows the use of the :win32 IO layer.
This was added on perl 5.22.0.