This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
feature.pm: Avoid repetition; save memory
authorFather Chrysostomos <sprout@cpan.org>
Tue, 15 Nov 2011 12:58:50 +0000 (04:58 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 15 Nov 2011 13:00:14 +0000 (05:00 -0800)
lib/feature.pm

index 6ab650d..ce73e2d 100644 (file)
@@ -19,18 +19,18 @@ our $hint_uni8bit = 0x00000800;
 
 # NB. the latest bundle must be loaded by the -E switch (see toke.c)
 
 
 # NB. the latest bundle must be loaded by the -E switch (see toke.c)
 
-my %feature_bundle = (
+our %feature_bundle = (
     "5.10" => [qw(say state switch)],
     "5.11" => [qw(say state switch unicode_strings)],
     "5.10" => [qw(say state switch)],
     "5.11" => [qw(say state switch unicode_strings)],
-    "5.12" => [qw(say state switch unicode_strings)],
-    "5.13" => [qw(say state switch unicode_strings)],
-    "5.14" => [qw(say state switch unicode_strings)],
     "5.15" => [qw(say state switch unicode_strings unicode_eval
                   evalbytes)],
     "5.15" => [qw(say state switch unicode_strings unicode_eval
                   evalbytes)],
-    "5.16" => [qw(say state switch unicode_strings unicode_eval
-                  evalbytes)],
 );
 
 );
 
+# Each of these is the same as the previous bundle
+for(12...14, 16) {
+    $feature_bundle{"5.$_"} = $feature_bundle{"5.".($_-1)}
+}
+
 # special case
 $feature_bundle{"5.9.5"} = $feature_bundle{"5.10"};
 
 # special case
 $feature_bundle{"5.9.5"} = $feature_bundle{"5.10"};