perl: bundle attribute to indicate enabled features
[sheet.git] / perl.plp
index 590cefa227b394355111725c814d77bcc027f22b..cdfe47f333648cdf9c9c6c0261cdc8e8cc0f9df4 100644 (file)
--- a/perl.plp
+++ b/perl.plp
@@ -2,7 +2,7 @@
 
 Html({
        title => 'perl version cheat sheet',
 
 Html({
        title => 'perl version cheat sheet',
-       version => '1.8',
+       version => '1.9',
        keywords => [qw'
                perl version feature features comparison
                sheet cheat overview summary
        keywords => [qw'
                perl version feature features comparison
                sheet cheat overview summary
@@ -132,6 +132,20 @@ sub featattrs ($attr) {
                $title = join ', ', $prefix, $title // ();
                $attr->{name} //= $attr->{feature};
        }
                $title = join ', ', $prefix, $title // ();
                $attr->{name} //= $attr->{feature};
        }
+       if (defined $attr->{bundle}) {
+               if ($attr->{stable} and !$attr->{bundle}) {
+                       $title .= ' then bundled';
+               }
+               else {
+                       my $v = 'bundled';
+                       $v .= ' in ' . join(' and ',
+                               # specific version(s) distinct from stable or current
+                               map { sprintf '%vd', $_ }
+                               map { ref eq 'ARRAY' ? @{$_} : $_ } $_
+                       ) for $attr->{bundle} || ();
+                       $title = join ', ', $title // (), $v;
+               }
+       }
        $title = $title ? sprintf ' <em class="ex">(%s)</em>', $title : '';
 
        if (my $eg = $attr->{eg}) {
        $title = $title ? sprintf ' <em class="ex">(%s)</em>', $title : '';
 
        if (my $eg = $attr->{eg}) {