gitignore: include all files in data/
[sheet.git] / perl.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'perl version cheat sheet',
5         version => '1.2',
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 dinosaur platforms such as Solaris 10, AIX 5.2, RHEL 3, SLES 8">v5.8</span> or
20 <span title="on stable 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         defined $verrow->{unstable} and next unless exists $get{v};
28
29         say '<div class="section">';
30         say sprintf '<h2>%vd <small>%s</small></h2><dl>', $vernum, $verrow->{release};
31         for (@{ $verrow->{new} }) {
32                 my ($topic, $desc, $attr) = @{$_};
33                 if ($attr) {
34                         my $title;
35                         if (defined $attr->{experimental}) {
36                                 $title = 'experimental';
37                         }
38                         if ($attr->{dropped}) {
39                                 next unless exists $get{v};
40                                 $title = sprintf 'removed in %vd', $attr->{dropped};
41                         }
42                         elsif ($attr->{stable}) {
43                                 $title .= sprintf ' until %vd', $attr->{stable};
44                         }
45                         if ($attr->{experimental}) {
46                                 $title = sprintf '<span title="experimental::%s">%s</span>',
47                                         $attr->{experimental}, $title;
48                         }
49                         if ($attr->{feature}) {
50                                 $title = sprintf('<span title="%s">feature</span>', $attr->{feature})
51                                         . (defined $title && ", $title");
52                         }
53                         $desc .= sprintf ' <em class="ex">(%s)</em>', $title;
54                 }
55                 say sprintf '<dt>%s<dd>%s', $topic, $desc || '<br/>';
56         }
57         say sprintf '<dt>Unicode</dt><dd>v%s', $_ for $verrow->{unicode} || ();
58         say '</dl>';
59         say "</div>\n";
60 }
61