NAME

perldelta - what is new for perl v5.43.2

DESCRIPTION

This document describes differences between the 5.43.1 release and the 5.43.2 release.

If you are upgrading from an earlier release such as 5.43.0, first read perl5431delta, which describes differences between 5.43.0 and 5.43.1.

Notice

  • The ibm-clang/ibm-clang_r IBM Open XL C/C++ compiler is now supported for AIX 7.2 and 7.3. This is the recommended compiler to use when compiling Perl on these versions of AIX.

Core Enhancements

Reported argument counts in method signatures now account for $self

In previous versions of Perl, the exception message thrown by a method 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 $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.

Performance Enhancements

  • Simple (non-overflowing) addition (+), subtraction (-) and multiplication (*) of IVs are slightly sped up, as long as sufficient underlying C compiler support is available.

Modules and Pragmata

Updated Modules and Pragmata

  • B::Deparse has been upgraded from version 1.85 to 1.86.

  • ExtUtils::Miniperl has been upgraded from version 1.14 to 1.15.

  • ExtUtils::ParseXS has been upgraded from version 3.58 to 3.59.

  • ExtUtils::Typemaps has been upgraded from version 3.58 to 3.59.

  • feature has been upgraded from version 1.98 to 1.99.

  • File::Copy has been upgraded from version 2.41 to 2.42.

  • File::stat has been upgraded from version 1.14 to 1.15.

    • The overridden stat and lstat functions now always return a scalar value, even in list context. Previously a failed stat in list context would return an empty list; now it returns undef.

    • stat and lstat can now be called without an argument, in which case they will use $_, just like the built-in stat/lstat functions.

    • It is now safe to pass path objects (e.g. instances of Path::Tiny) to stat/lstat. Previously a failed stat operation on such an object would die with a cryptic Not a GLOB reference at .../File/stat.pm line 208 error. [GH #23507]

  • Filter::Simple has been upgraded from version 0.96 to 0.97.

  • Module::CoreList has been upgraded from version 5.20250720 to 5.20250820.

  • mro has been upgraded from version 1.29 to 1.30.

  • POSIX has been upgraded from version 2.23 to 2.24.

  • Scalar::Util has been upgraded from version 1.69 to 1.70.

  • Storable has been upgraded from version 3.37 to 3.38.

  • Text::Balanced has been upgraded from version 2.06 to 2.07.

  • threads::shared has been upgraded from version 1.70 to 1.71.

  • Unicode::UCD has been upgraded from version 0.82 to 0.83.

  • XS::APItest has been upgraded from version 1.43 to 1.44.

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:

perlapi

  • Auto-generation of this document now includes the line number of the source code, as well as its documentation.

perlexperiment

  • New entry for "New object system and class syntax".

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

  • Can't redeclare catch variable as "%s"

    (F) A my, our or state keyword was used with the exception variable in a catch block:

    try { ... }
    catch (my $e) { ... }
    # or catch (our $e) { ... }
    # or catch (state $e) { ... }

    This is not valid syntax. catch takes a bare variable name, which is automatically lexically declared. [GH #23222]

New Warnings

  • Possible attempt to escape whitespace in qw() list

    (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 warnings is only emitted when the backslash is followed by actual whitespace (that qw splits on).

Testing

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

  • Karl Williamson gave a talk at PTS 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. (video link) It gained renewed interest this month, leading to an uptick in test submissions from new authors, for which we are extremely grateful.

Platform Support

Platform-Specific Notes

Win32

Fix builds with USE_IMP_SYS defined but USE_ITHREADS not defined.

Internal Changes

  • Removed the deprecated (since 5.32) functions sv_locking() and sv_unlocking.

  • Perl_expected_size has been added as an experimental stub macro. The intention is to build on this such that it can be passed a size in bytes, then returns the interpreter's best informed guess of what actual usable allocation size would be returned by the malloc implementation in use.

    This would help with sizing allocations such that SvLEN is more accurate and not trying to shrink string buffers to save size when the intended saving is unrealistic.

  • SvPV_shrink_to_cur has been revised to include a byte for COW, so that the resulting string could be COWed in the future.

    It also now uses Perl_expected_size, compared against the current buffer size, and does not try to do a reallocation if the requested memory saving is unrealistic.

  • sv_vcatpvfn_flags() now substitutes the Unicode REPLACEMENT CHARACTER for malformed input. Previously it used the NUL character.

  • For core Perl maintainers, the syntax of embed.fnc has been extended. Every function, foo(), named in this file has generated for it a macro named PERL_ARGS_ASSERT_FOO. The macro expands to assert() calls that do basic sanity checking for each argument to foo() that we currently deem as being appropriate to have such checking. (That means that many arguments are not checked, and that the generated macro may currently expand to nothing.) With this release, you can add assert() statements yourself to embed.fnc that will be incorporated into the generated macro, beyond the system-generated ones. Comments and examples in embed.fnc give details.

Selected Bug Fixes

  • Certain constructs involving a two-variable for loop would crash the perl compiler in v5.42.0:

    # Two-variable for loop over a list returned from a method call:
    for my ($x, $y) (Some::Class->foo()) { ... }
    for my ($x, $y) ($object->foo()) { ... }

    and

    # Two-variable for loop over a list returned from a call to a
    # lexical(ly imported) subroutine, all inside a lexically scoped
    # or anonymous subroutine:
    my sub foo { ... }
    my $fn = sub {
        for my ($x, $y) (foo()) { ... }
    };
    
    use builtin qw(indexed);  # lexical import!
    my sub bar {
        for my ($x, $y) (indexed(...)) { ... }
    }

    These have been fixed. [GH #23405]

  • Several error conditions in the pack and unpack operations were not detected and now are.

Acknowledgements

Perl 5.43.2 represents approximately 4 weeks of development since Perl 5.43.1 and contains approximately 12,000 lines of changes across 200 files from 24 authors.

Excluding auto-generated files, documentation and release tools, there were approximately 6,700 lines of changes to 120 .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.43.2:

brian d foy, Chris 'BinGOs' Williams, Craig A. Berry, Dagfinn Ilmari Mannsåker, Daniel Dragan, David Mitchell, Eric Herman, James E Keenan, James Raspass, Karen Etheridge, Karl Williamson, Leon Timmermans, Lukas Mai, Marc Reisner, Maxim Vuets, Nicolas R, Paul Evans, Philippe Bruhat (BooK), Richard Leach, Ryan Carsten Schmidt, Samuel Young, Steve Hay, TAKAI Kousuke, 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.