=pod =encoding utf8 =head1 NAME perl5320delta - what is new for perl v5.32.0 =head1 DESCRIPTION This document describes differences between the 5.30.0 release and the 5.32.0 release. If you are upgrading from an earlier release such as 5.28.0, first read L, which describes differences between 5.28.0 and 5.30.0. =head1 Core Enhancements =head2 The isa Operator A new experimental infix operator called C tests whether a given object is an instance of a given class or a class derived from it: if( $obj isa Package::Name ) { ... } For more detail see L. =head2 Unicode 13.0 is supported See L for details. =head2 Chained comparisons capability Some comparison operators, as their associativity, I with some operators of the same precedence (but never with operators of different precedence). if ( $x < $y <= $z ) {...} behaves exactly like: if ( $x < $y && $y <= $z ) {...} (assuming that C<"$y"> is as simple a scalar as it looks.) You can read more about this in L under L. =head2 New Unicode properties C and C supported Unicode has revised its regular expression requirements: L. As part of that they are wanting more properties to be exposed, ones that aren't part of the strict UCD (Unicode character database). These two are used for examining inputs for security purposes. Details on their usage is at L. =head2 It is now possible to write C, or C The Unicode Name property is now accessible in regular expression patterns, as an alternative to C<\N{...}>. A comparison of the two methods is given in L. The second example above shows that wildcard subpatterns are also usable in this property. See L. =head2 Improvement of C, C, and C The C, C, and C functions now work on shift state locales and are thread-safe on C99 and above compilers when executed on a platform that has locale thread-safety; the length parameters are now optional. These functions are always executed under the current C language locale. (See L.) Most locales are stateless, but a few, notably the very rarely encountered ISO 2022, maintain a state between calls to these functions. Previously the state was cleared on every call, but now the state is not reset unless the appropriate parameter is C. On threaded perls, the C99 functions L, L, and L, when available, are substituted for the plain functions. This makes these functions thread-safe when executing on a locale thread-safe platform. The string length parameters in C and C are now optional; useful only if you wish to restrict the length parsed in the source string to less than the actual length. =head2 Alpha assertions are no longer experimental See L, L, L>, and L. Use of these no longer generates a warning; existing code that disables the warning category C will continue to work without any changes needed. Enabling the category has no effect. =head2 Script runs are no longer experimental See L. Use of these no longer generates a warning; existing code that disables the warning category C will continue to work without any changes needed. Enabling the category has no effect. =head2 Feature checks are now faster Previously feature checks in the parser required a hash lookup when features were set outside of a feature bundle, this has been optimized to a bit mask check. [L] =head2 Perl is now developed on GitHub Perl is now developed on GitHub. You can find us at L. Non-security bugs should now be reported via GitHub. Security issues should continue to be reported as documented in L. =head2 Compiled patterns can now be dumped before optimization This is primarily useful for tracking down bugs in the regular expression compiler. This dump happens on C<-DDEBUGGING> perls, if you specify C<-Drv> on the command line; or on any perl if the pattern is compiled within the scope of S> or S>. (All but the second case display other information as well.) =head1 Security =head2 [CVE-2020-10543] Buffer overflow caused by a crafted regular expression A signed C integer overflow in the storage space calculations for nested regular expression quantifiers could cause a heap buffer overflow in Perl's regular expression compiler that overwrites memory allocated after the regular expression storage space with attacker supplied data. The target system needs a sufficient amount of memory to allocate partial expansions of the nested quantifiers prior to the overflow occurring. This requirement is unlikely to be met on 64-bit systems. Discovered by: ManhND of The Tarantula Team, VinCSS (a member of Vingroup). =head2 [CVE-2020-10878] Integer overflow via malformed bytecode produced by a crafted regular expression Integer overflows in the calculation of offsets between instructions for the regular expression engine could cause corruption of the intermediate language state of a compiled regular expression. An attacker could abuse this behaviour to insert instructions into the compiled form of a Perl regular expression. Discovered by: Hugo van der Sanden and Slaven Rezic. =head2 [CVE-2020-12723] Buffer overflow caused by a crafted regular expression Recursive calls to C by Perl's regular expression compiler to optimize the intermediate language representation of a regular expression could cause corruption of the intermediate language state of a compiled regular expression. Discovered by: Sergey Aleynikov. =head2 Additional Note An application written in Perl would only be vulnerable to any of the above flaws if it evaluates regular expressions supplied by the attacker. Evaluating regular expressions in this fashion is known to be dangerous since the regular expression engine does not protect against denial of service attacks in this usage scenario. =head1 Incompatible Changes =head2 Certain pattern matching features are now prohibited in compiling Unicode property value wildcard subpatterns These few features are either inappropriate or interfere with the algorithm used to accomplish this task. The complete list is in L. =head2 Unused functions C and C are removed These functions could never have worked due to a defective interface specification. There is clearly no demand for them, given that no one has ever complained in the many years the functions were claimed to be available, hence so-called "support" for them is now dropped. =head2 A bug fix for C<(?[...])> may have caused some patterns to no longer compile See L. The heuristics previously used may have let some constructs compile (perhaps not with the programmer's intended effect) that should have been errors. None are known, but it is possible that some erroneous constructs no longer compile. =head2 C<\p{I}> properties now always override official Unicode ones Previously, if and only if a user-defined property was declared prior to the compilation of the regular expression pattern that contains it, its definition was used instead of any official Unicode property with the same name. Now, it always overrides the official property. This change could break existing code that relied (likely unwittingly) on the previous behavior. Without this fix, if Unicode released a new version with a new property that happens to have the same name as the one you had long been using, your program would break when you upgraded to a perl that used that new Unicode version. See L. [L] =head2 Modifiable variables are no longer permitted in constants Code like: my $var; $sub = sub () { $var }; where C<$var> is referenced elsewhere in some sort of modifiable context now produces an exception when the sub is defined. This error can be avoided by adding a return to the sub definition: $sub = sub () { return $var }; This has been deprecated since Perl 5.22. L<[GH #17020]|https://github.com/Perl/perl5/issues/17020> =head2 Use of L|perlfunc/vec EXPR,OFFSET,BITS> on strings with code points above 0xFF is forbidden Such strings are represented internally in UTF-8, and C is a bit-oriented operation that will likely give unexpected results on those strings. This was deprecated in perl 5.28.0. =head2 Use of code points over 0xFF in string bitwise operators Some uses of these were already illegal after a previous deprecation cycle. The remaining uses are now prohibited, having been deprecated in perl 5.28.0. See L. =head2 C does not accept arguments This usage was deprecated in perl 5.28.0 and is now fatal. =head2 Plain "0" string now treated as a number for range operator Previously a range C<"0" .. "-1"> would produce a range of numeric strings from "0" through "99"; this now produces an empty list, just as C<0 .. -1> does. This also means that C<"0" .. "9"> now produces a list of integers, where previously it would produce a list of strings. This was due to a special case that treated strings starting with "0" as strings so ranges like C<"00" .. "03"> produced C<"00", "01", "02", "03">, but didn't specially handle the string C<"0">. L<[GH #16770]|https://github.com/Perl/perl5/issues/16770> =head2 C<\K> now disallowed in look-ahead and look-behind assertions This was disallowed because it causes unexpected behaviour, and no-one could define what the desired behaviour should be. L<[GH #14638]|https://github.com/Perl/perl5/issues/14638> =head1 Performance Enhancements =over 4 =item * C has been sped up for systems that don't have their own C implementation. =item * C (and so, C, C, and C) have been sped up. =item * C has been sped up. =item * C is now noticeably faster in cases such as C<< sort {$a <=> $b} >> or C<< sort {$b <=> $a} >>. [L] =back =head1 Modules and Pragmata =head2 Updated Modules and Pragmata =over 4 =item * L has been upgraded from version 2.32 to 2.36. =item * L has been upgraded from version 2.29 to 2.32. =item * L has been upgraded from version 1.76 to 1.80. =item * L has been upgraded from version 1.49 to 1.54. =item * L has been upgraded from version 1.22 to 1.23. =item * L has been upgraded from version 1.45 to 1.48. =item * L has been upgraded from version 0.65 to 0.66. =item * L has been upgraded from version 2.084 to 2.093. =item * L has been upgraded from version 2.084 to 2.093. =item * L has been upgraded from version 2.22 to 2.27. =item * L has been upgraded from version 1.843 to 1.853. =item * L has been upgraded from version 3.52 to 3.57. The test files generated on Win32 are now identical to when they are generated on POSIX-like systems. =item * L has been upgraded from version 1.36 to 1.37. =item * L has been upgraded from version 2.55 to 2.55_01. =item * L has been upgraded from version 1.18 to 1.21. Previously, when dumping elements of an array and encountering an undefined value, the string printed would have been C. This has been changed to what was apparently originally intended: C. =item * L has been upgraded from version 1.45 to 1.47. =item * L has been upgraded from version 3.01 to 3.06. =item * L has been upgraded from version 2.22 to 3.00. =item * L has been upgraded from version 1.10 to 1.11. =item * L has been upgraded from version 5.73 to 5.74. =item * L has been upgraded from version 0.280231 to 0.280234. =item * L has been upgraded from version 7.34 to 7.44. =item * L has been upgraded from version 1.54 to 1.58. A new C feature has been added, which is enabled by default but allows turning off L. =item * L has been upgraded from version 1.36 to 1.37. On Win32, the tests no longer require either a file in the drive root directory, or a writable root directory. =item * L has been upgraded from version 1.32 to 1.33. =item * L has been upgraded from version 1.08 to 1.09. =item * L has been upgraded from version 0.95 to 0.96. =item * L has been upgraded from version 2.5 to 2.51. =item * L has been upgraded from version 0.22 to 0.23. The Synopsis has been updated as the example code stopped working with newer perls. [L] =item * L has been upgraded from version 0.18 to 0.19. =item * L has been upgraded from version 0.43 to 0.44. Document the C environment variable. =item * L has been upgraded from version 1.40 to 1.43. L no longer caches a zero protocol value, since this indicates that the implementation will select a protocol. This means that on platforms that don't implement C for a given socket type the protocol method may return C. The supplied I is now always honoured on calls to the C method. L<[GH #16891]|https://github.com/Perl/perl5/issues/16891> =item * IO-Compress has been upgraded from version 2.084 to 2.093. =item * L has been upgraded from version 1.02 to 1.04. =item * L has been upgraded from version 1.20 to 1.21. =item * L has been upgraded from version 4.02 to 4.04. =item * L has been upgraded from version 1.999816 to 1.999818. =item * L has been upgraded from version 0.5008 to 0.5009. =item * L has been upgraded from version 5.20190522 to 5.20200620. =item * L has been upgraded from version 0.68 to 0.70. =item * L has been upgraded from version 1.000036 to 1.000037. =item * L has been upgraded from version 1.22 to 1.23. =item * L has been upgraded from version 2.71 to 2.72. =item * L has been upgraded from version 1.43 to 1.47. =item * L has been upgraded from version 1.11 to 1.12. =item * L has been upgraded from version 1.30 to 1.31. =item * L has been upgraded from version 0.237 to 0.238. =item * L has been upgraded from version 5.20190126 to 5.20200523. =item * L has been upgraded from version 1.10 to 1.11. =item * L has been upgraded from version 0.27 to 0.28. =item * L has been upgraded from version 0.17 to 0.18. =item * L has been upgraded from version 1.24 to 1.25. =item * L has been upgraded from version 3.35 to 3.40. =item * L has been upgraded from version 4.11 to 4.14. =item * L has been upgraded from version 1.88 to 1.94. =item * L has been upgraded from version 0.37 to 0.40. =item * L has been upgraded from version 2.40 to 2.41. =item * L has been upgraded from version 1.50 to 1.55. =item * L has been upgraded from version 1.25 to 1.26. =item * L has been upgraded from version 2.027 to 2.029. =item * L has been upgraded from version 3.15 to 3.21. Use of C from L is now optional in tests. This works around a circular dependency with L when installing on very old perls from CPAN. Vstring magic strings over 2GB are now disallowed. Regular expressions objects weren't properly counted for object id purposes on retrieve. This would corrupt the resulting structure, or cause a runtime error in some cases. L<[GH #17037]|https://github.com/Perl/perl5/issues/17037> =item * L has been upgraded from version 1.22 to 1.23. =item * L has been upgraded from version 0.35 to 0.36. =item * L has been upgraded from version 4.06 to 5.01. =item * L has been upgraded from version 1.302162 to 1.302175. =item * L has been upgraded from version 3.04 to 3.05. =item * L has been upgraded from version 3.13 to 3.14. =item * L has been upgraded from version 2.22 to 2.25. =item * L has been upgraded from version 1.60 to 1.61. =item * L has been upgraded from version 1.02 to 1.06. =item * L has been upgraded from version 0.10 to 0.13. =item * L has been upgraded from version 1.04 to 1.05. =item * L has been upgraded from version 4.5 to 4.6. =item * L has been upgraded from version 1.9760 to 1.9764. Removed obsolete code such as support for pre-5.6 perl and classic MacOS. L<[GH #17096]|https://github.com/Perl/perl5/issues/17096> =item * L has been upgraded from version 1.33 to 1.3401. =item * L has been upgraded from version 1.26 to 1.27. =item * L has been upgraded from version 0.72 to 0.75. =item * L has been upgraded from version 2.44 to 2.45. =item * L has been upgraded from version 1.44 to 1.47. =item * L has been upgraded from version 0.52 to 0.53. =item * L has been upgraded from version 0.1203 to 0.1203_01. =item * L has been upgraded from version 1.00 to 1.09. =back =head2 Removed Modules and Pragmata =over 4 =item * Pod::Parser has been removed from the core distribution. It still is available for download from CPAN. This resolves [L<#13194|https://github.com/Perl/perl5/issues/13194>]. =back =head1 Documentation =head2 Changes to Existing Documentation We have attempted to update the documentation to reflect the changes listed in this document. If you find any we have missed, open an issue at L. Additionally, the following selected changes have been made: =head3 L =over 4 =item * Simplify a few regnode definitions Update C and C definitions. =item * Add ANYOFHs regnode This node is like C, but is used when more than one leading byte is the same in all the matched code points. C is used to avoid having to convert from UTF-8 to code point for something that won't match. It checks that the first byte in the UTF-8 encoded target is the desired one, thus ruling out most of the possible code points. =back =head3 L =over 4 =item * C updated to mention it will croak if the SV cannot be downgraded. =item * C updated to mention that the UTF-8 flag will not be changed by this function, and a terminating NUL byte is guaranteed. =item * Documentation for C has been added. =item * The documentation for C, C, and C has been updated and clarified. =back =head3 L =over 4 =item * Add documentation for experimental 'isa' operator (S experimental::isa) This warning is emitted if you use the (C) operator. This operator is currently experimental and its behaviour may change in future releases of Perl. =back =head3 L =over 4 =item C Like L|/__FILE__> and L|/__LINE__>, the filename and line number returned here may be altered by the mechanism described at L. =item C<__FILE__> It can be altered by the mechanism described at L. =item C<__LINE__> It can be altered by the mechanism described at L. =item C Now mentions that you cannot return from C. =item C The C section had been renovated significantly. =back =head3 L =over 4 =item * No longer suggesting using perl's C. Modern system C is assumed to be much better than perl's implementation now. =item * Documentation about F flags has been removed. F now has sufficient comments within it. Anyone changing that file will see those comments first, so entries here are now redundant. =item * Updated documentation for C =item * Added missing C<=for apidoc> lines =back =head3 L =over 4 =item * The differences between Perl strings and C strings are now detailed. =back =head3 L =over 4 =item * The documentation for the repetition operator C have been clarified. [L] =back =head3 L =over 4 =item * The documentation surrounding C and handle usage has been modernized to prefer 3-arg open and lexical variables instead of barewords. =item * Various updates and fixes including making all examples strict-safe and replacing C<-w> with C. =back =head3 L =over 4 =item * 'isa' operator is experimental This is an experimental feature and is available when enabled by C. It emits a warning in the C category. =back =head3 L =over 4 =item * Details of the various stacks within the perl interpreter are now explained here. =item * Advice has been added regarding the usage of C<< ZEE >>. =back =head3 L =over 4 =item * Update C example to use the correct year format I<1970> instead of I<70>. [L] =back =head3 L =over 4 =item * Fix some typos. =back =head3 L =over 4 =item * Now recommends stringifying C<$]> and comparing it numerically. =back =head3 L, L =over 4 =item * Documentation has been added for several functions that were lacking it before. =back =head3 L =over 4 =item * Suggest using C for simple library bindings via CPAN modules like L or L. =back =head3 L =over 4 =item * C warning about threaded builds updated to note it does not apply on Perl 5.28.X and later. =item * C<< Posix::SigSet->new(...) >> updated to state it throws an error if any of the supplied signals cannot be added to the set. =back Additionally, the following selected changes have been made: =head3 Updating of links =over 4 =item * Links to the now defunct L site now point at the equivalent L URL. [L] =item * The man page for L is now only installed on VMS, which is the only platform the module is installed on. [L] =item * URLs have been changed to C and stale links have been updated. Where applicable, the URLs in the documentation have been moved from using the C protocol to C. This also affects the location of the bug tracker at L. =item * Some links to OS/2 libraries, Address Sanitizer and other system tools had gone stale. These have been updated with working links. =item * Some links to old email addresses on perl5-porters had gone stale. These have been updated with working links. =back =head1 Diagnostics The following additions or changes have been made to diagnostic output, including warnings and fatal error messages. For the complete list of diagnostic messages, see L. =head2 New Diagnostics =head3 New Errors =over 4 =item * L%sE |perldiag/"Expecting interpolated extended charclass in regex; marked by <-- HERE in mE%sE"> This is a replacement for several error messages listed under L. =item * C> (F) No hexadecimal digits were found following C<0x> or no binary digits were found following C<0b>. =back =head3 New Warnings =over 4 =item * L This is actually not a new message, but it is now output when the warnings category C is enabled. When raised during regular expression pattern compilation, the warning has extra text added at the end marking where precisely in the pattern it occurred. =item * L This replaces a warning that was much less specific, and which gave false information. This new warning parallels the similar already-existing one raised for C<\o{}>. =back =head2 Changes to Existing Diagnostics =over 4 =item * L ...now has extra text added at the end, when raised during regular expression pattern compilation, marking where precisely in the pattern it occurred. =item * L ...now has extra text added at the end, when raised during regular expression pattern compilation, marking where precisely in the pattern it occurred. =item * L ...now has extra text added at the end, when raised during regular expression pattern compilation, marking where precisely in the pattern it occurred. =item * L<"\c%c" is more clearly written simply as "%s"|perldiag/""\c%c" is more clearly written simply as "%s""> ...now has extra text added at the end, when raised during regular expression pattern compilation, marking where precisely in the pattern it occurred. =item * L ...now includes the phrase "terminates \o early", and has extra text added at the end, when raised during regular expression pattern compilation, marking where precisely in the pattern it occurred. In some instances the text of the resolution has been clarified. =item * L<'%s' resolved to '\o{%s}%d'|perldiag/'%s' resolved to '\o{%s}%d'> As of Perl 5.32, this message is no longer generated. Instead, L is used instead. =item * L Some instances of this message previously output the hex digits C, C, C, C, C, and C in lower case. Now they are all consistently upper case. =item * The following three diagnostics have been removed, and replaced by L%sE> |perldiag/"Expecting interpolated extended charclass in regex; marked by <-- HERE in mE%sE">: C%sE>, C%sE>, and C in mE%sE>. =item * The C warning removed the line C as code points that large are no longer legal on 32-bit platforms. =item * L This error message has been slightly reformatted from the original C, and in particular misleading error messages like C are now rendered as C. =item * L This error message replaces the former C to reflect the fact that this previously deprecated usage has now been transformed into an exception. The message's classification has also been updated from D (deprecated) to F (fatal). See also L. =item * C<\N{} here is restricted to one character> is now emitted in the same circumstances where previously C<\N{} in inverted character class or as a range end-point is restricted to one character> was. This is due to new circumstances having been added in Perl 5.30 that weren't covered by the earlier wording. =back =head1 Utility Changes =head2 L =over 4 =item * The bug tracker homepage URL now points to GitHub. =back =head2 L =over 4 =item * This is a new utility, included as part of an L upgrade. L creates a zip file from stdin. The program will read data from stdin, compress it into a zip container and, by default, write a streamed zip file to stdout. =back =head1 Configuration and Compilation =head2 F =over 4 =item * For clang++, add C<< #include >> to Configure's probes for C, C, C, C, C, otherwise the probes would fail to compile. =item * Use a compile and run test for C to satisfy clang++ which should more reliably detect it. =item * For C++ compilers, add C<< #include >> to Configure's probes for C and C as they use printf and C++ compilers may fail compilation instead of just warning. =item * Check if the compiler can handle inline attribute. =item * Check for character data alignment. =item * F now correctly handles gcc-10. Previously it was interpreting it as gcc-1 and turned on C<-fpcc-struct-return>. =item * Perl now no longer probes for C, defaulting to C on all platforms. This check was error-prone when it was done, which was on 32-bit platforms only. L<[GH #16680]|https://github.com/Perl/perl5/issues/16680> =item * Documentation and hints for building perl on Z/OS (native EBCDIC) have been updated. This is still a work in progress. =item * A new probe for C has been added. =item * Improvements in F to detection in C++ and clang++. Work ongoing by Andy Dougherty. L<[GH #17033]|https://github.com/Perl/perl5/issues/17033> =item * F This tool that regenerates L and L has been overhauled significantly, restoring consistency in flags used in F and L and allowing removal of many redundant C<=for apidoc> entries in code. =item * The C macro is now defined. This is used in a C rule that was originally changed for FreeBSD, and the FreeBSD make apparently predefines it. The Solaris make does not predefine C which broke this rule on Solaris. L<[GH #17057]|https://github.com/Perl/perl5/issues/17057> =item * Bison versions 3.1 through 3.4 are now supported. =back =head1 Testing Tests were added and changed to reflect the other additions and changes in this release. Furthermore, these significant changes were made: =over 4 =item * F no longer uses (and re-uses) the F directory under F. This may prevent spurious failures. [L] =item * Various bugs in C were fixed. Potential races with other threads are now avoided, and previously the returned wide character could well be garbage. =item * Various bugs in C were fixed. Potential races with other threads are now avoided, and previously it would segfault if the string parameter was shared or hadn't been pre-allocated with a string of sufficient length to hold the result. =item * Certain test output of scalars containing control characters and Unicode has been fixed on EBCDIC. =item * F: Avoid some work on ASCII platforms. =item * F: Speed up many regex tests on ASCII platform =item * F: Skip tests that don't work on EBCDIC. =back =head1 Platform Support =head2 Discontinued Platforms =over 4 =item Windows CE Support for building perl on Windows CE has now been removed. =back =head2 Platform-Specific Notes =over 4 =item Linux C will be used to populate C if C is C. L<[GH #17043]|https://github.com/Perl/perl5/issues/17043> =item NetBSD 8.0 Fix compilation of Perl on NetBSD 8.0 with g++. [L] =item Windows =over 4 =item * The configuration for C and C are now separate, as with POSIX platforms. [L] =item * Support for building perl with Visual C++ 6.0 has now been removed. =item * The locale tests could crash on Win32 due to a Windows bug, and separately due to the CRT throwing an exception if the locale name wasn't validly encoded in the current code page. For the second we now decode the locale name ourselves, and always decode it as UTF-8. L<[GH #16922]|https://github.com/Perl/perl5/issues/16922> =item * F could fail if environment variables starting with C already existed. =item * MYMALLOC (PERL_MALLOC) build has been fixed. =back =item Solaris =over 4 =item * C will now find recent versions of the Oracle Developer Studio compiler, which are found under C. =item * C now uses the detected types for C functions, allowing Perl to once again compile on certain configurations of Solaris. =back =item VMS =over 4 =item * With the release of the patch kit C99 V2.0, VSI has provided support for a number of previously-missing C99 features. On systems with that patch kit installed, Perl's configuration process will now detect the presence of the header C and the following functions: C, C, C, C, C, C, C, C, C, C, and C. =item * C<-Duse64bitint> is now the default on VMS. =back =item z/OS Perl 5.32 has been tested on z/OS 2.4, with the following caveats: =over 4 =item * Only static builds (the default) build reliably =item * When using locales, z/OS does not handle the C category properly, so when compiling perl, you should add the following to your F options ./Configure -Accflags=-DNO_LOCALE_MESSAGES =item * z/OS does not support locales with threads, so when compiling a threaded perl, you should add the following to your F options ./Configure -Accflags=-DNO_LOCALE =item * Some CPAN modules that are shipped with perl fail at least one of their self-tests. These are: Archive::Tar, Config::Perl::V, CPAN::Meta, CPAN::Meta::YAML, Digest::MD5, Digest::SHA, Encode, ExtUtils::MakeMaker, ExtUtils::Manifest, HTTP::Tiny, IO::Compress, IPC::Cmd, JSON::PP, libnet, MIME::Base64, Module::Metadata, PerlIO::via-QuotedPrint, Pod::Checker, podlators, Pod::Simple, Socket, and Test::Harness. The causes of the failures range from the self-test itself is flawed, and the module actually works fine, up to the module doesn't work at all on EBCDIC platforms. =back =back =head1 Internal Changes =over 4 =item * C's len parameter is now a C instead of an C since we can handle longer strings than 31 bits. =item * The lexer (C in F) was previously a single 4100-line function, relying heavily on C and a lot of widely-scoped local variables to do its work. It has now been pulled apart into a few dozen smaller static functions; the largest remaining chunk (C) is a little over 900 lines, and consists of a single C statement, all of whose C groups are independent. This should be much easier to understand and maintain. =item * The OS-level signal handlers and type (Sighandler_t) used by the perl core were declared as having three parameters, but the OS was always told to call them with one argument. This has been fixed by declaring them to have one parameter. See the merge commit C for full details. =item * The code that handles C has been extensively revised, fixing various bugs, especially when the source and/or replacement strings contain characters whose code points are above 255. Some of the bugs were undocumented, one being that under some circumstances (but not all) with C, the squeezing was done based on the source, rather than the replacement. A documented bug that got fixed was L<[GH #14777]|https://github.com/Perl/perl5/issues/14777>. =item * A new macro for XS writers dealing with UTF-8-encoded Unicode strings has been created L> that is safer in the face of malformed UTF-8 input than L> (but not as safe as L>). It won't read past a NUL character. It has been backported in L 3.55 and later. =item * Added the C<< PL_curstackinfo->si_cxsubix >> field. This records the stack index of the most recently pushed sub/format/eval context. It is set and restored automatically by C, C etc., but would need to be manually managed if you do any unusual manipulation of the context stack. =item * Various macros dealing with character type classification and changing case where the input is encoded in UTF-8 now require an extra parameter to prevent potential reads beyond the end of the buffer. Use of these has generated a deprecation warning since Perl 5.26. Details are in L =item * A new parser function L allows a keyword plugin to parse a subroutine signature while C is in effect. This allows custom keywords to implement semantics similar to regular C declarations that include signatures. L<[GH #16261]|https://github.com/Perl/perl5/issues/16261> =item * Since on some platforms we need to hold a mutex when temporarily switching locales, new macros (C, C and C) have been added to make it easier to do this safely and efficiently as part of L<[GH #17034]|https://github.com/Perl/perl5/issues/17034>. =item * The memory bookkeeping overhead for allocating an OP structure has been reduced by 8 bytes per OP on 64-bit systems. =item * L no longer stringifies the exception when C<[GH #17035]|https://github.com/Perl/perl5/issues/17035>] =item * The PERL_DESTRUCT_LEVEL environment variable was formerly only honoured on perl binaries built with DEBUGGING support. It is now checked on all perl builds. Its normal use is to force perl to individually free every block of memory which it has allocated before exiting, which is useful when using automated leak detection tools such as valgrind. =item * The API eval_sv() now accepts a C flag. If this flag is set and an exception is thrown while compiling or executing the supplied code, it will be rethrown, and eval_sv() will not return. L<[GH #17036]|https://github.com/Perl/perl5/issues/17036> =item * As part of the fix for L<[GH #1537]|https://github.com/Perl/perl5/issues/1537> perl_parse() now returns non-zero if exit(0) is called in a C, C or C block. =item * Most functions which recursively walked an op tree during compilation have been made non-recursive. This avoids SEGVs from stack overflow when the op tree is deeply nested, such as C<$n == 1 ? "one" : $n == 2 ? "two" : ....> (especially in code which is auto-generated). This is particularly noticeable where the code is compiled within a separate thread, as threads tend to have small stacks by default. =back =head1 Selected Bug Fixes =over 4 =item * Previously L would only treat the special built-in SV C<&PL_sv_undef> as a value in C<%INC> as if a previous C has failed, treating other undefined SVs as if the previous C has succeeded. This could cause unexpected success from C e.g., on C. This has been fixed. [L] =item * C<(?{...})> eval groups in regular expressions no longer unintentionally trigger "EVAL without pos change exceeded limit in regex" [L]. =item * C<(?[...])> extended bracketed character classes do not wrongly raise an error on some cases where a previously-compiled such class is interpolated into another. The heuristics previously used have been replaced by a reliable method, and hence the diagnostics generated have changed. See L. =item * The debug display (say by specifying C<-Dr> or S> (with appropriate options) of compiled Unicode property wildcard subpatterns no longer has extraneous output. =item * Fix an assertion failure in the regular expression engine. [L] =item * Fix coredump in pp_hot.c after C. [L] =item * Loading IO is now threadsafe. [L] =item * C<\p{user-defined}> overrides official Unicode [L] Prior to this patch, the override was only sometimes in effect. =item * Properly handle filled C regnodes and multi-char folds =item * Compilation error during make minitest [L] =item * Move the implementation of C<%->, C<%+> into core. =item * Read beyond buffer in C [L] =item * Workaround glibc bug with C [L] =item * C or C with the C<%n> format could cause a panic on debugging builds, or report an incorrectly cached length value when producing C flagged strings. [L] =item * The tokenizer has been extensively refactored. [L] [L] =item * C is now enforced for bareword constants optimized into a C operator. [L] =item * A memory leak in regular expression patterns has been fixed. [L] =item * Perl no longer treats strings starting with "0x" or "0b" as hex or binary numbers respectively when converting a string to a number. This reverts a change in behaviour inadvertently introduced in perl 5.30.0 intended to improve precision when converting a string to a floating point number. L<[GH #17062]|https://github.com/Perl/perl5/issues/17062> =item * Matching a non-C string against a regular expression containing unicode literals could leak a SV on each match attempt. L<[GH #17140]|https://github.com/Perl/perl5/issues/17140> =item * Overloads for octal and binary floating point literals were always passed a string with a C<0x> prefix instead of the appropriate C<0> or C<[GH #14791]|https://github.com/Perl/perl5/issues/14791>] =item * C<< $@ = 100; die; >> now correctly propagates the 100 as an exception instead of ignoring it. L<[GH #17098]|https://github.com/Perl/perl5/issues/17098> =item * C<[GH #17108]|https://github.com/Perl/perl5/issues/17108>] =item * Exceptions thrown while C<$@> is read-only could result in infinite recursion as perl tried to update C<$@>, which throws another exception, resulting in a stack overflow. Perl now replaces C<$@> with a copy if it's not a simple writable SV. L<[GH #17083]|https://github.com/Perl/perl5/issues/17083> =item * Setting C<$)> now properly sets supplementary group ids if you have the necessary privileges. L<[GH #17031]|https://github.com/Perl/perl5/issues/17031> =item * close() on a pipe now preemptively clears the PerlIO object from the IO SV. This prevents a second attempt to close the already closed PerlIO object if a signal handler calls die() or exit() while close() is waiting for the child process to complete. L<[GH #13929]|https://github.com/Perl/perl5/issues/13929> =item * C<< sprintf("%.*a", -10000, $x) >> would cause a buffer overflow due to mishandling of the negative precision value. L<[GH #16942]|https://github.com/Perl/perl5/issues/16942> =item * scalar() on a reference could cause an erroneous assertion failure during compilation. L<[GH #16969]|https://github.com/Perl/perl5/issues/16969> =item * C<%{^CAPTURE_ALL}> is now an alias to C<%-> as documented, rather than incorrectly an alias for C<[GH #16105]|https://github.com/Perl/perl5/issues/16105>] =item * C<%{^CAPTURE}> didn't work if C<@{^CAPTURE}> was mentioned first. Similarly for C<%{^CAPTURE_ALL}> and C<@{^CAPTURE_ALL}>, though C<[GH #17045]|https://github.com/Perl/perl5/issues/17045>] =item * Extraordinarily large (over 2GB) floating point format widths could cause an integer overflow in the underlying call to snprintf(), resulting in an assertion. Formatted floating point widths are now limited to the range of int, the return value of snprintf(). [L<#16881|https://github.com/Perl/perl5/issues/16881>] =item * Parsing the following constructs within a sub-parse (such as with C<"${code here}"> or C) has changed to match how they're parsed normally: =over =item * C no longer produces a syntax error. =item * Code like C now properly produces an "Ambiguous use of ${time} resolved to $time at ..." warning when warnings are enabled. =item * C<@x {"a"}> (with the space) in a sub-parse now properly produces a "better written as" warning when warnings are enabled. =item * Attributes can now be used in a sub-parse. L<[GH #16847]|https://github.com/Perl/perl5/issues/16847> =back =item * Incomplete hex and binary literals like C<0x> and C<0b> are now treated as if the C or C is part of the next token. [L<#17010|https://github.com/Perl/perl5/issues/17010>] =item * A spurious C<)> in a subparse, such as in C or C<"...${code here}">, no longer confuses the parser. Previously a subparse was bracketed with generated C<(> and C<)> tokens, so a spurious C<)> would close the construct without doing the normal subparse clean up, confusing the parser and possible causing an assertion failure. Such constructs are now surrounded by artificial tokens that can't be included in the source. L<[GH #15814]|https://github.com/Perl/perl5/issues/15814> =item * Reference assignment of a sub, such as C<\&foo = \&bar;>, silently did nothing in the C<[GH #16987]|https://github.com/Perl/perl5/issues/16987>] =item * sv_gets() now recovers better if the target SV is modified by a signal handler. L<[GH #16960]|https://github.com/Perl/perl5/issues/16960> =item * C now evaluates C<@foo> in scalar context. Previously it would be evaluated in list context, and since readline() pops only one argument from the stack, the stack could underflow, or be left with unexpected values on the stack. L<[GH #16929]|https://github.com/Perl/perl5/issues/16929> =item * Parsing incomplete hex or binary literals was changed in 5.31.1 to treat such a literal as just the 0, leaving the following C or C to be parsed as part of the next token. This could lead to some silent changes in behaviour, so now incomplete hex or binary literals produce a fatal error. L<[GH #17010]|https://github.com/Perl/perl5/issues/17010> =item * eval_pv()'s I flag will now throw even if the exception is a false overloaded value. L<[GH #17036]|https://github.com/Perl/perl5/issues/17036> =item * C blocks and the program itself are no longer run if exit(0) is called within a C, C or C block. L<[GH #1537]|https://github.com/Perl/perl5/issues/1537> =item * C<< open my $fh, ">>+", undef >> now opens the temporary file in append mode: writes will seek to the end of file before writing. L<[GH #17058]|https://github.com/Perl/perl5/issues/17058> =item * Fixed a SEGV when searching for the source of an uninitialized value warning on an op whose subtree includes an OP_MULTIDEREF. L<[GH #17088]|https://github.com/Perl/perl5/issues/17088> =back =head1 Obituary Jeff Goff (JGOFF or DrForr), an integral part of the Perl and Raku communities and a dear friend to all of us, has passed away on March 13th, 2020. DrForr was a prominent member of the communities, attending and speaking at countless events, contributing to numerous projects, and assisting and helping in any way he could. His passing leaves a hole in our hearts and in our communities and he will be sorely missed. =head1 Acknowledgements Perl 5.32.0 represents approximately 13 months of development since Perl 5.30.0 and contains approximately 220,000 lines of changes across 1,800 files from 89 authors. Excluding auto-generated files, documentation and release tools, there were approximately 140,000 lines of changes to 880 .pm, .t, .c and .h files. Perl continues to flourish into its fourth decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.32.0: Aaron Crane, Alberto Simões, Alexandr Savca, Andreas König, Andrew Fresh, Andy Dougherty, Ask Bjørn Hansen, Atsushi Sugawara, Bernhard M. Wiedemann, brian d foy, Bryan Stenson, Chad Granum, Chase Whitener, Chris 'BinGOs' Williams, Craig A. Berry, Dagfinn Ilmari Mannsåker, Dan Book, Daniel Dragan, Dan Kogai, Dave Cross, Dave Rolsky, David Cantrell, David Mitchell, Dominic Hargreaves, E. Choroba, Felipe Gasper, Florian Weimer, Graham Knop, Håkon Hægland, Hauke D, H.Merijn Brand, Hugo van der Sanden, Ichinose Shogo, James E Keenan, Jason McIntosh, Jerome Duval, Johan Vromans, John Lightsey, John Paul Adrian Glaubitz, Kang-min Liu, Karen Etheridge, Karl Williamson, Leon Timmermans, Manuel Mausz, Marc Green, Matthew Horsfall, Matt Turner, Max Maischein, Michael Haardt, Nicholas Clark, Nicolas R., Niko Tyni, Pali, Paul Evans, Paul Johnson, Paul Marquess, Peter Eisentraut, Peter John Acklam, Peter Oliver, Petr Písař, Renee Baecker, Ricardo Signes, Richard Leach, Russ Allbery, Samuel Smith, Santtu Ojanperä, Sawyer X, Sergey Aleynikov, Sergiy Borodych, Shirakata Kentaro, Shlomi Fish, Sisyphus, Slaven Rezic, Smylers, Stefan Seifert, Steve Hay, Steve Peters, Svyatoslav, Thibault Duponchelle, Todd Rinaldo, Tomasz Konojacki, Tom Hukins, Tony Cook, Unicode Consortium, VanL, Vickenty Fesunov, Vitali Peil, Yves Orton, Zefram. The list above is almost certainly incomplete as it is automatically generated from version control history. In particular, it does not include the names of the (very much appreciated) contributors who reported issues to the Perl bug tracker. Many of the changes included in this version originated in the CPAN modules included in Perl's core. We're grateful to the entire CPAN community for helping Perl to flourish. For a more complete list of all of Perl's historical contributors, please see the F file in the Perl source distribution. =head1 Reporting Bugs If you find what you think is a bug, you might check the perl bug database at L. There may also be information at L, the Perl Home Page. If you believe you have an unreported bug, please open an issue at L. Be sure to trim your bug down to a tiny but sufficient test case. If the bug you are reporting has security implications which make it inappropriate to send to a public issue tracker, then see L for details of how to report the issue. =head1 Give Thanks If you wish to thank the Perl 5 Porters for the work we had done in Perl 5, you can do so by running the C program: perlthanks This will send an email to the Perl 5 Porters list with your show of thanks. =head1 SEE ALSO The F file for an explanation of how to view exhaustive details on what changed. The F file for how to build Perl. The F file for general stuff. The F and F files for copyright information. =cut