Perl 5.30 released

Yesterday, May 23, Perl 5.30.0 was released. The news was announced by perl.perl5.porters Usenet as one of Perl’s key developers, Sawyer X.


Compared with the previous stable release, 5.28.0, released about 11 months ago, about 620,000 lines of code were changed, the changes affected 1300 files, 58 authors took part in the development. Changes to the source code itself (only .pm, .t, .c and .h files) are estimated at ~ 510,000 lines and 750 files.


The development of the next branch 5.31 is open. The next stable release is scheduled for May 2020.


Key changes:


  • The Perl API C functions sv_utf8_downgrade and sv_utf8_decode are no longer considered experimental.
  • Experimental support for lookbehind expressions of variable length, such as for example "(? <= Foo?)" And "(?
  • The maximum value of the size specifier ("n") in the blocks "{m, n}" of regular expressions has been increased from 32767 to 65534.
  • Support for Unicode 12.1.
  • Limited wildcards support has been added to the Unicode property value specifications (I don’t know how to translate correctly). For example, the expression "qr! \ P {nv = / (? X) \ A [0-5] \ z /}!" Allows you to select all Unicode characters that define numbers from 0 to 5, including Thai or Bengali numerals.
  • Support for qr '\ N {name}' has been implemented (named characters inside regular expressions limited to single quotes; earlier such regexp led to an error).
  • Now you can compile Perl using only thread-safe operations with locales (-Accflags = '- DUSE_THREAD_SAFE_LOCALE').
  • The combination of the flags “-Dv” (extended debugging output) and “-Dr” (debugging regular expressions) now leads to the inclusion of all possible debugging modes of regular expressions.
  • Pack () adds protection against the return of invalid Unicode sequences.

Feature removal and incompatible changes:


  • Assigning a nonzero value to the special variable $ [ (index of the first element of the array) now leads to a fatal error.
  • As separators of lines and patterns, only graphemes are now allowed . (Unicode compound characters are prohibited).
  • Some previously obsolete ways to use the unescaped left bracket “{” in regex patterns are now prohibited.
  • Calling sysread (), syswrite (), send (), or recv () while processing the handle: utf8 is now a fatal error.
  • It is forbidden to use "my" in identically false conditional statements (for example, "my $ x if 0").
  • Removed support for the special variable $ * (multi-line search). The correct alternatives are "/ s" and "/ m".
  • Removed support for the special variable $ # (formatted output of numbers).
  • The function name dump () now needs to be explicitly qualified (CORE :: dump).
  • Removed the function File :: Glob :: glob (you need to use File :: Glob :: bsd_glob).
  • It was planned to stop supporting the use of macros that perform operations with UTF-8 in XS code (C blocks), but then it was decided to postpone it to version 5.32.

Performance Improvements:


  • Translation of UTF-8 into code points (I don’t know how to translate) is now implemented as a state machine, which also leads to increased performance - for example, ord ("\ x7fff") now requires 12% less instructions. UTF-8 character sequence validation is also implemented as a state machine and is faster.
  • Recursive calls removed from finalize_op ().
  • Minor optimizations have been made to the code for folding identical characters and defining character classes in regular expressions.
  • The conversions of signed type identifiers to unsigned (IV to UV) have been optimized.
  • The algorithm for converting integers to strings is accelerated by processing two digits instead of one at a time.
  • Improved by LGTM analysis.
  • Optimized code in regcomp.c, regcomp.h and regexec.c files.
  • Matching regular expressions of the form “qr / [^ a] /” is significantly accelerated for cases where “a” is an ASCII character (non-ASCII “a” cases can also show an increase in performance, but under certain conditions).

Also popular now: