5 perl5359delta - what is new for perl v5.35.9
9 This document describes differences between the 5.35.8 release and the 5.35.9
12 If you are upgrading from an earlier release such as 5.35.7, first read
13 L<perl5358delta>, which describes differences between 5.35.7 and 5.35.8.
15 =head1 Core Enhancements
17 =head2 Subroutine signatures are no longer experimental
19 Introduced in Perl version 5.20.0, and modified several times since, the
20 subroutine signatures feature (C<use feature 'signatures'>) is now no longer
21 considered experimental. It is now considered a stable language feature and
22 is included in the C<:5.36> feature bundle, enabled automatically by
23 C<use v5.36>, and no longer prints a warning.
31 Despite this, certain elements of signatured subroutines remain
32 experimental; see below.
34 =head2 @_ is now experimental within signatured subs
36 Even though subroutine signatures are now stable, use of the default arguments
37 array (C<@_>) with a subroutine that has a signature remains experimental,
38 with its own warning category. Silencing the C<experimental::signatures>
39 warning category is not sufficient to dismiss this. The new warning is
40 emitted with the category name C<experimental::args_array_with_signatures>.
42 Any subroutine that has a signature and tries to make use of the defaults
43 argument array or an element thereof (C<@_> or C<$_[INDEX]>), either
44 explicitly or implicitly (such as C<shift> or C<pop> with no argument) will
45 provoke a warning at compile-time:
49 sub f ($x, $y = 123) {
50 say "The first argument is $_[0]";
55 Use of @_ in array element with signatured subroutine is experimental
58 The behaviour of code which attempts to do this is no longer specified, and
59 may be subject to change in a future version.
61 =head2 The C<isa> operator is no longer experimental
63 Introduced in Perl version 5.32.0, this operator has remained unchanged
64 since then. The operator is now considered a stable language feature and is
65 included in the C<:5.36> feature bundle, enabled automatically by
68 For more detail see L<perlop/Class Instance Operator>.
70 =head2 -g command-line flag
72 A new command-line flag, -g, is available. It is a simpler alias for -0777.
74 For more information, see L<perlrun/-g>.
78 =head2 Downgrading a C<use VERSION> statement to below v5.11
80 Attempting to issue a second C<use VERSION> statement that requests a version
81 lower than C<v5.11> when an earlier statement that requested a version at
82 least C<v5.11> has already been seen, will now print a deprecation warning.
87 say "The say statement is permitted";
88 use v5.8; # This will print a warning
89 print "We must use print\n";
91 This is because of an intended related change to the interaction between
92 C<use VERSION> and C<use strict>. If you specify a version >= 5.11, strict is
93 enabled implicitly. If you request a version < 5.11, strict will become
94 disabled I<even if you had previously written> C<use strict>. This was not
95 the previous behaviour of C<use VERSION>, which at present will track
96 explicitly-enabled strictness flags independently.
98 Code which wishes to mix versions in this manner should use lexical scoping
99 with block syntax to ensure that the differently versioned regions remain
104 say "The say statement is permitted";
107 use v5.8; # No warning is emitted
108 print "We must use print\n";
111 =head1 Modules and Pragmata
113 =head2 Updated Modules and Pragmata
119 L<B::Deparse> has been upgraded from version 1.61 to 1.62.
123 L<charnames> has been upgraded from version 1.49 to 1.50.
127 L<CPAN> has been upgraded from version 2.29 to 2.33.
131 L<Devel::PPPort> has been upgraded from version 3.63 to 3.64.
135 L<experimental> has been upgraded from version 0.025 to 0.027.
139 L<feature> has been upgraded from version 1.69 to 1.70.
143 L<File::Copy> has been upgraded from version 2.38 to 2.39.
147 L<Hash::Util> has been upgraded from version 0.27 to 0.28.
151 L<Hash::Util::FieldHash> has been upgraded from version 1.25 to 1.26.
155 L<Module::CoreList> has been upgraded from version 5.20220120 to 5.20220220.
159 L<Opcode> has been upgraded from version 1.55 to 1.56.
163 L<overload> has been upgraded from version 1.34 to 1.35.
167 L<re> has been upgraded from version 0.41 to 0.42.
171 L<Scalar::Util> has been upgraded from version 1.60 to 1.61.
175 L<sigtrap> has been upgraded from version 1.09 to 1.10.
179 L<Tie::SubstrHash> has been upgraded from version 1.00 to 1.01.
183 L<warnings> has been upgraded from version 1.56 to 1.57.
187 L<XS::APItest> has been upgraded from version 1.20 to 1.21.
193 =head2 New Diagnostics
201 L<Built-in function '%s' is experimental|perldiag/"Built-in function '%s' is experimental">
203 A call is being made to a function in the
204 C<builtin::> namespace, which is currently experimental.
208 L<Implicit use of @_ in %s with signatured subroutine is experimental|perldiag/"Implicit use of @_ in %s with signatured subroutine is experimental">
210 An expression that implicitly involves the C<@_> arguments array was found in
211 a subroutine that uses a signature.
215 L<Use of @_ in %s with signatured subroutine is experimental|perldiag/"Use of @_ in %s with signatured subroutine is experimental">
217 An expression involving the C<@_> arguments array was found in a subroutine that uses a signature.
221 L<Downgrading a use VERSION declaration to below v5.11 is deprecated|perldiag/"Downgrading a use VERSION declaration to below v5.11 is deprecated">
223 This warning is emitted on a C<use VERSION> statement that
224 requests a version below v5.11 (when the effects of C<use strict> would be
225 disabled), after a previous declaration of one having a larger number (which
226 would have enabled these effects)
230 =head2 Changes to Existing Diagnostics
236 L<Subroutine %s redefined|perldiag/"Subroutine %s redefined">
238 Localized subroutine redefinitions no longer trigger this warning.
242 =head1 Internal Changes
248 New equality-test functions C<sv_numeq> and C<sv_streq> have been added, along
249 with C<..._flags>-suffixed variants. These expose a simple and consistent API
250 to perform numerical or string comparison which is aware of operator
255 Reading the string form of an integer value no longer sets the flag C<SVf_POK>.
256 The string form is still cached internally, and still re-read directly by the
257 macros C<SvPV(sv)> I<etc> (inline, without calling a C function). XS code that
258 already calls the APIs to get values will not be affected by this change. XS
259 code that accesses flags directly instead of using API calls to express its
260 intent I<might> break, but such code likely is already buggy if passed some
261 other values, such as floating point values or objects with string overloading.
263 This small change permits code (such as JSON serializers) to reliably determine
270 a value that was initially B<written> as an integer, but then B<read> as a string
273 print "The answer is $answer\n";
277 that same value that was initially B<written> as a string, but then B<read> as an integer
280 print "That doesn't look right\n"
281 unless $answer == 6 * 9;
285 For the first case (originally written as an integer), we now have:
290 my $void = "$answer";
295 SV = IV(0x562538925778) at 0x562538925788
300 SV = PVIV(0x5625389263c0) at 0x562538925788
302 FLAGS = (IOK,pIOK,pPOK)
304 PV = 0x562538919b50 "42"\0
308 For the second (originally written as a string), we now have:
313 my $void = $answer == 6 * 9;
318 SV = PV(0x5586ffe9bfb0) at 0x5586ffec0788
320 FLAGS = (POK,IsCOW,pPOK)
321 PV = 0x5586ffee7fd0 "42"\0
326 SV = PVIV(0x5586ffec13c0) at 0x5586ffec0788
328 FLAGS = (IOK,POK,IsCOW,pIOK,pPOK)
330 PV = 0x5586ffee7fd0 "42"\0
335 (One can't rely on the presence or absence of the flag C<SVf_IsCOW> to
336 determine the history of operations on a scalar.)
338 Previously both cases would be indistinguishable, with all 4 flags set:
340 SV = PVIV(0x55d4d62edaf0) at 0x55d4d62f0930
342 FLAGS = (IOK,POK,pIOK,pPOK)
344 PV = 0x55d4d62e1740 "42"\0
348 (and possibly C<SVf_IsCOW>, but not always)
350 This now means that if XS code I<really> needs to determine which form a value
351 was first written as, it should implement logic roughly
353 if (flags & SVf_IOK|SVf_NOK) && !(flags & SVf_POK)
355 else if (flags & SVf_POK)
358 the existing guesswork ...
360 Note that this doesn't cover "dualvars" - scalars that report different
361 values when asked for their string form or number form (such as C<$!>).
362 Most serialization formats cannot represent such duplicity.
364 I<The existing guesswork> remains because as well as dualvars, values might
365 be C<undef>, references, overloaded references, typeglobs and other things that
366 Perl itself can represent but do not map one-to-one into external formats, so
367 need some amount of approximation or encapsulation.
371 Memory for hash iterator state (C<struct xpvhv_aux>) is now allocated as part
372 of the hash body, instead of as part of the block of memory allocated for the
375 Nothing else changes - memory for this structure is still allocated only when
376 needed, is still accessed via the C<HvAUX()> macro, and the macro should only
377 be called when C<SvOOK()> is true. Hashes are still always of type C<SVt_PVHV>,
378 hash bodies are still allocated from arenas, and the address of the hash
379 doesn't change, because the address is the pointer to the head structure, which
382 Internally, a second arena (the arena with index 1) is used to allocate larger
383 bodies with space for C<struct xpvhv_aux>, the body "upgraded", and the "head"
384 structure updated to reflect this (much the same way that the bodies of scalars
385 are upgraded). We already re-purpose arenas - arena with index 0 is used for
388 None of this affects documented public XS interfaces. The only code changes are
389 in F<hv.c> and F<sv.c>. As the rest of the core itself uses these macros but
390 needed no changes, likely no code on CPAN will be affected either.
394 =head1 Acknowledgements
396 Perl 5.35.9 represents approximately 4 weeks of development since Perl
397 5.35.8 and contains approximately 8,700 lines of changes across 280 files
400 Excluding auto-generated files, documentation and release tools, there were
401 approximately 3,000 lines of changes to 110 .pm, .t, .c and .h files.
403 Perl continues to flourish into its fourth decade thanks to a vibrant
404 community of users and developers. The following people are known to have
405 contributed the improvements that became Perl 5.35.9:
407 Branislav ZahradnĂk, Christopher Yeleighton, Dagfinn Ilmari MannsĂ„ker,
408 Dave Cross, David Cantrell, Hugo van der Sanden, James E Keenan, James
409 Raspass, Karl Williamson, Leon Timmermans, Max Maischein, Michiel Beijen,
410 Nicholas Clark, Nicolas R., Paul Evans, Renee Baecker, Ricardo Signes,
411 Sergey Zhmylove, TAKAI Kousuke, Tomasz Konojacki, Tony Cook, Yves Orton.
413 The list above is almost certainly incomplete as it is automatically
414 generated from version control history. In particular, it does not include
415 the names of the (very much appreciated) contributors who reported issues to
416 the Perl bug tracker.
418 Many of the changes included in this version originated in the CPAN modules
419 included in Perl's core. We're grateful to the entire CPAN community for
420 helping Perl to flourish.
422 For a more complete list of all of Perl's historical contributors, please
423 see the F<AUTHORS> file in the Perl source distribution.
425 =head1 Reporting Bugs
427 If you find what you think is a bug, you might check the perl bug database
428 at L<https://github.com/Perl/perl5/issues>. There may also be information at
429 L<http://www.perl.org/>, the Perl Home Page.
431 If you believe you have an unreported bug, please open an issue at
432 L<https://github.com/Perl/perl5/issues>. Be sure to trim your bug down to a
433 tiny but sufficient test case.
435 If the bug you are reporting has security implications which make it
436 inappropriate to send to a public issue tracker, then see
437 L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION>
438 for details of how to report the issue.
442 If you wish to thank the Perl 5 Porters for the work we had done in Perl 5,
443 you can do so by running the C<perlthanks> program:
447 This will send an email to the Perl 5 Porters list with your show of thanks.
451 The F<Changes> file for an explanation of how to view exhaustive details on
454 The F<INSTALL> file for how to build Perl.
456 The F<README> file for general stuff.
458 The F<Artistic> and F<Copying> files for copyright information.