state => 'state',
switch => 'switch',
evalbytes => 'evalbytes',
+ postderef => 'postderef',
array_base => 'arybase',
current_sub => '__SUB__',
lexical_subs => 'lexsubs',
+ postderef_qq => 'postderef_qq',
unicode_eval => 'unieval',
unicode_strings => 'unicode',
fc => 'fc',
+ signatures => 'signatures',
);
# NOTE: If a feature is ever enabled in a non-contiguous range of Perl
evalbytes current_sub fc)],
"5.17" => [qw(say state switch unicode_strings unicode_eval
evalbytes current_sub fc)],
+ "5.19" => [qw(say state switch unicode_strings unicode_eval
+ evalbytes current_sub fc)],
);
+# not actually used currently
my @experimental = qw( lexical_subs );
qq'\$feature_bundle{"$_"} = \$feature_bundle{"$Aliases{$_}"};\n';
};
-print $pm "my \%experimental = (\n";
-print $pm " $_ => 1,\n", for @experimental;
-print $pm ");\n";
+#print $pm "my \%experimental = (\n";
+#print $pm " $_ => 1,\n", for @experimental;
+#print $pm ");\n";
print $pm <<EOPM;
__END__
package feature;
-our $VERSION = '1.30';
+our $VERSION = '1.36';
FEATURES
=head2 The 'unicode_strings' feature
-C<use feature 'unicode_strings'> tells the compiler to use Unicode semantics
+C<use feature 'unicode_strings'> tells the compiler to use Unicode rules
in all string operations executed within its scope (unless they are also
within the scope of either C<use locale> or C<use bytes>). The same applies
to all regular expressions compiled within the scope, even if executed outside
they are interpreted.
C<no feature 'unicode_strings'> tells the compiler to use the traditional
-Perl semantics wherein the native character set semantics is used unless it is
+Perl rules wherein the native character set rules is used unless it is
clear to Perl that Unicode is desired. This can lead to some surprises
when the behavior suddenly changes. (See
L<perlunicode/The "Unicode Bug"> for details.) For this reason, if you are
=head2 The 'lexical_subs' feature
B<WARNING>: This feature is still experimental and the implementation may
-change in future versions of Perl. For this reason, F<feature.pm> will
-warn when you enable the feature, unless you have explicitly disabled the
+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::lexical_subs";
This feature is available from Perl 5.18 onwards.
+=head2 The 'signatures' 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::signatures";
+
+This enables unpacking of subroutine arguments into lexical variables
+by syntax such as
+
+ sub foo ($left, $right) {
+ return $left + $right;
+ }
+
+See L<perlsub/Signatures> for details.
+
+This feature is available from Perl 5.20 onwards.
+
=head1 FEATURE BUNDLES
It's possible to load multiple features together, using
if ($import) {
$^H{$feature{$name}} = 1;
$^H |= $hint_uni8bit if $name eq 'unicode_strings';
- if ($experimental{$name}) {
- require warnings;
- warnings::warnif("experimental::$name",
- "The $name feature is experimental");
- }
} else {
delete $^H{$feature{$name}};
$^H &= ~ $hint_uni8bit if $name eq 'unicode_strings';