X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/5472786bc5cfec5ceaa44a1933f265d0f3190e59..v1.10-46-g4c43bcbed6:/perl.plp?ds=sidebyside
diff --git a/perl.plp b/perl.plp
index 0a13fdc..a5ef991 100644
--- a/perl.plp
+++ b/perl.plp
@@ -2,7 +2,7 @@
Html({
title => 'perl version cheat sheet',
- version => '1.1',
+ version => '1.2',
keywords => [qw'
perl version feature features comparison
sheet cheat overview summary
@@ -24,32 +24,38 @@ Depending on desired compatibility you'll want to support a minimum of
my $info = do 'perl.inc.pl' or die $@ // $!;
for my $vernum (reverse sort keys %{$info}) {
my $verrow = $info->{$vernum};
- $verrow->{unstable} and next unless exists $get{v};
+ defined $verrow->{unstable} and next unless exists $get{v};
- print '
'."\n";
- printf '
%vd %s
'."\n", $vernum, $verrow->{release};
+ say '';
+ say sprintf '
%vd %s
', $vernum, $verrow->{release};
for (@{ $verrow->{new} }) {
- if (defined (my $experimental = $_->[2])) {
- my $title = 'experimental';
- my $class = ' class="ex"';
- if (ref \$experimental eq 'VSTRING') {
- my $dropped = $experimental =~ s/^\0//
- and (exists $get{v} or next);
- $title = sprintf('%s %vd',
- $dropped ? 'removed in ' : "$title until",
- $experimental,
- );
- $experimental = $_->[3]; # optional additional class
+ my ($topic, $desc, $attr) = @{$_};
+ if ($attr) {
+ my $title;
+ if (defined $attr->{experimental}) {
+ $title = 'experimental';
}
- if ($experimental) {
- $class .= sprintf ' title="%s"', $experimental;
+ if ($attr->{dropped}) {
+ next unless exists $get{v};
+ $title = sprintf 'removed in %vd', $attr->{dropped};
}
- $_->[1] .= qq{ ($title)};
+ elsif ($attr->{stable}) {
+ $title .= sprintf ' until %vd', $attr->{stable};
+ }
+ if ($attr->{experimental}) {
+ $title = sprintf '%s',
+ $attr->{experimental}, $title;
+ }
+ if ($attr->{feature}) {
+ $title = sprintf('feature', $attr->{feature})
+ . (defined $title && ", $title");
+ }
+ $desc .= sprintf ' (%s)', $title;
}
- printf '- %s
- %s'."\n", @{$_}, '
'
+ say sprintf ' - %s
- %s', $topic, $desc || '
';
}
- printf ' - Unicode
- v%s'."\n", $_ for $verrow->{unicode} || ();
- print "
\n";
- print "
\n\n";
+ say sprintf '- Unicode
- v%s', $_ for $verrow->{unicode} || ();
+ say '
';
+ say "
\n";
}