perl: wrap long source lines to 80 characters
[sheet.git] / perl.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'perl version cheat sheet',
5         version => '1.3',
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
18 scripting language.
19 Depending on desired compatibility you'll want to support a minimum of
20 <span title="on dinosaur platforms such as Solaris 10, AIX 5.2, RHEL 3, SLES 8">v5.8</span> or
21 <span title="on stable servers such as Debian wheezy, Ubuntu 12.04, CentOS 7">v5.14</span>.
22 </p>
23
24 <:
25 my $info = do 'perl.inc.pl' or die $@ // $!;
26 for my $vernum (reverse sort keys %{$info}) {
27         my $verrow = $info->{$vernum};
28         defined $verrow->{unstable} and next unless exists $get{v};
29
30         say '<div class="section">';
31         say sprintf '<h2>%vd <small>%s</small></h2>', $vernum, $verrow->{release};
32         say '<dl>';
33         for (@{ $verrow->{new} }) {
34                 my ($topic, $desc, $attr) = @{$_};
35                 if ($attr) {
36                         my $title;
37                         if (defined $attr->{experimental}) {
38                                 $title = 'experimental';
39                         }
40                         if ($attr->{dropped}) {
41                                 next unless exists $get{v};
42                                 $title = sprintf 'removed in %vd', $attr->{dropped};
43                         }
44                         elsif ($attr->{stable}) {
45                                 $title .= sprintf ' until %vd', $attr->{stable};
46                         }
47                         if ($attr->{experimental}) {
48                                 $title = sprintf '<span title="experimental::%s">%s</span>',
49                                         $attr->{experimental}, $title;
50                         }
51                         if ($attr->{feature}) {
52                                 my $prefix = sprintf '<span title="%s">feature</span>',
53                                         $attr->{feature};
54                                 my $title = join ', ', $prefix, $title // ();
55                         }
56                         $desc .= sprintf ' <em class="ex">(%s)</em>', $title;
57                 }
58                 say sprintf '<dt>%s<dd>%s', $topic, $desc || '<br/>';
59         }
60         say sprintf '<dt>Unicode</dt><dd>v%s', $_ for $verrow->{unicode} || ();
61         say '</dl>';
62         say "</div>\n";
63 }
64