=encoding utf8

=head1 NAME

perldelta - what is new for perl v5.43.2

=head1 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
L<perl5431delta>, which describes differences between 5.43.0 and 5.43.1.

=head1 Notice

=over

=item *

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.

=back

=head1 Core Enhancements

=head2 Reported argument counts in C<method> signatures now account for C<$self>

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

=head1 Performance Enhancements

=over 4

=item *

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

=back

=head1 Modules and Pragmata

=head2 Updated Modules and Pragmata

=over 4

=item *

L<B::Deparse> has been upgraded from version 1.85 to 1.86.

=item *

L<ExtUtils::Miniperl> has been upgraded from version 1.14 to 1.15.

=item *

L<ExtUtils::ParseXS> has been upgraded from version 3.58 to 3.59.

=item *

L<ExtUtils::Typemaps> has been upgraded from version 3.58 to 3.59.

=item *

L<feature> has been upgraded from version 1.98 to 1.99.

=item *

L<File::Copy> has been upgraded from version 2.41 to 2.42.

=item *

L<File::stat> has been upgraded from version 1.14 to 1.15.

=over 4

=item *

The overridden C<stat> and C<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 C<undef>.

=item *

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

=item *

It is now safe to pass path objects (e.g. instances of L<Path::Tiny>) to
C<stat>/C<lstat>. Previously a failed stat operation on such an object would
die with a cryptic C<Not a GLOB reference at .../File/stat.pm line 208> error.
[L<GH #23507|https://github.com/Perl/perl5/issues/23507>]

=back

=item *

L<Filter::Simple> has been upgraded from version 0.96 to 0.97.

=item *

L<Module::CoreList> has been upgraded from version 5.20250720 to 5.20250820.

=item *

L<mro> has been upgraded from version 1.29 to 1.30.

=item *

L<POSIX> has been upgraded from version 2.23 to 2.24.

=item *

L<Scalar::Util> has been upgraded from version 1.69 to 1.70.

=item *

L<Storable> has been upgraded from version 3.37 to 3.38.

=item *

L<Text::Balanced> has been upgraded from version 2.06 to 2.07.

=item *

L<threads::shared> has been upgraded from version 1.70 to 1.71.

=item *

L<Unicode::UCD> has been upgraded from version 0.82 to 0.83.

=item *

L<XS::APItest> has been upgraded from version 1.43 to 1.44.

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

Additionally, the following selected changes have been made:

=head3 L<perlapi>

=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<perlexperiment>

=over 4

=item *

New entry for "New object system and C<class> syntax".

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

=head2 New Diagnostics

=head3 New Errors

=over 4

=item *

L<Can't redeclare catch variable as "%s"|perldiag/"Can't redeclare catch variable as "%s"">

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

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

This is not valid syntax. C<catch> takes a bare variable name, which is
automatically lexically declared.
[L<GH #23222|https://github.com/Perl/perl5/issues/23222>]

=back

=head3 New Warnings

=over 4

=item *

L<Possible attempt to escape whitespace in qw() list|perldiag/"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 I<only> emitted when the backslash is followed
by actual whitespace (that C<qw> splits on).

=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 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.
(L<video link|https://www.youtube.com/watch?v=CwX4Xsf5y5E>)
It gained renewed interest this month,
leading to an uptick in test submissions from new authors,
for which we are extremely grateful.

=back

=head1 Platform Support

=head2 Platform-Specific Notes

=over 4

=item Win32

Fix builds with C<USE_IMP_SYS> defined but C<USE_ITHREADS> not
defined.

=back

=head1 Internal Changes

=over 4

=item *

Removed the deprecated (since 5.32) functions C<sv_locking()> and
C<sv_unlocking>.

=item *

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

=item *

C<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 C<Perl_expected_size>, compared against the current
buffer size, and does not try to do a reallocation if the requested
memory saving is unrealistic.

=item *

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

=item *

For core Perl maintainers, the syntax of F<embed.fnc> has been extended.
Every function, C<foo()>, named in this file has generated for it a
macro named C<PERL_ARGS_ASSERT_FOO>.  The macro expands to C<assert()>
calls that do basic sanity checking for each argument to C<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
C<assert()> statements yourself to F<embed.fnc> that will be
incorporated into the generated macro, beyond the system-generated ones.
Comments and examples in F<embed.fnc> give details.

=back

=head1 Selected Bug Fixes

=over 4

=item *

Certain constructs involving a two-variable C<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.  [L<GH #23405|https://github.com/Perl/perl5/issues/23405>]

=item *

Several error conditions in the C<pack> and C<unpack> operations were
not detected and now are.

=back

=head1 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 F<AUTHORS> 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<https://github.com/Perl/perl5/issues>. There may also be information at
L<https://www.perl.org/>, the Perl Home Page.

If you believe you have an unreported bug, please open an issue at
L<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
L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION>
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<perlthanks> program:

    perlthanks

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

=head1 SEE ALSO

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

The F<INSTALL> file for how to build Perl.

The F<README> file for general stuff.

The F<Artistic> and F<Copying> files for copyright information.

=cut
