4 title => 'perl version cheat sheet',
7 perl version feature features comparison
8 sheet cheat overview summary
10 stylesheet => [qw'light dark red'],
11 data => ['perl.inc.pl'],
15 <h1>Perl release summary</h1>
17 <p>The most significant features introduced for recent versions of the Perl
20 my $info = Data('perl');
23 use List::Util 'first';
26 use feature 'signatures';
27 sub linkversion ($v) {
28 return sprintf('%vd', $v);
31 my $now = Time::Piece->new;
32 my $coreeol = ($now - ONE_YEAR * 3)->strftime('%F');
33 my $vcore = first { $info->{$_}{release} ge $coreeol } sort keys %{$info};
34 say "<p>Core security support is provided for 3 years",
35 ", so typical users should run at least $_."
36 for linkversion($vcore);
38 my $vendoreol = ($now - ONE_YEAR * 5)->strftime('%F');
40 $info->{$_}{release} ge $vendoreol && $info->{$_}{distro}{debian}
42 say sprintf "Stable distributions such as Debian %s maintain %s+.",
43 $info->{$_}{distro}{debian}, linkversion($_) for $vdebian;
45 my $nowcmp = $now->strftime('%F');
46 my $vdino = first { $info->{$_}{support} ge $nowcmp } sort keys %{$info};
47 say "Enterprise platforms retain versions up to $_."
48 for linkversion($vdino);
50 } or Alert('Missing version recommendations', $@);
53 for my $vernum (reverse sort keys %{$info}) {
54 my $verrow = $info->{$vernum};
55 defined $verrow->{unstable} and next unless exists $get{v};
57 say '<div class="section">';
58 say sprintf '<h2>%vd <small>%s</small></h2>', $vernum, $verrow->{release};
60 for (@{ $verrow->{new} }) {
61 my ($topic, $desc, $attr) = @{$_};
64 if (defined $attr->{experimental}) {
65 $title = 'experimental';
67 if ($attr->{dropped}) {
68 next unless exists $get{v};
69 $title = sprintf 'removed in %vd', $attr->{dropped};
71 elsif ($attr->{stable}) {
72 $title .= sprintf ' until %vd', $attr->{stable};
74 if ($attr->{experimental}) {
75 $title = sprintf '<span title="experimental::%s">%s</span>',
76 $attr->{experimental}, $title;
78 if ($attr->{feature}) {
79 my $prefix = sprintf '<span title="%s">feature</span>',
81 $title = join ', ', $prefix, $title // ();
83 $desc .= sprintf ' <em class="ex">(%s)</em>', $title;
85 say sprintf '<dt>%s<dd>%s', $topic, $desc || '<br/>';
87 say sprintf '<dt>Unicode</dt><dd>v%s', $_ for $verrow->{unicode} || ();