diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-22 18:22:41 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-24 09:25:16 -0800 |
commit | 1e0dc09f4e713228ffdf46562c54edca29c94a9f (patch) | |
tree | c81bd34be59f521b5de39171f8b95800fa19a16b /lib | |
parent | 9c1e343294dbe2fdb560c07570dcae32cda1a4d8 (diff) | |
download | perl-1e0dc09f4e713228ffdf46562c54edca29c94a9f.tar.gz |
feature.pm: Set bundle hints when dis/enabling features
The core does not use these hints just yet, but feature.pm can start
setting them.
Currently, the hint bits for feature bundles (CURRENT_FEATURE_BUNDLE
in feature.h) are equal to FEATURE_BUNDLE_DEFAULT (0) by default.
feature.pm sets them to FEATURE_BUNDLE_CUSTOM when modifying
hint settings.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/feature.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/feature.pm b/lib/feature.pm index 2c1d5266ef..6f7af31771 100644 --- a/lib/feature.pm +++ b/lib/feature.pm @@ -301,6 +301,11 @@ sub import { if (@_ == 0) { croak("No features specified"); } + if (my $features = current_bundle) { + # Features are enabled implicitly via bundle hints + unshift @_, @$features; + $^H |= $hint_mask; + } while (@_) { my $name = shift(@_); if (substr($name, 0, 1) eq ":") { @@ -328,6 +333,13 @@ sub import { sub unimport { my $class = shift; + if (my $features = current_bundle) { + # Features are enabled implicitly via bundle hints + # Pass them to import() to put them in a form we can handle. + import(undef, @$features); + $^H |= $hint_mask; + } + # A bare C<no feature> should disable *all* features if (!@_) { delete @^H{ values(%feature) }; |