Html({
title => 'perl version cheat sheet',
- version => '1.1',
+ version => '1.2',
keywords => [qw'
perl version feature features comparison
sheet cheat overview summary
print '<div class="section">'."\n";
printf '<h2>%vd <small>%s</small></h2><dl>'."\n", $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{ <em$class>($title)</em>};
+ elsif ($attr->{stable}) {
+ $title .= sprintf ' until %vd', $attr->{stable};
+ }
+ if ($attr->{experimental}) {
+ $title = sprintf '<span title="experimental::%s">%s</span>',
+ $attr->{experimental}, $title;
+ }
+ if ($attr->{feature}) {
+ $title = sprintf('<span title="%s">feature</span>', $attr->{feature})
+ . (defined $title && ", $title");
+ }
+ $desc .= sprintf ' <em class="ex">(%s)</em>', $title;
}
- printf '<dt>%s<dd>%s'."\n", @{$_}, '<br/>'
+ printf '<dt>%s<dd>%s'."\n", $topic, $desc || '<br/>';
}
printf '<dt>Unicode</dt><dd>v%s'."\n", $_ for $verrow->{unicode} || ();
print "</dl>\n";