summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRicardo Signes <rjbs@cpan.org>2012-02-20 19:35:33 -0500
committerRicardo Signes <rjbs@cpan.org>2012-02-22 09:36:57 -0500
commit39ec54a59ce332fc44e553f4e5eeceef88e8369e (patch)
treeee931a83b2545b9d7c343395d4caccffafe07abc /lib
parentac2b477c8b4b647797d42877de5b1a1d34c94073 (diff)
downloadperl-39ec54a59ce332fc44e553f4e5eeceef88e8369e.tar.gz
"no feature" now means reset to default
See https://rt.perl.org/rt3/Ticket/Display.html?id=108776 "no feature" now resets to the default feature set. To disable all features (which is likely to be a pretty special-purpose request, since it presumably won't match any named set of semantics) you can now write "no feature ':all'"
Diffstat (limited to 'lib')
-rw-r--r--lib/feature.pm15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/feature.pm b/lib/feature.pm
index fe88c8c47d..33f48dc021 100644
--- a/lib/feature.pm
+++ b/lib/feature.pm
@@ -5,7 +5,7 @@
package feature;
-our $VERSION = '1.26';
+our $VERSION = '1.27';
our %feature = (
fc => 'feature_fc',
@@ -23,6 +23,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 say state switch unicode_eval unicode_strings)],
"default" => [qw(array_base)],
);
@@ -98,7 +99,8 @@ has lexical effect.
}
say "Yet it is here.";
-C<no feature> with no features specified will turn off all features.
+C<no feature> with no features specified will reset to the default group. To
+disable I<all> features (an unusual request!) use C<no feature ':all'>.
=head1 AVAILABLE FEATURES
@@ -277,7 +279,7 @@ the C<use VERSION> construct. That is,
will do an implicit
- no feature;
+ no feature ':all';
use feature ':5.10';
and so on. Note how the trailing sub-version
@@ -351,11 +353,10 @@ sub unimport {
normalise_hints $features;
}
- # A bare C<no feature> should disable *all* features
+ # A bare C<no feature> should reset to the default bundle
if (!@_) {
- delete @^H{ values(%feature) };
- $^H &= ~ $hint_uni8bit;
- return;
+ $^H &= ~($hint_uni8bit|$hint_mask);
+ return;
}
while (@_) {