summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2020-01-21 10:35:05 +0000
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2020-02-16 16:00:00 +0000
commit0b657b1955a40e49c93ca32fe32822f4a8a5205b (patch)
tree721d79576c2b14e92a42f28cff484d6f7a49632f /lib
parente3f228dfa28c62cea97de225b6d49e4b4ff87d07 (diff)
downloadperl-0b657b1955a40e49c93ca32fe32822f4a8a5205b.tar.gz
Add 'indirect' feature that can be turned off to disable indirect object syntax
Co-authored-by: Tony Cook <tony@develop-help.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/feature.pm51
1 files changed, 34 insertions, 17 deletions
diff --git a/lib/feature.pm b/lib/feature.pm
index 668b43018e..e6f467e9e4 100644
--- a/lib/feature.pm
+++ b/lib/feature.pm
@@ -5,7 +5,7 @@
package feature;
-our $VERSION = '1.57';
+our $VERSION = '1.58';
our %feature = (
fc => 'feature_fc',
@@ -14,6 +14,7 @@ our %feature = (
state => 'feature_state',
switch => 'feature_switch',
bitwise => 'feature_bitwise',
+ indirect => 'feature_indirect',
evalbytes => 'feature_evalbytes',
signatures => 'feature_signatures',
current_sub => 'feature___SUB__',
@@ -25,13 +26,13 @@ our %feature = (
);
our %feature_bundle = (
- "5.10" => [qw(say state switch)],
- "5.11" => [qw(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)],
- "5.27" => [qw(bitwise current_sub evalbytes fc postderef_qq say state switch unicode_eval unicode_strings)],
- "all" => [qw(bitwise current_sub declared_refs evalbytes fc isa postderef_qq refaliasing say signatures state switch unicode_eval unicode_strings)],
- "default" => [qw()],
+ "5.10" => [qw(indirect say state switch)],
+ "5.11" => [qw(indirect say state switch unicode_strings)],
+ "5.15" => [qw(current_sub evalbytes fc indirect say state switch unicode_eval unicode_strings)],
+ "5.23" => [qw(current_sub evalbytes fc indirect postderef_qq say state switch unicode_eval unicode_strings)],
+ "5.27" => [qw(bitwise current_sub evalbytes fc indirect postderef_qq say state switch unicode_eval unicode_strings)],
+ "all" => [qw(bitwise current_sub declared_refs evalbytes fc indirect isa postderef_qq refaliasing say signatures state switch unicode_eval unicode_strings)],
+ "default" => [qw(indirect)],
);
$feature_bundle{"5.12"} = $feature_bundle{"5.11"};
@@ -359,6 +360,18 @@ right operand. See L<perlop/Class Instance Operator> for more details.
This feature is available from Perl 5.32 onwards.
+=head2 The 'indirect' feature
+
+This feature allows the use of L<indirect object
+syntax|perlobj/Indirect Object Syntax> for method calls, e.g. C<new
+Foo 1, 2;>. It is enabled by default, but can be turned off to
+disallow indirect object syntax.
+
+This feature is available under this name from Perl 5.32 onwards. In
+previous versions, it was simply on all the time. To disallow (or
+warn on) indirect object syntax on older Perls, see the L<indirect>
+CPAN module.
+
=head1 FEATURE BUNDLES
It's possible to load multiple features together, using
@@ -371,45 +384,49 @@ The following feature bundles are available:
bundle features included
--------- -----------------
- :default
+ :default indirect
- :5.10 say state switch
+ :5.10 say state switch indirect
- :5.12 say state switch unicode_strings
+ :5.12 say state switch unicode_strings indirect
- :5.14 say state switch unicode_strings
+ :5.14 say state switch unicode_strings indirect
:5.16 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
+ indirect
:5.18 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
+ indirect
:5.20 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
+ indirect
:5.22 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
+ indirect
:5.24 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
- postderef_qq
+ postderef_qq indirect
:5.26 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
- postderef_qq
+ postderef_qq indirect
:5.28 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
- postderef_qq bitwise
+ postderef_qq bitwise indirect
:5.30 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
- postderef_qq bitwise
+ postderef_qq bitwise indirect
:5.32 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
- postderef_qq bitwise
+ postderef_qq bitwise indirect
The C<:default> bundle represents the feature set that is enabled before
any C<use feature> or C<no feature> declaration.