NAME

perldelta - what is new for perl v5.41.3

DESCRIPTION

This document describes differences between the 5.41.2 release and the 5.41.3 release.

If you are upgrading from an earlier release such as 5.41.1, first read perl5412delta, which describes differences between 5.41.1 and 5.41.2.

Incompatible Changes

Apostrophe is no longer recognized as a global name separator

The apostrophe ' has been recognized as a separator between components of package names and package variables since Perl 3, acting exactly like ::, which was introduced in Perl 5.

Use of ' as a package separator was deprecated in Perl 5.38 and has now been removed.

[GH #22303]

Switch and Smart Match operator removed

The "switch" feature and the smartmatch operator, ~~, were introduced in v5.10. Their behavior was significantly changed in v5.10.1. When the "experiment" system was added in v5.18.0, switch and smartmatch were retroactively declared experimental. Over the years, proposals to fix or supplement the features have come and gone.

They were deprecated in Perl v5.38.0 and scheduled for removal in Perl 5.42.0

These features have now been entirely removed.

If you code currently uses given/when or smart match this can be replaced with an if/else chain, or there are several alternative "switch" or smart match implementations on CPAN.

In no particular order:

[GH #22370]

Performance Enhancements

  • tr/// now runs at the same speed regardless of the internal representation of its operand, as long as the only characters being translated are ASCII-range, for example tr/A-Z/a-z/. Previously, if the internal encoding was UTF-8, a slower, more general implementation was used.

Modules and Pragmata

Updated Modules and Pragmata

  • B::Deparse has been upgraded from version 1.77 to 1.78.

  • Compress::Raw::Bzip2 has been upgraded from version 2.212 to 2.213.

  • Compress::Raw::Zlib has been upgraded from version 2.212 to 2.213.

  • DynaLoader has been upgraded from version 1.56 to 1.57.

  • ExtUtils::ParseXS has been upgraded from version 3.52 to 3.53.

  • ExtUtils::Typemaps has been upgraded from version 3.51 to 3.53.

  • feature has been upgraded from version 1.90 to 1.91.

  • IO::Compress has been upgraded from version 2.212 to 2.213.

  • Module::CoreList has been upgraded from version 5.20240720 to 5.20240829.

  • Opcode has been upgraded from version 1.65 to 1.66.

  • overload has been upgraded from version 1.37 to 1.38.

  • parent has been upgraded from version 0.241 to 0.242.

  • perl5db.pl has been upgraded from version 1.80 to 1.81.

    b subname, c subname, b postpone subname will now break on the first line that is expected to execute in the sub. [GH #799]

    Distinguish between an empty list or undef for w expressions. [GH #22207]

  • Safe has been upgraded from version 2.46 to 2.47.

  • Scalar::Util (the Scalar-List-Utils distribution) has been upgraded from version 1.63 to 1.65.

  • Storable has been upgraded from version 3.33 to 3.34.

  • Term::Table has been upgraded from version 0.018 to 0.022.

  • Test::Harness has been upgraded from version 3.48 to 3.50.

  • Test::Simple has been upgraded from version 1.302199 to 1.302201 and subsequently to 1.302201. Upstream on CPAN, the Test2-Suite distribution has been merged into the Test-Simple distribution. Test2-Suite was formerly shipped with the Perl core distribution. Test2-Suite's files are now found under cpan/Test-Simple in the Perl 5 source tree (whether you access that source tree in a git checkout or in a released tarball). However, this should have no impact whatsoever on any end-user of any modules formerly found under Test2-Suite.

  • threads has been upgraded from version 2.41 to 2.42.

  • Tie::RefHash has been upgraded from version 1.40 to 1.41.

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 Warnings

  • %s() attempted on handle %s opened with open()

    (W io) You called readdir(), telldir(), seekdir(), rewinddir() or closedir() on a handle that was opened with open(). If you want to use these functions to traverse the contents of a directory, you need to open the handle with opendir().

    [GH #22394]

  • Possible precedence problem on isa operator

    (W precedence) You wrote something like

    !$obj isa Some::Class

    but because ! has higher precedence than isa, this is interpreted as (!$obj) isa Some::Class, which checks whether a boolean is an instance of Some::Class. If you want to negate the result of isa instead, use one of:

    !($obj isa Some::Class)   # explicit parentheses
    not $obj isa Some::Class  # low-precedence 'not' operator

Changes to Existing Diagnostics

Testing

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

  • Added testing of the perl headers against the C++ compiler corresponding to the C compiler perl is being built with. [GH #22232]

Internal Changes

  • When built with the -DDEBUGGING compile option, perl API functions that take pointers to distinct types of SVs (AVs, HVs or CVs) will check the SvTYPE() of the passed values to ensure they are valid. Additionally, internal code within core functions that attempts to extract AVs, HVs or CVs from reference values passed in will also perform such checks.

    While this has been entirely tested by normal Perl CI testing, there may still be some corner-cases where these constraints are violated in otherwise-valid calls. These may require further investigation if they are found, and specific code to be adjusted to account for it.

Selected Bug Fixes

  • open automatically creates an anonymous temporary file when passed undef as a filename:

    open(my $fh, "+>", undef) or die ...

    Due the way this feature was implemented, it would also trigger for non-existent elements of arrays or hashes:

    open(my $fh, "+>", $hash{no_such_key}) or die ...
    # unexpectedly succeeds and creates a temp file

    Now a temporary file is only created if a literal undef is passed. [GH #22385]

  • Compound assignment operators return lvalues that can be further modified:

    ($x &= $y) += $z;
    # Equivalent to:
    #  $x &= $y;
    #  $x += $z;

    However, the separate numeric/string bitwise operators provided by the bitwise feature, &= ^= |= &.= ^.= |.=, did not do so:

    use feature qw(bitwise);
    ($x &= $y) += $z;
    # Used to die:
    #  Can't modify numeric bitwise and (&) in addition (+) at ...

    This has been corrected. [GH #22412]

  • Starting in v5.39.8, "strftime" in POSIX would crash or produce odd errors (such as Out of memory in perl:util:safesysmalloc) when given a format string that wasn't actually a string, but a number, undef, or an object (even one with overloaded string conversion).

    Now strftime stringifies its first argument, as before. [GH #22498]

Obituary

Abe Timmerman (ABELTJE) passed away on August 15, 2024. Since 2002, Abe built and maintained the Test::Smoke project: "a set of scripts and modules that try to run the Perl core tests on as many configurations as possible and combine the results into an easy to read report". Smoking Perl on as many platforms and configurations as possible has been instrumental in finding bugs and developing patches for those bugs.

Abe was a regular attendee of the Perl Toolchain Summit (née Perl QA Hackathon), the Dutch Perl Workshop and the Amsterdam.pm user group meetings. With his kindness, his smile and his laugh, he helped make Perl and its community better.

Abeltje's memorial card said "Grab every opportunity to have a drink of bubbly. This is an opportunity". We'll miss you Abe, and we'll have a drink of bubbly in your honor.

Acknowledgements

Perl 5.41.3 represents approximately 6 weeks of development since Perl 5.41.2 and contains approximately 34,000 lines of changes across 740 files from 23 authors.

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

Branislav Zahradník, Chad Granum, Craig A. Berry, Dan Jacobson, David Mitchell, E. Choroba, Eric Herman, Graham Knop, iabyn, James E Keenan, Karen Etheridge, Karl Williamson, Leon Timmermans, Lukas Mai, Max Maischein, Paul Evans, Paul Marquess, Philippe Bruhat (BooK), Sisyphus, Štěpán Němec, Steve Hay, TAKAI Kousuke, Thibault Duponchelle, Tony Cook.

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.