This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
feature.pm: Add function for getting the current bundle
authorFather Chrysostomos <sprout@cpan.org>
Fri, 23 Dec 2011 02:12:58 +0000 (18:12 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 24 Dec 2011 17:25:16 +0000 (09:25 -0800)
This is for when we switch over to using hints in $^H for feature bun-
dles.  When $bundle_number == $hint_mask, it means that the hints in
%^H apply.

lib/feature.pm
regen/feature.pl

index 8f9467a..2c1d526 100644 (file)
@@ -290,6 +290,12 @@ bundle is automatically loaded instead.
 
 =cut
 
+sub current_bundle {
+    my $bundle_number = $^H & $hint_mask;
+    return if $bundle_number == $hint_mask;
+    return $feature_bundle{@hint_bundles[$bundle_number >> $hint_shift]};
+}
+
 sub import {
     my $class = shift;
     if (@_ == 0) {
index 8e11f99..2e8e8eb 100755 (executable)
@@ -524,6 +524,12 @@ bundle is automatically loaded instead.
 
 =cut
 
+sub current_bundle {
+    my $bundle_number = $^H & $hint_mask;
+    return if $bundle_number == $hint_mask;
+    return $feature_bundle{@hint_bundles[$bundle_number >> $hint_shift]};
+}
+
 sub import {
     my $class = shift;
     if (@_ == 0) {