diff options
Diffstat (limited to 'lib/feature.pm')
-rw-r--r-- | lib/feature.pm | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/feature.pm b/lib/feature.pm index 84ad9cbfa8..32dc9300e3 100644 --- a/lib/feature.pm +++ b/lib/feature.pm @@ -5,7 +5,7 @@ package feature; -our $VERSION = '1.34'; +our $VERSION = '1.35'; our %feature = ( fc => 'feature_fc', @@ -15,6 +15,7 @@ our %feature = ( evalbytes => 'feature_evalbytes', postderef => 'feature_postderef', array_base => 'feature_arybase', + signatures => 'feature_signatures', current_sub => 'feature___SUB__', lexical_subs => 'feature_lexsubs', postderef_qq => 'feature_postderef_qq', @@ -26,7 +27,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 postderef postderef_qq say state switch unicode_eval unicode_strings)], + "all" => [qw(array_base current_sub evalbytes fc lexical_subs postderef postderef_qq say signatures state switch unicode_eval unicode_strings)], "default" => [qw(array_base)], ); @@ -245,6 +246,26 @@ and C<our sub foo> syntax. See L<perlsub/Lexical Subroutines> for details. 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 |