This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Bump Deparse's $VERSION following commit 65ef2c3e7d945498.
[perl5.git] / lib / feature.pm
index aabedd8..70d8ada 100644 (file)
@@ -5,19 +5,20 @@
 
 package feature;
 
-our $VERSION = '1.37';
+our $VERSION = '1.40';
 
 our %feature = (
     fc              => 'feature_fc',
     say             => 'feature_say',
     state           => 'feature_state',
     switch          => 'feature_switch',
+    bitwise         => 'feature_bitwise',
     evalbytes       => 'feature_evalbytes',
     postderef       => 'feature_postderef',
     array_base      => 'feature_arybase',
     signatures      => 'feature_signatures',
     current_sub     => 'feature___SUB__',
-    lvalue_refs     => 'feature_lvref',
+    refaliasing     => 'feature_refaliasing',
     lexical_subs    => 'feature_lexsubs',
     postderef_qq    => 'feature_postderef_qq',
     unicode_eval    => 'feature_unieval',
@@ -28,7 +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)],
-    "all"     => [qw(array_base current_sub evalbytes fc lexical_subs lvalue_refs postderef postderef_qq say signatures 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)],
 );
 
@@ -135,6 +136,12 @@ This feature is available starting with Perl 5.10.
 
 =head2 The 'switch' feature
 
+B<WARNING>: Because the L<smartmatch operator|perlop/"Smartmatch Operator"> is
+experimental, Perl will warn when you use this feature, unless you have
+explicitly disabled the warning:
+
+    no warnings "experimental::smartmatch";
+
 C<use feature 'switch'> tells the compiler to enable the Perl 6
 given/when construct.
 
@@ -249,6 +256,27 @@ and C<our sub foo> syntax.  See L<perlsub/Lexical Subroutines> for details.
 
 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:
+
+  no warnings "experimental::postderef";
+
+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:
+
+  my @x = @{ $h->{a} };
+  my @x = $h->{a}->@*;
+
+The 'postderef_qq' feature extends this, for array and scalar dereference, to
+working inside of double-quotish interpolations.
+
+This feature is available from Perl 5.20 onwards.
+
 =head2 The 'signatures' feature
 
 B<WARNING>: This feature is still experimental and the implementation may
@@ -269,6 +297,47 @@ See L<perlsub/Signatures> for details.
 
 This feature is available from Perl 5.20 onwards.
 
+=head2 The 'refaliasing' feature
+
+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:
+
+    no warnings "experimental::refaliasing";
+
+This enables aliasing via assignment to references:
+
+    \$a = \$b; # $a and $b now point to the same scalar
+    \@a = \@b; #                     to the same array
+    \%a = \%b;
+    \&a = \&b;
+    foreach \%hash (@array_of_hash_refs) {
+        ...
+    }
+
+See L<perlref/Assigning to References> for details.
+
+This feature is available from Perl 5.22 onwards.
+
+=head2 The 'bitwise' feature
+
+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:
+
+    no warnings "experimental::bitwise";
+
+This makes the four standard bitwise operators (C<& | ^ ~>) treat their
+operands consistently as numbers, and introduces four new dotted operators
+(C<&. |. ^. ~.>) that treat their operands consistently as strings.  The
+same applies to the assignment variants (C<&= |= ^= &.= |.= ^.=>).
+
+See L<perlop/Bitwise String Operators> for details.
+
+This feature is available from Perl 5.22 onwards.
+
 =head1 FEATURE BUNDLES
 
 It's possible to load multiple features together, using