diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/feature.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/feature.pm | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/Master/tlpkg/tlperl/lib/feature.pm b/Master/tlpkg/tlperl/lib/feature.pm index 70d8ada2b4b..ec9fff7a6d4 100644 --- a/Master/tlpkg/tlperl/lib/feature.pm +++ b/Master/tlpkg/tlperl/lib/feature.pm @@ -5,7 +5,7 @@ package feature; -our $VERSION = '1.40'; +our $VERSION = '1.42'; our %feature = ( fc => 'feature_fc', @@ -29,6 +29,7 @@ our %feature_bundle = ( "5.10" => [qw(array_base say state switch)], "5.11" => [qw(array_base say state switch unicode_strings)], "5.15" => [qw(current_sub evalbytes fc say state switch unicode_eval unicode_strings)], + "5.23" => [qw(current_sub evalbytes fc postderef_qq say state switch unicode_eval unicode_strings)], "all" => [qw(array_base bitwise current_sub evalbytes fc lexical_subs postderef postderef_qq refaliasing say signatures state switch unicode_eval unicode_strings)], "default" => [qw(array_base)], ); @@ -43,11 +44,12 @@ $feature_bundle{"5.19"} = $feature_bundle{"5.15"}; $feature_bundle{"5.20"} = $feature_bundle{"5.15"}; $feature_bundle{"5.21"} = $feature_bundle{"5.15"}; $feature_bundle{"5.22"} = $feature_bundle{"5.15"}; +$feature_bundle{"5.24"} = $feature_bundle{"5.23"}; $feature_bundle{"5.9.5"} = $feature_bundle{"5.10"}; our $hint_shift = 26; our $hint_mask = 0x1c000000; -our @hint_bundles = qw( default 5.10 5.11 5.15 ); +our @hint_bundles = qw( default 5.10 5.11 5.15 5.23 ); # This gets set (for now) in $^H as well as in %^H, # for runtime speed of the uc/lc/ucfirst/lcfirst functions. @@ -258,24 +260,30 @@ This feature is available from Perl 5.18 onwards. =head2 The 'postderef' and 'postderef_qq' features -B<WARNING>: This feature is still experimental and the implementation may -change in future versions of Perl. For this reason, Perl will -warn when you use the feature, unless you have explicitly disabled the -warning: +The 'postderef_qq' feature extends the applicability of L<postfix +dereference syntax|perlref/Postfix Dereference Syntax> so that postfix array +and scalar dereference are available in double-quotish interpolations. For +example, it makes the following two statements equivalent: - no warnings "experimental::postderef"; + my $s = "[@{ $h->{a} }]"; + my $s = "[$h->{a}->@*]"; -The 'postderef' feature allows the use of L<postfix dereference -syntax|perlref/Postfix Dereference Syntax>. For example, it will make the -following two statements equivalent: +This feature is available from Perl 5.20 onwards. In Perl 5.20 and 5.22, it +was classed as experimental, and Perl emitted a warning for its +usage, except when explicitly disabled: - my @x = @{ $h->{a} }; - my @x = $h->{a}->@*; + no warnings "experimental::postderef"; -The 'postderef_qq' feature extends this, for array and scalar dereference, to -working inside of double-quotish interpolations. +As of Perl 5.24, use of this feature no longer triggers a warning, though +the C<experimental::postderef> warning category still exists (for +compatibility with code that disables it). -This feature is available from Perl 5.20 onwards. +The 'postderef' feature was used in Perl 5.20 and Perl 5.22 to enable +postfix dereference syntax outside double-quotish interpolations. In those +versions, using it triggered the C<experimental::postderef> warning in the +same way as the 'postderef_qq' feature did. As of Perl 5.24, this syntax is +not only no longer experimental, but it is enabled for all Perl code, +regardless of what feature declarations are in scope. =head2 The 'signatures' feature @@ -370,6 +378,10 @@ The following feature bundles are available: :5.22 say state switch unicode_strings unicode_eval evalbytes current_sub fc + :5.24 say state switch unicode_strings + unicode_eval evalbytes current_sub fc + postderef_qq + The C<:default> bundle represents the feature set that is enabled before any C<use feature> or C<no feature> declaration. @@ -424,7 +436,7 @@ bundle is automatically loaded instead. =cut sub import { - my $class = shift; + shift; if (!@_) { croak("No features specified"); @@ -434,7 +446,7 @@ sub import { } sub unimport { - my $class = shift; + shift; # A bare C<no feature> should reset to the default bundle if (!@_) { |