=encoding utf8

=head1 NAME

perl5438delta - what is new for perl v5.43.8

=head1 DESCRIPTION

This document describes differences between the 5.43.7 release and the 5.43.8
release.

If you are upgrading from an earlier release such as 5.43.6, first read
L<perl5437delta>, which describes differences between 5.43.6 and 5.43.7.

=head1 Core Enhancements

=head2 Multi-variable C<foreach> can now use aliased references

Perl version 5.22 introduced reference aliases, allowing a C<foreach> loop
iteration variable to create new aliases to references. Perl version 5.36
introduced C<foreach> 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.42;
    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<refaliasing> and C<declared_refs> features remain
B<experimental>.

=head2 New source of entropy for PRNG seeding

Perl now uses the C<getentropy()> system call to fetch random bytes suitable
for seeding the internal PRNG. Previously Perl would read raw bytes from the
F</dev/urandom> device. Perl now seeds itself in this order (and falls through
upon failure):

=over

=item 1.

C<getentropy()> on systems that support this call (Linux, BSD, MacOS)

=item 2.

F</dev/urandom> on systems that have it

=item 3.

Hash of internal state variables: Unix time, process ID, and pointer value

=back

=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<X> 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<Identifier_Status> and
C<Identifier_Type>.  L<https://www.unicode.org/reports/tr39/>.  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<XID_Start>
and C<XID_Continue> 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<XID> 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 as
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<C<use utf8>|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

=head2 C<m/...[...].../xx> 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</xx> 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

=head1 Modules and Pragmata

=head2 Updated Modules and Pragmata

=over 4

=item *

L<B::Concise> has been upgraded from version 1.010 to 1.011.

=item *

L<B::Deparse> has been upgraded from version 1.88 to 1.89.

=item *

L<Compress::Raw::Bzip2> has been upgraded from version 2.214 to 2.217.

=item *

L<Compress::Raw::Zlib> has been upgraded from version 2.214 to 2.218.

=item *

L<Config::Perl::V> has been upgraded from version 0.38 to 0.39.

=item *

L<CPAN::Meta> has been upgraded from version 2.150010 to 2.150012.

=item *

L<DB_File> has been upgraded from version 1.859 to 1.860.

=item *

L<English> has been upgraded from version 1.11 to 1.12.

=item *

L<ExtUtils::ParseXS> has been upgraded from version 3.62 to 3.63.

=item *

L<ExtUtils::Typemaps> has been upgraded from version 3.62 to 3.63.

=item *

L<feature> has been upgraded from version 2.00 to 2.01.

=item *

L<IO::Compress> has been upgraded from version 2.214 to 2.217.

=item *

L<Module::CoreList> has been upgraded from version 5.20260119 to 5.20260220.

=item *

L<threads> has been upgraded from version 2.43 to 2.44.

=item *

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

=item *

L<Time::HiRes> has been upgraded from version 1.9779 to 1.9780.

=item *

L<warnings> has been upgraded from version 1.76 to 1.77.

=item *

L<XS::APItest> has been upgraded from version 1.48 to 1.49.

=item *

L<XS::Typemap> has been upgraded from version 0.20 to 0.21.

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

=head2 Changes to Existing Diagnostics

=over 4

=item *

Variables whose name started with C<^_> were incorrectly shown in
diagnostics with a literal C<Ctrl-_> (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<Use of uninitialized value ${^_FOO}>, instead of the earlier C<Use of
uninitialized value $FOO> (with a literal C<Ctrl-_> after the dollar
sign).

[L<GH #24135|https://github.com/Perl/perl5/issues/24135>]

=item *

Calling the C<import> method on a package with no C<import> method now
produces a regular warning rather than a deprecation warning or error.

Since Perl 5.39.1, calling C<import> 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<missing_import> and it is
enabled by default.

=back

=head1 Configuration and Compilation

=over 4

=item *

It is now possible to pass to F<Configure> 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<Configure> and
then run it on the target machine, and then pass the values it outputs
to F<Configure> on the other machine.  F<Porting/Glossary> has examples.
[L<GH #22992|https://github.com/Perl/perl5/issues/22992>]

=item *

The C<PERL_CREATE_GVSV> 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<GH #24177|https://github.com/Perl/perl5/issues/24177>]

=back

=head1 Testing

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

=over 4

=item *

When testing embedding, add a sanity check to ensure the C<libperl> we
link against matches the perl we are building.  [L<GH #22125|https://github.com/Perl/perl5/issues/22125>]

=back

=head1 Platform Support

=head2 Platform-Specific Notes

=over 4

=item OpenBSD

When testing embedding, ensure we link against the correct static
libperl. [L<GH #22125|https://github.com/Perl/perl5/issues/22125>]

=back

=head1 Internal Changes

=over 4

=item *

Fixed a bug in the L<perlapi/sv_numeq> API where values with numeric
("0+") overloading but not equality or numeric comparison overloading
would always be compared as floating point values.  This could lead to
large integers being reported as equal when they weren't.

=item *

Fixed a bug in L<perlapi/sv_numeq> where the C<SV_SKIP_OVERLOAD> flag
would skip operator overloading, but would still honor numeric ("0+")
overloading.

=item *

Added L<perlapi/sv_numne>, sv_numle, sv_numlt, sv_numge, sv_numgt and
L<perlapi/sv_numcmp> APIs that perform numeric comparison in the same
way perl does, including overloading.  Separate APIs for each
comparison are needed to invoke their corresponding overload when
needed.  Inspired by [L<GH #23918|https://github.com/Perl/perl5/issues/23918>]

This also extends the sv_numeq API to support C<SV_FORCE_OVERLOAD>.

=item *

Added the C<AMGf_force_scalar> flag to the L<perlapi/C<amagic_call>>
API to force scalar context for overload calls.

=item *

Added the C<AMGf_force_overload> flag to the L<perlapi/C<amagic_call>>
API to allow forcing overloading to be honored even in the context of
C<no overloading;>.

=item *

The C<SvFLAGS> bits used by C<SvPCS_IMPORTED()> and C<SvOOK()> have now been
merged into the same position, thus freeing up a flags bit for possible future
purposes. This merge is distinguished by the fact that the C<PCS_IMPORTED>
behaviour is only used on references (when C<SvROK> is true), whereas the
C<OOK> only applies to string buffers (when C<SvROK> is false).

This change shouldn't affect any C<XS> module code that is using the test
macros correctly, though might cause confusion to code that attempts to analyse
C<SvFLAGS> bits directly outside of the helper macros.

=item *

An upper limit has been applied to the multiplier operand of the
repetition operator. Constant folding will not be attempted if the
operand is a numerical constant above C<PERL_FOLD_REPEAT_LIMIT>.
See [L<GH #20586|https://github.com/Perl/perl5/issues/20586>] and [L<GH #23561|https://github.com/Perl/perl5/issues/23561>] for background.

=back

=head1 Selected Bug Fixes

=over 4

=item *

sort() optimizes common comparisons from calling the OP tree for a
comparison block into a call to a C function.  The C function used for
overloaded numeric comparisons did not handle the case where there was
no comparison overload but there was a numeric ("0+") overload
correctly, losing precision for large overloaded integer arguments that
are not exactly representable as a Perl floating point value (NV).
[L<GH #23956|https://github.com/Perl/perl5/issues/23956>]

=item *

When a scalar variable used as the target of a filehandle is C<undef>'ed
while being output, garbage bytes would be left in that scalar.
[L<GH #24008|https://github.com/Perl/perl5/issues/24008>]

=over 4

=item *

Additionally, there was a case that would expose garbage bytes in the
target scalar or even trigger a segmentation fault when that scalar is
output on it (as in C<< open $fh, '>', \$str; print $fh $str; >>).
This is also fixed.  [L<GH #24199|https://github.com/Perl/perl5/issues/24199>]

=back

=item *

C<close(STDOUT)> when C<STDOUT> has been opened as a pipe will now
properly wait for the child to exit on Windows.  [L<GH #4106|https://github.com/Perl/perl5/issues/4106>]

=item *

Calling an XSUB via goto in scalar context, where the XSUB didn't return
exactly one value, could result in the return of the wrong number of
items, leading to potential stack corruption. For example:

    sub wrap { goto \&an_xsub_which_returns_no_values }
    $ret = wrap();

[L<GH #24212|https://github.com/Perl/perl5/issues/24212>]

=back

=head1 Acknowledgements

Perl 5.43.8 represents approximately 5 weeks of development since Perl
5.43.7 and contains approximately 56,000 lines of changes across 320 files
from 20 authors.

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

Craig A. Berry, David Mitchell, Graham Knop, H.Merijn Brand, James E Keenan,
James Raspass, Karl Williamson, Leon Timmermans, Lukas Mai, Max Maischein,
Paul Evans, Paul Marquess, Philippe Bruhat (BooK), Ricardo Signes, Richard
Leach, Scott Baker, Steve Hay, TAKAI Kousuke, Tomasz Konojacki, 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
