perl: gather and describe v5.8 features
[sheet.git] / perl.inc.pl
1 use utf8;
2
3 +{
4         v5.6 => {
5                 new => [
6                         ['<code>use utf8</code>'],
7                         ['<code>\N{named character}</code>'],
8                         ['<code>our</code>'],
9                         ['<code>v1.2.3</code>'],
10                         ['<code>sub :locked :method</code>'],
11                         ['<code>open $fh, $mode, $expr</code>'],
12                 ],
13                 release => '2000-03-23',
14                 distro => {
15                         debian => 'woody',
16                         redhat => '2.1',
17                 },
18                 unicode => '3.0.1',
19         },
20
21         v5.8 => {
22                 new => [
23                         [q`<code>no utf8; $unicode</code>`, 'unicode overhaul: additional /\p{}/ properties'],
24                         [q`<code>binmode $fh, ':perlio'</code>`, 'file handle behaviour altered by PerlIO layers'],
25                         [q`<code>open $fh, '-|', @cmd</code>`, 'open list to fork a command without spawning a shell'],
26                         [q`<code>open $fh, '>', \$var</code>`, 'perl scalars as virtual files'],
27                         [q`<code>printf '%1$s', @args</code>`, 'syntax to use parameters out of order'],
28                         [q`<code>$num = 1_000</code>`, 'underscores between digits allowed in numeric constants'],
29 #                       [q`<code>use if</code>`, 'conditional module inclusion'], # also installable in earlier versions
30                 ],
31                 release => '2002-07-18',
32                 distro => {
33                         debian => 'sarge',
34                         redhat => '3.9',
35                 },
36                 unicode => '3.2.0',
37         },
38
39         v5.10 => {
40                 new => [
41                         ['<code>//</code>', 'defined-or operator'],
42                         ['<code>~~</code>', 'smart-match operator to compare different data types'],
43                         ['<code>given</code>', 'switch statement to smart-match with <code>when</code>/<code>default</code>'],
44                         ['<code>/(?&lt;name>)/</code>', 'named capture buffers into <code>%+</code>'],
45                         ['<code>s/keep\K//</code>', 'floating positive lookbehind, efficient alternative for <code>s/(keep)/$1/</code>'],
46                         ['<code>/\v/, /\h/</code>', 'vertical and horizontal whitespace escapes'],
47                         ['<code>my $_</code>', 'lexically scoped version of the default variable'],
48                 ],
49                 release => '2007-12-18',
50                 distro => {
51                         debian => 'lenny',
52                         redhat => '6.5',
53                 },
54                 unicode => '5.0.0',
55         },
56
57         v5.12 => {
58                 new => [
59                         ['<code>package version</code>', '<code>package</code> NAME VERSION shorthand for <code>our $VERSION</code>'],
60                         ['<code>...</code>', 'yada-yada operator: code placeholder'],
61                         ['<code>use 5.012</code>', 'Implicit <code>strict</code> if use VERSION >= v5.12'],
62                         ['<code>… when</code>', '<code>when</code> is now allowed to be used as a statement modifier'],
63                 ],
64                 release => '2010-04-12',
65                 unicode => '5.2',
66         },
67
68         v5.14 => {
69                 new => [
70                         ['<code>s///r</code>', 'non-destructive substitution'],
71                         ['<code>/(?^)/</code>', 'construct to reset to default modifiers'],
72                         ['<code>/(?{ m// })/</code>', 'regular expressions can be nested in <code>/(?{})/</code> and <code>/(??{})/</code>'],
73                         ["<code>use re '/flags'</code>", 'customize default modifiers'],
74                         ['<code>each $ref</code> e.a.', 'array and hash container functions accept references'],
75                         ['<code>FH->method</code>', 'filehandle method calls load IO::File on demand (eg. <code>STDOUT->flush</code>)'],
76                 ],
77                 release => '2011-05-14',
78                 distro => {
79                         debian => 'wheezy',
80                 },
81                 unicode => '6.0+#8',
82         },
83
84         v5.16 => {
85                 new => [
86                         ['<code>__SUB__</code>', 'current subroutine reference'],
87                         ['<code>fc, "\F"</code>', 'unicode foldcase to compare case-insensitively'],
88                         ['<code>"\N{}"</code>', 'automatic use charnames qw( :full :short )'],
89                 ],
90                 release => '2012-05-20',
91                 distro => {
92                         redhat => '7.0',
93                 },
94                 unicode => '6.1',
95         },
96
97         v5.18 => {
98                 new => [
99                         ['<code>${^LAST_FH}</code>', 'last read filehandle (used by <code>$.</code>)'],
100                         ['<code>/(?[ a + b ])/</code>', 'regex set operations (character substraction -, unions &amp;)'],
101                         ['<code>my sub foo</code>', 'lexical subroutines (also state, our)'],
102                         ['<code>next $expression</code>', 'loop controls allow runtime expressions'],
103                         [q(<code>no warnings 'experimental::…'</code>), 'mechanism for experimental features, as of now required for smartmatch'],
104                 ],
105                 release => '2013-05-18',
106                 distro => {
107                         debian => 'jessie',
108                 },
109                 unicode => '6.2',
110         },
111
112         v5.20 => {
113                 new => [
114                         ['<code>sub ($var)</code>', 'subroutine signatures'],
115                         ['<code>%hash{…}</code>', 'hash slices return key+value pairs'],
116                         ['<code>[]->@*</code>', 'postfix dereferencing (also e.g. <code>$scalar->$*</code> for <code>$$scalar</code>)'],
117                         [q(<code>use warnings 'once'; $a</code>), 'variables $a and $b are exempt from <em>used once</em> warnings'],
118                 ],
119                 unicode => '6.3',
120                 release => '2014-05-27',
121         },
122 }