=encoding utf8 =head1 NAME perldelta - what is new for perl v5.44.0 =head1 DESCRIPTION This document describes differences between the 5.42.0 release and the 5.44.0 release. =head1 Core Enhancements =head2 Reported argument counts in C signatures now account for C<$self> In previous versions of Perl, the exception message thrown by a C subroutine with a signature when it does not receive an appropriate number of arguments to match its declared parameters failed to account for the implied C<$self> parameter, causing the numbers in the message to be 1 fewer than intended. This has now been fixed, so messages report the correct number of arguments including the object invocant. =head2 Unicode 17.0 is supported See L. =head2 Named Parameters in Signatures This adds a major new ability to subroutine signatures, allowing callers to pass parameters by name/value pairs rather than by position. sub f ($x, $y, :$alpha, :$beta = undef) { ... } f( 123, 456, alpha => 789 ); Originally specified in L. This feature is currently considered B, and is described in further detail in L. =head2 Multi-variable C can now use aliased references Perl version 5.22 introduced reference aliases, allowing a C loop iteration variable to create new aliases to references. Perl version 5.36 introduced C loops with multiple variables, consuming more than one input list item on each iteration. New in this version, the two features may now be used together, allowing multiple iteration variables where any of them are permitted to be reference aliases. use v5.44; use feature qw( refaliasing declared_refs ); my %hash = ( one => [1], two => [2, 2], ); foreach my ( $key, \@items ) ( %hash ) { say "The $key array contains: @items"; } Currently both the C and C features remain B. =head2 New source of entropy for PRNG seeding Perl now uses the C system call to fetch random bytes suitable for seeding the internal PRNG. Previously Perl would read raw bytes from the F device. Perl now seeds itself in this order (and falls through upon failure): =over =item 1. C on systems that support this call (Linux, BSD, MacOS) =item 2. F on systems that have it =item 3. Hash of internal state variables: Unix time, process ID, and pointer value =back =head2 Enhanced operation of regular expression patterns under /xx Experimentally, the C pattern modifier can allow bracketed character classes (I, C<[a-zA-Z]> to extend across multiple lines and to contain comments, and to warn you of potential cases where a portion of a pattern inadvertently has been treated as a comment instead of what you intended. This behavior is enabled by S>. See Lx and Exx>. =head1 Security =head2 CVE-2026-8376 - Buffer overflow in Perl_study_chunk Perl_study_chunk in regcomp_study.c checked the size of the joined substring buffer in characters rather than bytes. On 32-bit builds, this can lead to an integer overflow of the size of the buffer leading to out-of-bounds writes. =head1 Incompatible Changes =head2 Unicode rules are now fully enforced on identifier and regular expression group names. Before Unicode, Perl accepted any C<\w> character in an identifier or other name, except the first character couldn't be a digit. Later, Unicode created two properties that described this. Even later, they found those properties to be insufficient, and created two new similar properties. These are the ones that perl has intended to use since: C<\p{XID_Start}> and C<\p{XID_Continue}>. (The C stands for "eXtended" and indicates these are the more modern versions.) (And even later, long after Perl identifier rules were formed using the above properties, Unicode added recommendations to further restrict legal identifier names. These were added to counter cases where, for example, programmers snuck code past reviewers using characters that look like other ones. The two properties are C and C. See L. Perl currently doesn't do anything with these, except to furnish you the ability to use them in regular expressions.) We soon discovered that there were 14 characters that match C and C that don't also match C<\w>. To avoid breaking code that had long relied on C<\w>, we chose to not add those to the list of acceptable identifier characters. It turns out that there are about 160 characters that match C<\w> but not the Unicode C properties. Thus they are illegal according to Unicode. Those are now explicitly forbidden in both Perl identifiers and regular expression group names. Previously, it was likely that their use in identifiers wouldn't work anyway; they could be accepted initially as legal, but other code would later reject them, but with a message that had nothing to do with the underlying problem. However group names in regular expression patterns could contain illegal continuation characters and have a higher probablility of not being caught. That is now changed. Only programs that do L|utf8> can be affected, and then only characters that appear in the 2nd or later positions of the name. The characters that an identifier name can begin with are unchanged. 130 of the now unacceptable characters are 5 sets of 26 Latin letters that are enclosed by some shape, such as CIRCLED LATIN CAPITAL LETTER N. Another 8 are generic modifiers that add shapes around other characters; 5 are modifiers to Cyrillic numbers; and 16 are Arabic ligatures and isolated forms. The other two are GREEK YPOGEGRAMMENI and VERTICAL TILDE. =head1 Deprecations =over 4 =item * Using C to jump into the body of a loop or other block construct from outside is no longer permitted. [L] =item * C has new restrictions Using an unescaped C<#> or literal vertical space is now deprecated in a regular expression bracketed character class that is compiled with the C modifier. These still work, but deprecation warnings will be generated unless turned off or the constructs are cured as follows. =over =item * Escape a C<#> by preceding it with a backslash, like in m/ [ % \# ( ) ] /xx =item * Use constructs like C<\n> instead of literal vertical space. =back =back =head1 Performance Enhancements =over 4 =item * Simple (non-overflowing) addition (C<+>), subtraction (C<->) and multiplication (C<*>) of integers are slightly sped up, as long as sufficient underlying C compiler support is available. =back =over 4 =item * Populating a hash from a list of key/value pairs, when the keys are constant string operands known at compile time, is commonly now faster. [L] =back =head1 Modules and Pragmata =head2 Updated Modules and Pragmata =over 4 =item * L has been upgraded from version 3.04 to 3.12. =item * L has been upgraded from version 0.36 to 0.37. =item * L has been upgraded from version 1.89 to 1.92. =item * L has been upgraded from version 1.007 to 1.012. =item * L has been upgraded from version 1.85 to 1.89. =item * L has been upgraded from version 1.50 to 1.51. =item * L has been upgraded from version 2.213 to 2.218. =item * L has been upgraded from version 2.213 to 2.222. =item * L has been upgraded from version 0.38 to 0.39. =item * L has been upgraded from version 2.150010 to 2.150013. =item * L has been upgraded from version 2.143 to 2.145. =item * L has been upgraded from version 1.859 to 1.860. =item * L has been upgraded from version 3.21 to 3.24. =item * L has been upgraded from version 1.11 to 1.12. =item * L has been upgraded from version 1.38 to 1.39. =item * L has been upgraded from version 0.035 to 0.036. =item * L has been upgraded from version 0.280242 to 0.280243. =item * L has been upgraded from version 7.76 to 7.78. =item * L has been upgraded from version 1.14 to 1.15. =item * L has been upgraded from version 3.57 to 3.63. =item * L has been upgraded from version 3.57 to 3.63. =item * L has been upgraded from version 1.97 to 2.02. =item * L has been upgraded from version 2.41 to 2.43. =item * L has been upgraded from version 1.04 to 1.08. =item * L has been upgraded from version 1.42 to 1.44. =item * L has been upgraded from version 3.94 to 3.95. =item * L has been upgraded from version 1.14 to 1.15. =item * L has been upgraded from version 0.2311 to 0.2312. =item * L has been upgraded from version 0.96 to 0.97. =item * L has been upgraded from version 1.64 to 1.65. =item * L has been upgraded from version 1.14 to 1.15. =item * L has been upgraded from version 0.090 to 0.096. =item * L has been upgraded from version 1.55 to 1.56. =item * L has been upgraded from version 2.213 to 2.220. =item * L has been upgraded from version 0.43 to 0.44. =item * L has been upgraded from version 2.005002 to 2.005003. =item * L has been upgraded from version 5.20250702 to 5.20260722. =item * L has been upgraded from version 1.000038 to 1.000039. =item * L has been upgraded from version 1.29 to 1.30. =item * L has been upgraded from version 2.76 to 2.77. =item * L has been upgraded from version 1.69 to 1.71. =item * L has been upgraded from version 0.02 to 0.03. =item * L has been upgraded from version 0.19 to 0.21. =item * L has been upgraded from version 1.35 to 1.36. =item * L has been upgraded from version 3.45 to 3.48. =item * L has been upgraded from version 2.23 to 2.26. =item * L has been upgraded from version 1.68_01 to 1.70. =item * L has been upgraded from version 1.02 to 1.03. =item * L has been upgraded from version 1.28 to 1.29. =item * L has been upgraded from version 2.038 to 2.041. =item * L has been upgraded from version 3.37 to 3.41. =item * L has been upgraded from version 0.024 to 0.028. =item * L has been upgraded from version 3.50 to 3.52. =item * L has been upgraded from version 1.302210 to 1.302219. =item * L has been upgraded from version 2.06 to 2.07. =item * L has been upgraded from version 2.43 to 2.45. =item * L has been upgraded from version 1.70 to 1.73. =item * L has been upgraded from version 1.9778 to 1.9780. =item * L has been upgraded from version 1.36 to 1.41. =item * L has been upgraded from version 0.81 to 0.83. =item * L has been upgraded from version 1.27 to 1.29. =item * L has been upgraded from version 0.9933 to 0.9934. =item * L has been upgraded from version 1.74 to 1.78. =item * L has been upgraded from version 1.43 to 1.50. =item * L has been upgraded from version 0.20 to 0.22. =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 * Auto-generation of this document now includes the line number of the source code, as well as its documentation. =back =head3 L =over 4 =item * New entry for "New object system and C syntax". =item * L now contains information about how to find what release of Perl first contained an API element. =back =head3 L =over 4 =item * The reference manual for writing Perl XS code has been completely rewritten and modernized. It is about twice the size of the old file, and promotes more modern XS syntax, such as ANSI signatures. =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 Changes to Existing Diagnostics =over 4 =item * L This warning was issued in the reverse order (right-to-left) when both operands of a binary operator are uninitialized values. This is now fixed to be consistent with evaluation order of operands. =item * Certain diagnostics about byte sequences that are supposed to comprise a UTF-8 encoded character, but that are invalid in some way, now don't include bytes irrelevant to that determination. An example is =over =item old message Malformed UTF-8 character: C<\xc1\x27> (any UTF-8 sequence that starts with C<\xc1> is overlong which can and should be represented with a different, shorter sequence) =item new message Malformed UTF-8 character: C<\xc1> (any UTF-8 sequence that starts with C<\xc1> is overlong which can and should be represented with a different, shorter sequence) =back In this case the C<\xc1> is all that is needed to make the sequence invalid. Whatever comes after it is irrelevant (in this case, C<\x27>), and including it in the message might lead the reader to think that it somehow does matter. =item * The error C has been changed to C. =item * Variables whose name started with C<^_> were incorrectly shown in diagnostics with a literal C (which is an invisible ASCII character) in their name. The names of variables whose names begin with a caret and are longer than two characters are now wrapped in braces, just as they have to be in the source code. Therefore, using an undefined C<${^_FOO}> will now correctly warn with C, instead of the earlier C (with a literal C after the dollar sign). [L] =item * Calling the C method on a package with no C method now produces a regular warning rather than a deprecation warning or error. Since Perl 5.39.1, calling C with arguments on a package without such a method has triggered a deprecation warning. In Perl 5.43.6, this deprecation was promoted into an error. This broke a significant amount of code while providing very little advantage over the warning. This fatal error has been converted back to a warning, with its deprecation status removed. There are no longer any plans to make this fatal in the future. The category for this warning is C and it is enabled by default. =back =head2 New Diagnostics =head3 New Errors =over 4 =item * L (F) A C, C or C keyword was used with the exception variable in a C block: try { ... } catch (my $e) { ... } # or catch (our $e) { ... } # or catch (state $e) { ... } This is not valid syntax. C takes a bare variable name, which is automatically lexically declared. [L] =item * L (F) You have used C or C in an attempt to jump into the body of a loop or other block construct from the outside. As of Perl 5.44, this throws an exception. =item * L<\x{%X} is a \w char that isn't valid in a name "%s" |perldiag/\x{%X} is a \w char that isn't valid in a name "%s"> In most cases where this message now appears, an error would have occurred anyway, but the text would not have been helpful in finding the problem. =back =head3 New Warnings =over 4 =item * L (W qw) qw() lists contain items separated by whitespace; contrary to what some might expect, backslash characters cannot be used to "protect" whitespace from being split, but are instead treated as literal data. Note that this warning is I emitted when the backslash is followed by actual whitespace (that C splits on). =back =head1 Configuration and Compilation =over 4 =item * C23 F<< >> and associated macros are now used if available. =back =over 4 =item * It is now possible to pass to F the values dealing with POSIX locale categories, overriding its automatic calculation of these. This enables cross-compilation to work. The easiest way to do this is to extract the C program that does the calculation from F and then run it on the target machine, and then pass the values it outputs to F on the other machine. F has examples. [L] =item * The C configuration macro has been removed. It was almost undocumented and it has been disabled by default since Perl 5.10.0. Its purpose was to force all GVs to initialize their SV slot on creation. [L] =back =head1 Testing Tests were added and changed to reflect the other additions and changes in this release. Furthermore, these changes were made: =over 4 =item * Karl Williamson gave a talk at TPRC 2025 asking people to contribute tests to find old issues that are no longer a problem, and todo tests to reflect reproduction cases for known outstanding bugs. (L