X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/513c99e35009e367267722728f9567aa566398ec..dc1ab5f00eed170e75fe40687b381369a35760b8:/perl.inc.pl diff --git a/perl.inc.pl b/perl.inc.pl index 61dbea5..9d416eb 100644 --- a/perl.inc.pl +++ b/perl.inc.pl @@ -80,9 +80,11 @@ use utf8; ['given', 'switch statement to smart-match with when/default', {feature => 'switch', experimental => 'smartmatch'}], ['/(?<name>)/', 'named capture buffers into %+'], ['/(?1)/', 'recursive regular expression patterns'], + ['/(?|)/', 'resets capture numbering for each contained branch'], ['/.++/', 'possessive quantifiers ?+, *+, ++ to match greedily'], ['s/keep\K//', 'floating positive lookbehind, efficient alternative for s/(keep)/$1/'], - ['/\v/, /\h/', 'vertical and horizontal whitespace escapes'], + ['/p', 'optionally preserve ${^MATCH} variables (avoiding $& penalty until COW in v5.20)'], + ['/\v/, /\h/', 'vertical and horizontal whitespace escapes (\V \H to invert); also /\R/ for newlines'], ['my $_', 'lexically scoped version of the default variable', {experimental => 'lexical_topic', dropped => v5.23.4}], ['state', 'persistent my variables', {feature => 'state'}], ], @@ -120,11 +122,13 @@ use utf8; v5.14 => { new => [ ['s///r', 'non-destructive substitution'], - ['/(?^)/', 'construct to reset to default modifiers'], ['/(?{ m() })/', 'regular expressions can be nested in /(?{})/ and /(??{})/', {experimental => 0, stable => v5.20}], + ['/dalu', 'regexp modifiers to restrict character classes: either default, ascii, locale, or unicode semantics.'], [q"use re '/flags'", 'customise default modifiers'], + ['/(?^)/', 'construct to reset to default modifiers'], ['each $ref e.a.', 'array and hash container functions accept references', {experimental => 'postderef', dropped => v5.23.1}], ['FH->method', 'filehandle method calls load IO::File on demand (eg. STDOUT->flush)'], + ['\o{}', 'escape sequence for octal values beyond \777'], ], release => '2011-05-14', distro => { @@ -195,6 +199,7 @@ use utf8; ['&.', '& | ^ ~ consistently numeric, dotted operators for strings', {feature => 'bitwise', experimental => 'bitwise', stable => v5.28}], [q"use re 'strict'", 'apply stricter syntax rules to regular expression patterns', {experimental => 're_strict'}], ['0x.beep+0', q"hexadecimal floating point notation with binary power; printf '%a' to display"], + ['??', 'single match shorthand (deprecated since v5.14) requires the operator m?PATTERN?'], ], unicode => '7.0', release => '2015-06-01', @@ -234,8 +239,8 @@ use utf8; v5.28 => { new => [ ['delete %hash{…}', 'hash slices can be deleted with key+value pairs'], - ['/(*…)/', 'alphabetic synonyms for assertions, e.g. (*atomic:…) for (?>…) and (*nlb:…) for (?<!…)', {experimental => 'alpha_assertions'}], - ['/(*script_run:)/', 'enforces all characters to be from the same script', {experimental => 'script_run'}], + ['/(*…)/', 'alphabetic synonyms for assertions, e.g. (*atomic:…) for (?>…) and (*nlb:…) for (?<!…)', {experimental => 'alpha_assertions', stable => v5.31.6}], + ['/(*script_run:)/', 'enforces all characters to be from the same script', {experimental => 'script_run', stable => v5.31.6}], ['state @a', 'persistent lexical array or hash variables'], ['perl -i -pe die', 'safe in-place editing: files are replaced only after successful completion'], ['${^SAFE_LOCALES}', 'locales are thread-safe on supported systems, indicated by this variable'], @@ -245,4 +250,40 @@ use utf8; distro => { }, }, + + v5.30 => { + new => [ + ['/(?<=var+)', 'variable length lookbehind assertions', {experimental => 'vlb'}], + ['m(\p{nv=/.*/})', 'match unicode properties by regular expressions', {experimental => 'uniprop_wildcards'}], + ['my $state if 0', 'workaround for state (deprecated since v5.10!) is now prohibited'], + [q"qr'\N'", 'Delimiters must be graphemes; unescaped { illegal; \N in single quotes'], + ], + unicode => '12.1', + release => '2019-05-22', + }, + + v5.32 => { + new => [ + ['isa', 'infix operator to check class instance'], + ['$min < $_ <= $max', 'chained comparison repeats inner part as $min < $_ and $_ <= $max'], + ['/\p{Name=$var}/', 'match Unicode Name property like \N{} but with interpolation and subpatterns'], + [q"open F, '+>>', undef", 'respect append mode on temporary files with mixed access'], + ["no feature 'indirect'", 'disable indirect object notation such as new Class instead of Class->new'], + ['streamzip', 'program distributed with core IO::Compress::Base to compress stdin into a zip container'], + ], + unicode => '13.0', + release => '2020-06-20', + details => 'https://www.effectiveperlprogramming.com/2020/01/perl-v5-32-new-features/', + }, + + v5.34 => { + new => [ + ['try {} catch', 'exception handling similar to eval blocks', {experimental => 'try'}], + ['/{,n}/', 'empty lower bound quantifier is accepted as shorthand for 0'], + ['\x{ … }', 'insignificant space within curly braces, also for \b{}, \g{}, \k{}, \N{}, \o{} as well as /{m,n}/ quantifiers'], + ['0o0', 'octal prefix 0o alternative to 0… and oct'], + ['re::optimization(qr//)', 'debug regular expression optimization information discovered at compile time'], + ], + release => '2021-05-20', + }, }