perl: hide experimental features dropped later
[sheet.git] / perl.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'perl version cheat sheet',
5         version => '1.1',
6         keywords => [qw'
7                 perl version feature features comparison
8                 sheet cheat overview summary
9         '],
10         stylesheet => [qw'light dark red'],
11         data => ['perl.inc.pl'],
12 });
13
14 :>
15 <h1>Perl release summary</h1>
16
17 <p>The most significant features introduced for recent versions of the Perl scripting language.
18 Depending on desired compatibility you'll want to support a minimum of
19 <span title="on stable/enterprise platforms such as Solaris 10, RHEL 3, SLES 8">v5.8</span> or
20 <span title="on up-to-date servers such as Debian wheezy, Ubuntu 12.04, CentOS 7">v5.14</span>.
21 </p>
22
23 <:
24 my $info = do 'perl.inc.pl' or die $@ // $!;
25 for my $vernum (reverse sort keys %{$info}) {
26         my $verrow = $info->{$vernum};
27         $verrow->{unstable} and next unless exists $get{v};
28
29         print '<div class="section">'."\n";
30         printf '<h2>%vd <small>%s</small></h2><dl>'."\n", $vernum, $verrow->{release};
31         for (@{ $verrow->{new} }) {
32                 if (defined (my $experimental = $_->[2])) {
33                         my $title = 'experimental';
34                         my $class = ' class="ex"';
35                         if (ref \$experimental eq 'VSTRING') {
36                                 my $dropped = $experimental =~ s/^\0//
37                                         and (exists $get{v} or next);
38                                 $title = sprintf('%s %vd',
39                                         $dropped ? 'removed in ' : "$title until",
40                                         $experimental,
41                                 );
42                                 $experimental = $_->[3];  # optional additional class
43                         }
44                         if ($experimental) {
45                                 $class .= sprintf ' title="%s"', $experimental;
46                         }
47                         $_->[1] .= qq{ <em$class>($title)</em>};
48                 }
49                 printf '<dt>%s<dd>%s'."\n", @{$_}, '<br/>'
50         }
51         printf '<dt>Unicode</dt><dd>v%s'."\n", $_ for $verrow->{unicode} || ();
52         print "</dl>\n";
53         print "</div>\n\n";
54 }
55