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');
22 use feature 'signatures';
24 return sprintf 'v%d%03d', unpack 'C*', $v;
26 sub linkversion ($v) {
27 return showlink(sprintf('%vd', $v), '#'.vname($v));
31 use List::Util 'first';
35 my $now = Time::Piece->new;
36 my $coreeol = ($now - ONE_YEAR * 3)->strftime('%F');
37 my $vcore = first { $info->{$_}{release} ge $coreeol } sort keys %{$info};
38 say "<p>Core security support is provided for 3 years",
39 ", so typical users should run at least $_."
40 for linkversion($vcore);
42 my $vendoreol = ($now - ONE_YEAR * 5)->strftime('%F');
44 $info->{$_}{release} ge $vendoreol && $info->{$_}{distro}{debian}
46 say sprintf "Stable distributions such as Debian %s maintain %s+.",
47 $info->{$_}{distro}{debian}, linkversion($_) for $vdebian;
49 my $nowcmp = $now->strftime('%F');
50 my $vdino = first { $info->{$_}{support} ge $nowcmp } sort keys %{$info};
51 say "Enterprise platforms retain versions up to $_."
52 for linkversion($vdino);
54 } or Alert('Missing version recommendations', $@);
57 for my $vernum (reverse sort keys %{$info}) {
58 my $verrow = $info->{$vernum};
59 defined $verrow->{unstable} and next unless exists $get{v};
61 say sprintf '<div class="section" id="%s">', vname($vernum);
62 say sprintf '<h2>%vd <small>%s</small></h2>', $vernum, $verrow->{release};
64 for (@{ $verrow->{new} }) {
65 my ($topic, $desc, $attr) = @{$_};
68 if (defined $attr->{experimental}) {
69 $title = 'experimental';
71 if ($attr->{dropped}) {
72 next unless exists $get{v};
73 $title = sprintf 'removed in %vd', $attr->{dropped};
75 elsif ($attr->{stable}) {
76 $title .= sprintf ' until %vd', $attr->{stable};
78 if ($attr->{experimental}) {
79 $title = sprintf '<span title="experimental::%s">%s</span>',
80 $attr->{experimental}, $title;
82 if ($attr->{feature}) {
83 my $prefix = sprintf '<span title="%s">feature</span>',
85 $title = join ', ', $prefix, $title // ();
87 $desc .= sprintf ' <em class="ex">(%s)</em>', $title;
89 say sprintf '<dt>%s<dd>%s', $topic, $desc || '<br/>';
91 say sprintf '<dt>Unicode</dt><dd>v%s', $_ for $verrow->{unicode} || ();