NAME

perldelta - what is new for perl v5.45.2

DESCRIPTION

This document describes differences between the 5.45.1 release and the 5.45.2 release.

If you are upgrading from an earlier release such as 5.44.0, first read perl5451delta, which describes differences between 5.44.0 and 5.45.1.

Core Enhancements

Magic v2

This version introduces a whole new set of API functions, data structures, and related items that provides a new kind of variable magic; providing the ability to attach user-supplied trigger functions to behaviours on existing variables.

The eventual intention of this new version is to extend magic with new trigger functions that can apply at different times to those currently supported, and to allow magic to be attached to new kinds of items than are currently permitted. Right now as of this iteration, it does not offer any new abilities but simply changes the shape and structure of existing things to allow space for those extensions to be made at a later date.

For more details, see "Magic v2" in perlguts.

Incompatible Changes

Names derived from class fields skip a leading underscore

If the name of a class field starts with an underscore, any derived constructor parameters (:param) or methods (:reader, :writer) will skip that underscore:

class Foo {
    field $_bar :param :reader :writer;
    # Equivalent to:
    #   field $_bar :param(bar) :reader(bar) :writer(set_bar);
}

This is how Object::Pad works, too.

In previous versions of Perl, the underscore was retained, making the above declaration equivalent to field $_bar :param(_bar) :reader(_bar) :writer(set__bar);.

Performance Enhancements

  • OP_REF_CMP has been added to streamline expressions such as (ref $x eq 'SCALAR') where (i) the first operator is ref or reftype, (ii) the comparison is eq or ne, and (iii) the value being compared against is one of the internal reftype strings mentioned in "ref" in perlfunc, is Regexp, or is the empty string ''.

  • Counting the number of matches within a string using the following common idiom is now much more performant.

    my $count = () = $str =~ /$pat/g;

    Instead of pushing all matches to the stack as mortal SVs, just so that the list assignment can count them, pp_match maintains an internal count during matching and pushes just that upon completion. [GH #24558]

Modules and Pragmata

Updated Modules and Pragmata

  • B has been upgraded from version 1.92 to 1.93.

  • B::Deparse has been upgraded from version 1.89 to 1.90.

  • Config::Perl::V has been upgraded from version 0.39 to 0.40.

  • Devel::SelfStubber has been upgraded from version 1.06 to 1.07.

  • ExtUtils::ParseXS has been upgraded from version 3.64 to 3.65.

    XS files compiled with this new version now output a slightly nicer message when loaded in an incompatible perl binary. For example:

    XS.c in List::MoreUtils::XS: loadable library and perl binaries are
     mismatched (got first handshake key 0xed00080, needed 0xee00080)

    The old message didn't include the module name, just the (potentially ambiguous) name of the C source file:

    XS.c: loadable library and perl binaries are mismatched
     (got first handshake key 0xed00080, needed 0xee00080)

    [GH #24646], [GH #15861], [GH #16654]

  • ExtUtils::Typemaps has been upgraded from version 3.64 to 3.65.

  • I18N::LangTags::List has been upgraded from version 0.41 to 0.42.

    It no longer sets $_ to undef when loaded, and it now closes an internal filehandle that it only uses during initialization (instead of keeping it open for the rest of the program's lifetime).

  • Module::CoreList has been upgraded from version 5.20260720 to 5.20260722.

  • Module::Metadata has been upgraded from version 1.000039 to 1.000040.

  • Net::Ping has been upgraded from version 2.77 to 2.78.

  • Opcode has been upgraded from version 1.71 to 1.72.

  • PerlIO::encoding has been upgraded from version 0.31 to 0.32.

  • PerlIO::via has been upgraded from version 0.21 to 0.22.

  • Pod::Html has been upgraded from version 1.36 to 1.37.

  • Socket has been upgraded from version 2.041 to 2.043.

  • Time::HiRes has been upgraded from version 1.9780 to 1.9781.

  • Win32 has been upgraded from version 0.59_01 to 0.64.

  • XS::APItest has been upgraded from version 1.51 to 1.52.

Documentation

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 https://github.com/Perl/perl5/issues.

Additionally, the following selected changes have been made:

perlhacktips

  • Expanded commentary on symbol visibility

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 perldiag.

New Diagnostics

New Errors

Configuration and Compilation

  • Perl can now be built from a directory whose path contains spaces. (However, a few module tests still fail.) [GH #24670]

  • The -[DU]usetaint option has been added to Configure.

Testing

Tests were added and changed to reflect the other additions and changes in this release. Furthermore, these significant changes were made:

  • t/porting/customized.t: Corrected to now check for entries in t/porting/customized.dat that no longer need to be there.

Platform Support

Platform-Specific Notes

MacOS (Darwin)

Use of mkostemp(3) enabled on macOS 10.12 Sierra (Darwin 16) and newer, where it is available.

Internal Changes

  • During compiletime of a named subroutine, the name of the new sub currently being compiled is now accessible via CvNAME_HEK(PL_compcv).

  • A new internal function, padname_upgrade_sv() attaches an SV onto a PADNAME instance, which is used to store the name string of that padname. This SV can be used by code that wishes to attach magic onto the padname.

  • The integer pragma previously lacked increment/decrement operators that implemented the documented pragma behaviour; these have now been added. Code or tests that depend upon increment/decrement behaving identically under both use integer and no integer may need revising. [GH #3564] [GH #24448]

  • The values of G_DISCARD and HV_FETCH_ISSTORE no longer clash. G_DISCARD is supposed to be unambiguously bitwise-or-able with any of the HV_FETCH_* constants, but the collision with HV_FETCH_ISSTORE was missed. [GH #24537]

Selected Bug Fixes

  • Cleanup of field initialization ops for an incomplete class now happens within the correct CV. Previously, if an error was thrown with an incomplete class this would release pad entries on the wrong CV and eventually crash. [GH #24616]

  • sv_set_undef() no longer blindly clears the SVs_TEMP flag. This could break code that expected to detect mortal SVs, like constant folding. [GH #24661]

  • The regular expression engine's "super-linear cache" wasn't 64-bit clean and so could in principle overflow on huge (>256Mb) strings, resulting in incorrect matches and potential memory corruption. (The cache engages on nested variable-width patterns such as /(a+)+/, to avoid exponential backtracking.)

    [GH security issue #149]

  • The increment/decrement operators, under both use integer and no integer, check for GET magic before testing if the supplied variable contains a reference. [GH #24448]

  • The increment/decrement operators, under both use integer and no integer, should now handle 0+ overloading correctly. [GH #24448]

Known Problems

  • Some of the CPAN module tests shipped with perl don't handle spaces in the build path yet. [GH #24670]

Errata From Previous Releases

  • In perl5451delta, we inadvertently noted a change about mutex locks in the section under "Incompatible Changes". That change should have been under "Internal Changes", and has since been moved.

Acknowledgements

Perl 5.45.2 represents approximately 4 weeks of development since Perl 5.45.1 and contains approximately 24,000 lines of changes across 320 files from 25 authors.

Excluding auto-generated files, documentation and release tools, there were approximately 15,000 lines of changes to 220 .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.45.2:

Andreas König, Aristotle Pagaltzis, Bartosz Jarzyna, Craig A. Berry, Dagfinn Ilmari Mannsåker, Daniel Tang, David Mitchell, H.Merijn Brand, James E Keenan, Jan Dubois, Karen Etheridge, Karl Williamson, Leon Timmermans, Lukas Mai, Marc Reisner, Max Maischein, Paul Evans, Philippe Bruhat (BooK), Richard Leach, Sevan Janiyan, Stan Ulbrych, Steve Hay, theoremoon, Tony Cook, Yves Orton.

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 AUTHORS file in the Perl source distribution.

Reporting Bugs

If you find what you think is a bug, you might check the perl bug database at https://github.com/Perl/perl5/issues. There may also be information at https://www.perl.org/, the Perl Home Page.

If you believe you have an unreported bug, please open an issue at https://github.com/Perl/perl5/issues. 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 "SECURITY VULNERABILITY CONTACT INFORMATION" in perlsec for details of how to report the issue.

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 perlthanks program:

perlthanks

This will send an email to the Perl 5 Porters list with your show of thanks.

SEE ALSO

The Changes file for an explanation of how to view exhaustive details on what changed.

The INSTALL file for how to build Perl.

The README file for general stuff.

The Artistic and Copying files for copyright information.