1PERL5360DELTA(1)       Perl Programmers Reference Guide       PERL5360DELTA(1)
2
3
4

NAME

6       perl5360delta - what is new for perl v5.36.0
7

DESCRIPTION

9       This document describes differences between the 5.34.0 release and the
10       5.36.0 release.
11

Core Enhancements

13   "use v5.36"
14       As always, "use v5.36" turns on the feature bundle for that version of
15       Perl.
16
17       The 5.36 bundle enables the "signatures" feature.  Introduced in Perl
18       version 5.20.0, and modified several times since, the subroutine
19       signatures feature is now no longer considered experimental. It is now
20       considered a stable language feature and no longer prints a warning.
21
22           use v5.36;
23
24           sub add ($x, $y) {
25             return $x + $y;
26           }
27
28       Despite this, certain elements of signatured subroutines remain
29       experimental; see below.
30
31       The 5.36 bundle enables the "isa" feature.  Introduced in Perl version
32       5.32.0, this operator has remained unchanged since then. The operator
33       is now considered a stable language feature.  For more detail see
34       "Class Instance Operator" in perlop.
35
36       The 5.36 bundle also disables the features "indirect", and
37       "multidimensional".  These will forbid, respectively: the use of
38       "indirect" method calls (like "$x = new Class;"); the use of a list
39       expression as a hash key to simulate sparse multidimensional arrays.
40       The specifics of these changes can be found in feature, but the short
41       version is: this is a bit like having more "use strict" turned on,
42       disabling features that cause more trouble than they're worth.
43
44       Furthermore, "use v5.36" will also enable warnings as if you'd written
45       "use warnings".
46
47       Finally, with this release, the experimental "switch" feature, present
48       in every feature bundle since they were introduced in v5.10, has been
49       removed from the v5.36 bundle.  If you want to use it (against our
50       advice), you'll have to enable it explicitly.
51
52   -g command-line flag
53       A new command-line flag, -g, is available. It is a simpler alias for
54       -0777.
55
56       For more information, see "-g" in perlrun.
57
58   Unicode 14.0 is supported
59       See <https://www.unicode.org/versions/Unicode14.0.0/> for details.
60
61   regex sets are no longer considered experimental
62       Prior to this release, the regex sets feature (officially named
63       "Extended Bracketed Character Classes") was considered experimental.
64       Introduced in Perl version 5.18.0, and modified several times since,
65       this is now considered a stable language feature and its use no longer
66       prints a warning.  See "Extended Bracketed Character Classes" in
67       perlrecharclass.
68
69   Variable length lookbehind is mostly no longer considered experimental
70       Prior to this release, any form of variable length lookbehind was
71       considered experimental. With this release the experimental status has
72       been reduced to cover only lookbehind that contains capturing
73       parenthesis.  This is because it is not clear if
74
75           "aaz"=~/(?=z)(?<=(a|aa))/
76
77       should match and leave $1 equaling "a" or "aa". Currently it will match
78       the longest possible alternative, "aa". While we are confident that the
79       overall construct will now match only when it should, we are not
80       confident that we will keep the current "longest match" behavior.
81
82   SIGFPE no longer deferred
83       Floating-point exceptions are now delivered immediately, in the same
84       way as other "fault"-like signals such as SIGSEGV. This means one has
85       at least a chance to catch such a signal with a $SIG{FPE} handler, e.g.
86       so that "die" can report the line in perl that triggered it.
87
88   Stable boolean tracking
89       The "true" and "false" boolean values, often accessed by constructions
90       like "!!0" and "!!1", as well as being returned from many core
91       functions and operators, now remember their boolean nature even through
92       assignment into variables. The new function is_bool() in builtin can
93       check whether a value has boolean nature.
94
95       This is likely to be useful when interoperating with other languages or
96       data-type serialisation, among other places.
97
98   iterating over multiple values at a time (experimental)
99       You can now iterate over multiple values at a time by specifying a list
100       of lexicals within parentheses. For example,
101
102           for my ($key, $value) (%hash) { ... }
103           for my ($left, $right, $gripping) (@moties) { ... }
104
105       Prior to perl v5.36, attempting to specify a list after "for my" was a
106       syntax error.
107
108       This feature is currently experimental and will cause a warning of
109       category "experimental::for_list".  For more detail see "Compound
110       Statements" in perlsyn.  See also "builtin::indexed" in this document,
111       which is a handy companion to n-at-a-time foreach.
112
113   builtin functions (experimental)
114       A new core module builtin has been added, which provides documentation
115       for new always-present functions that are built into the interpreter.
116
117           say "Reference type of arrays is ", builtin::reftype([]);
118
119       It also provides a lexical import mechanism for providing short name
120       versions of these functions.
121
122           use builtin 'reftype';
123           say "Reference type of arrays is ", reftype([]);
124
125       This builtin function mechanism and the functions it provides are all
126       currently experimental.  We expect that "builtin" itself will cease to
127       be experimental in the near future, but that individual functions in it
128       may become stable on an ongoing basis.  Other functions will be added
129       to "builtin" over time.
130
131       For details, see builtin, but here's a summary of builtin functions in
132       v5.36:
133
134       builtin::trim
135           This function treats its argument as a string, returning the result
136           of removing all white space at its beginning and ending.
137
138       builtin::indexed
139           This function returns a list twice as big as its argument list,
140           where each item is preceded by its index within that list. This is
141           primarily useful for using the new "foreach" syntax with multiple
142           iterator variables to iterate over an array or list, while also
143           tracking the index of each item:
144
145               use builtin 'indexed';
146
147               foreach my ($index, $val) (indexed @array) {
148                   ...
149               }
150
151       builtin::true, builtin::false, builtin::is_bool
152           "true" and "false" return boolean true and false values.  Perl is
153           still perl, and doesn't have strict typing of booleans, but these
154           values will be known to have been created as booleans.  "is_bool"
155           will tell you whether a value was known to have been created as a
156           boolean.
157
158       builtin::weaken, builtin::unweaken, builtin::is_weak
159           These functions will, respectively: weaken a reference; strengthen
160           a reference; and return whether a reference is weak.  (A weak
161           reference is not counted for garbage collection purposes.  See
162           perlref.)  These can take the place of some similar routines in
163           Scalar::Util.
164
165       builtin::blessed, builtin::refaddr, builtin::reftype
166           These functions provide more data about references (or non-
167           references, actually!) and can take the place of similar routines
168           found in Scalar::Util.
169
170       builtin::ceil, builtin::floor
171           "ceil" returns the smallest integer greater than or equal to its
172           argument.  "floor" returns the largest integer less than or equal
173           to its argument.  These can take the place of similar routines
174           found in POSIX.
175
176   "defer" blocks (experimental)
177       This release adds support for "defer" blocks, which are blocks of code
178       prefixed by the "defer" modifier. They provide a section of code which
179       runs at a later time, during scope exit.
180
181       In brief, when a "defer" block is reached at runtime, its body is set
182       aside to be run when the enclosing scope is exited.  It is unlike a
183       UNITCHECK (among other reasons) in that if the block containing the
184       "defer" block is exited before the block is reached, it will not be
185       run.
186
187       "defer" blocks can be used to take the place of "scope guard" objects
188       where an object is passed a code block to be run by its destructor.
189
190       For more information, see "defer blocks" in perlsyn.
191
192   try/catch can now have a "finally" block (experimental)
193       The experimental "try"/"catch" syntax has been extended to support an
194       optional third block introduced by the "finally" keyword.
195
196           try {
197               attempt();
198               print "Success\n";
199           }
200           catch ($e) {
201               print "Failure\n";
202           }
203           finally {
204               print "This happens regardless\n";
205           }
206
207       This provides code which runs at the end of the "try"/"catch"
208       construct, even if aborted by an exception or control-flow keyword.
209       They are similar to "defer" blocks.
210
211       For more information, see "Try Catch Exception Handling" in perlsyn.
212
213   non-ASCII delimiters for quote-like operators (experimental)
214       Perl traditionally has allowed just four pairs of string/pattern
215       delimiters: "( )" "{ }" "[ ]" and "< >", all in the ASCII range.
216       Unicode has hundreds more possibilities, and using this feature enables
217       many of them.  When enabled, you can say "qr« »" for example, or
218       "use utf8; q𝄃string𝄂".  See "The 'extra_paired_delimiters' feature" in
219       feature for details.
220
221   @_ is now experimental within signatured subs
222       Even though subroutine signatures are now stable, use of the legacy
223       arguments array (@_) with a subroutine that has a signature remains
224       experimental, with its own warning category.  Silencing the
225       "experimental::signatures" warning category is not sufficient to
226       dismiss this.  The new warning is emitted with the category name
227       "experimental::args_array_with_signatures".
228
229       Any subroutine that has a signature and tries to make use of the
230       defaults argument array or an element thereof (@_ or $_[INDEX]), either
231       explicitly or implicitly (such as "shift" or "pop" with no argument)
232       will provoke a warning at compile-time:
233
234           use v5.36;
235
236           sub f ($x, $y = 123) {
237             say "The first argument is $_[0]";
238           }
239
240           Use of @_ in array element with signatured subroutine is experimental
241           at file.pl line 4.
242
243       The behaviour of code which attempts to do this is no longer specified,
244       and may be subject to change in a future version.
245

Incompatible Changes

247   A physically empty sort is now a compile-time error
248           @a = sort @empty; # unaffected
249           @a = sort;        # now a compile-time error
250           @a = sort ();     # also a compile-time error
251
252       A bare sort used to be a weird way to create an empty list; now it
253       croaks at compile time. This change is intended to free up some of the
254       syntax space for possible future enhancements to "sort".
255

Deprecations

257   "use VERSION" (where VERSION is below v5.11) after "use v5.11" is
258       deprecated
259       When in the scope of "use v5.11" or later, a "use vX" line where X is
260       lower than v5.11 will now issue a warning:
261
262           Downgrading a use VERSION declaration to below v5.11 is deprecated
263
264       For example:
265
266           use v5.14;
267           say "The say statement is permitted";
268           use v5.8;                               # This will print a warning
269           print "We must use print\n";
270
271       This is because the Perl team plans to change the behavior in this
272       case.  Since Perl v5.12 (and parts of v5.11), strict is enabled unless
273       it had previously been disabled.  In other words:
274
275           no strict;
276           use v5.12;  # will not enable strict, because "no strict" preceded it
277           $x = 1;     # permitted, despite no "my" declaration
278
279       In the future, this behavior will be eliminated and "use VERSION" will
280       always enable strict for versions v5.12 and later.
281
282       Code which wishes to mix versions in this manner should use lexical
283       scoping with block syntax to ensure that the differently versioned
284       regions remain lexically isolated.
285
286           {
287               use v5.14;
288               say "The say statement is permitted";
289           }
290
291           {
292               use v5.8;                           # No warning is emitted
293               print "We must use print\n";
294           }
295
296       Of course, this is probably not something you ever need to do!  If the
297       first block compiles, it means you're using perl v5.14.0 or later.
298

Performance Enhancements

300       •   We now probe for compiler support for C11 thread local storage, and
301           where available use this for "implicit context" for XS extensions
302           making API calls for a threaded Perl build.  This requires fewer
303           function calls at the C level than POSIX thread specific storage.
304           We continue to use the pthreads approach if the C11 approach is not
305           available.
306
307           Configure run with the defaults will build an unthreaded Perl
308           (which is slightly faster), but most operating systems ship a
309           threaded Perl.
310
311       •   Perl can now be configured to no longer allocate keys for large
312           hashes from the shared string table.
313
314           The same internal datatype ("PVHV") is used for all of
315
316           •   Symbol tables
317
318           •   Objects (by default)
319
320           •   Associative arrays
321
322           The shared string table was originally added to improve performance
323           for blessed hashes used as objects, because every object instance
324           has the same keys, so it is an optimisation to share memory between
325           them. It also makes sense for symbol tables, where derived classes
326           will have the same keys (typically method names), and the OP trees
327           built for method calls can also share memory. The shared string
328           table behaves roughly like a cache for hash keys.
329
330           But for hashes actually used as associative arrays - mapping keys
331           to values - typically the keys are not re-used in other hashes. For
332           example, "seen" hashes are keyed by object IDs (or addresses), and
333           logically these keys won't repeat in other hashes.
334
335           Storing these "used just once" keys in the shared string table
336           increases CPU and RAM use for no gain. For such keys the shared
337           string table behaves as a cache with a 0% hit rate. Storing all the
338           keys there increases the total size of the shared string table, as
339           well as increasing the number of times it is resized as it grows.
340           Worse - in any environment that has "copy on write" memory for
341           child process (such as a pre-forking server), the memory pages used
342           for the shared string table rapidly need to be copied as the child
343           process manipulates hashes. Hence if most of the shared string
344           table is such that keys are used only in one place, there is no
345           benefit from re-use within the perl interpreter, but a high cost
346           due to more pages for the OS to copy.
347
348           The perl interpreter can now be Configured to disable shared hash
349           keys for "large" hashes (that are neither objects nor symbol
350           tables).  To do so, add
351           "-Accflags='-DPERL_USE_UNSHARED_KEYS_IN_LARGE_HASHES'" to your
352           Configure options.  "Large" is a heuristic -- currently the
353           heuristic is that sharing is disabled when adding a key to a hash
354           triggers allocation of more storage, and the hash has more than 42
355           keys.
356
357           This might cause slightly increased memory usage for programs that
358           create (unblessed) data structures that contain multiple large
359           hashes that share the same keys. But generally our testing suggests
360           that for the specific cases described it is a win, and other code
361           is unaffected.
362
363       •   In certain scenarios, creation of new scalars is now noticeably
364           faster.
365
366           For example, the following code is now executing ~30% faster:
367
368               $str = "A" x 64;
369               for (0..1_000_000) {
370                   @svs = split //, $str
371               }
372
373           (You can read more about this one in [perl #19414]
374           <https://github.com/Perl/perl5/pull/19414>.)
375

Modules and Pragmata

377   Updated Modules and Pragmata
378       •   Archive::Tar has been upgraded from version 2.38 to 2.40.
379
380       •   Attribute::Handlers has been upgraded from version 1.01 to 1.02.
381
382       •   attributes has been upgraded from version 0.33 to 0.34.
383
384       •   B has been upgraded from version 1.82 to 1.83.
385
386       •   B::Concise has been upgraded from version 1.004 to 1.006.
387
388       •   B::Deparse has been upgraded from version 1.56 to 1.64.
389
390       •   bignum has been upgraded from version 0.51 to 0.65.
391
392       •   charnames has been upgraded from version 1.48 to 1.50.
393
394       •   Compress::Raw::Bzip2 has been upgraded from version 2.101 to 2.103.
395
396       •   Compress::Raw::Zlib has been upgraded from version 2.101 to 2.105.
397
398       •   CPAN has been upgraded from version 2.28 to 2.33.
399
400       •   Data::Dumper has been upgraded from version 2.179 to 2.184.
401
402       •   DB_File has been upgraded from version 1.855 to 1.857.
403
404       •   Devel::Peek has been upgraded from version 1.30 to 1.32.
405
406       •   Devel::PPPort has been upgraded from version 3.62 to 3.68.
407
408       •   diagnostics has been upgraded from version 1.37 to 1.39.
409
410       •   Digest has been upgraded from version 1.19 to 1.20.
411
412       •   DynaLoader has been upgraded from version 1.50 to 1.52.
413
414       •   Encode has been upgraded from version 3.08 to 3.17.
415
416       •   Errno has been upgraded from version 1.33 to 1.36.
417
418       •   experimental has been upgraded from version 0.024 to 0.028.
419
420       •   Exporter has been upgraded from version 5.76 to 5.77.
421
422       •   ExtUtils::MakeMaker has been upgraded from version 7.62 to 7.64.
423
424       •   ExtUtils::Miniperl has been upgraded from version 1.10 to 1.11.
425
426       •   ExtUtils::ParseXS has been upgraded from version 3.43 to 3.45.
427
428       •   ExtUtils::Typemaps has been upgraded from version 3.43 to 3.45.
429
430       •   Fcntl has been upgraded from version 1.14 to 1.15.
431
432       •   feature has been upgraded from version 1.64 to 1.72.
433
434       •   File::Compare has been upgraded from version 1.1006 to 1.1007.
435
436       •   File::Copy has been upgraded from version 2.35 to 2.39.
437
438       •   File::Fetch has been upgraded from version 1.00 to 1.04.
439
440       •   File::Find has been upgraded from version 1.39 to 1.40.
441
442       •   File::Glob has been upgraded from version 1.33 to 1.37.
443
444       •   File::Spec has been upgraded from version 3.80 to 3.84.
445
446       •   File::stat has been upgraded from version 1.09 to 1.12.
447
448       •   FindBin has been upgraded from version 1.52 to 1.53.
449
450       •   GDBM_File has been upgraded from version 1.19 to 1.23.
451
452       •   Hash::Util has been upgraded from version 0.25 to 0.28.
453
454       •   Hash::Util::FieldHash has been upgraded from version 1.21 to 1.26.
455
456       •   HTTP::Tiny has been upgraded from version 0.076 to 0.080.
457
458       •   I18N::Langinfo has been upgraded from version 0.19 to 0.21.
459
460       •   if has been upgraded from version 0.0609 to 0.0610.
461
462       •   IO has been upgraded from version 1.46 to 1.50.
463
464       •   IO-Compress has been upgraded from version 2.102 to 2.106.
465
466       •   IPC::Open3 has been upgraded from version 1.21 to 1.22.
467
468       •   JSON::PP has been upgraded from version 4.06 to 4.07.
469
470       •   libnet has been upgraded from version 3.13 to 3.14.
471
472       •   Locale::Maketext has been upgraded from version 1.29 to 1.31.
473
474       •   Math::BigInt has been upgraded from version 1.999818 to 1.999830.
475
476       •   Math::BigInt::FastCalc has been upgraded from version 0.5009 to
477           0.5012.
478
479       •   Math::BigRat has been upgraded from version 0.2614 to 0.2621.
480
481       •   Module::CoreList has been upgraded from version 5.20210520 to
482           5.20220520.
483
484       •   mro has been upgraded from version 1.25_001 to 1.26.
485
486       •   NEXT has been upgraded from version 0.68 to 0.69.
487
488       •   Opcode has been upgraded from version 1.50 to 1.57.
489
490       •   open has been upgraded from version 1.12 to 1.13.
491
492       •   overload has been upgraded from version 1.33 to 1.35.
493
494       •   perlfaq has been upgraded from version 5.20210411 to 5.20210520.
495
496       •   PerlIO has been upgraded from version 1.11 to 1.12.
497
498       •   Pod::Functions has been upgraded from version 1.13 to 1.14.
499
500       •   Pod::Html has been upgraded from version 1.27 to 1.33.
501
502       •   Pod::Simple has been upgraded from version 3.42 to 3.43.
503
504       •   POSIX has been upgraded from version 1.97 to 2.03.
505
506       •   re has been upgraded from version 0.41 to 0.43.
507
508       •   Scalar::Util has been upgraded from version 1.55 to 1.62.
509
510       •   sigtrap has been upgraded from version 1.09 to 1.10.
511
512       •   Socket has been upgraded from version 2.031 to 2.033.
513
514       •   sort has been upgraded from version 2.04 to 2.05.
515
516       •   Storable has been upgraded from version 3.23 to 3.26.
517
518       •   Sys::Hostname has been upgraded from version 1.23 to 1.24.
519
520       •   Test::Harness has been upgraded from version 3.43 to 3.44.
521
522       •   Test::Simple has been upgraded from version 1.302183 to 1.302190.
523
524       •   Text::ParseWords has been upgraded from version 3.30 to 3.31.
525
526       •   Text::Tabs has been upgraded from version 2013.0523 to 2021.0814.
527
528       •   Text::Wrap has been upgraded from version 2013.0523 to 2021.0814.
529
530       •   threads has been upgraded from version 2.26 to 2.27.
531
532       •   threads::shared has been upgraded from version 1.62 to 1.64.
533
534       •   Tie::Handle has been upgraded from version 4.2 to 4.3.
535
536       •   Tie::Hash has been upgraded from version 1.05 to 1.06.
537
538       •   Tie::Scalar has been upgraded from version 1.05 to 1.06.
539
540       •   Tie::SubstrHash has been upgraded from version 1.00 to 1.01.
541
542       •   Time::HiRes has been upgraded from version 1.9767 to 1.9770.
543
544       •   Unicode::Collate has been upgraded from version 1.29 to 1.31.
545
546       •   Unicode::Normalize has been upgraded from version 1.28 to 1.31.
547
548       •   Unicode::UCD has been upgraded from version 0.75 to 0.78.
549
550       •   UNIVERSAL has been upgraded from version 1.13 to 1.14.
551
552       •   version has been upgraded from version 0.9928 to 0.9929.
553
554       •   VMS::Filespec has been upgraded from version 1.12 to 1.13.
555
556       •   VMS::Stdio has been upgraded from version 2.45 to 2.46.
557
558       •   warnings has been upgraded from version 1.51 to 1.58.
559
560       •   Win32 has been upgraded from version 0.57 to 0.59.
561
562       •   XS::APItest has been upgraded from version 1.16 to 1.22.
563
564       •   XS::Typemap has been upgraded from version 0.18 to 0.19.
565
566       •   XSLoader has been upgraded from version 0.30 to 0.31.
567

Documentation

569   New Documentation
570       Porting/vote_admin_guide.pod
571
572       This document provides the process for administering an election or
573       vote within the Perl Core Team.
574
575   Changes to Existing Documentation
576       We have attempted to update the documentation to reflect the changes
577       listed in this document.  If you find any we have missed, open an issue
578       at <https://github.com/Perl/perl5/issues>.
579
580       Additionally, the following selected changes have been made:
581
582       perlapi
583
584       •   This has been cleaned up some, and more than 80% of the (previously
585           many) undocumented functions have now either been documented or
586           deemed to have been inappropriately marked as API.
587
588           As always, Patches Welcome!
589
590       perldeprecation
591
592       •   notes the new location for functions moved from Pod::Html to
593           Pod::Html::Util that are no longer intended to be used outside of
594           core.
595
596       perlexperiment
597
598       •   notes the ":win32" IO pseudolayer is removed (this happened in
599           5.35.2).
600
601       perlgov
602
603       •   The election process has been finetuned to allow the vote to be
604           skipped if there are no more candidates than open seats.
605
606       •   A special election is now allowed to be postponed for up to twelve
607           weeks, for example until a normal election.
608
609       perlop
610
611       •   now notes that an invocant only needs to be an object or class name
612           for method calls, not for subroutine references.
613
614       perlre
615
616       •   Updated to discourage the use of the /d regexp modifier.
617
618       perlrun
619
620-? is now a synonym for -h
621
622-g is now a synonym for -0777
623

Diagnostics

625       The following additions or changes have been made to diagnostic output,
626       including warnings and fatal error messages.  For the complete list of
627       diagnostic messages, see perldiag.
628
629   New Diagnostics
630       New Errors
631
632       •   Can't "%s" out of a "defer" block
633
634           (F) An attempt was made to jump out of the scope of a defer block
635           by using a control-flow statement such as "return", "goto" or a
636           loop control. This is not permitted.
637
638       •   Can't modify %s in %s (for scalar assignment to "undef")
639
640           Attempting to perform a scalar assignment to "undef", for example
641           via "undef = $foo;", previously triggered a fatal runtime error
642           with the message "Modification of a read-only value attempted."  It
643           is more helpful to detect such attempted assignments prior to
644           runtime, so they are now compile time errors, resulting in the
645           message "Can't modify undef operator in scalar assignment".
646
647       •   panic: newFORLOOP, %s
648
649           The parser failed an internal consistency check while trying to
650           parse a "foreach" loop.
651
652       New Warnings
653
654       •   Built-in function '%s' is experimental
655
656           A call is being made to a function in the "builtin::" namespace,
657           which is currently experimental.
658
659       •   defer is experimental
660
661           The "defer" block modifier is experimental. If you want to use the
662           feature, disable the warning with "no warnings
663           'experimental::defer'", but know that in doing so you are taking
664           the risk that your code may break in a future Perl version.
665
666       •   Downgrading a use VERSION declaration to below v5.11 is deprecated
667
668           This warning is emitted on a "use VERSION" statement that requests
669           a version below v5.11 (when the effects of "use strict" would be
670           disabled), after a previous declaration of one having a larger
671           number (which would have enabled these effects)
672
673       •   for my (...) is experimental
674
675           This warning is emitted if you use "for" to iterate multiple values
676           at a time. This syntax is currently experimental and its behaviour
677           may change in future releases of Perl.
678
679       •   Implicit use of @_ in %s with signatured subroutine is experimental
680
681           An expression that implicitly involves the @_ arguments array was
682           found in a subroutine that uses a signature.
683
684       •   Use of @_ in %s with signatured subroutine is experimental
685
686           An expression involving the @_ arguments array was found in a
687           subroutine that uses a signature.
688
689       •   Wide character in $0
690
691           Attempts to put wide characters into the program name ($0) now
692           provoke this warning.
693
694   Changes to Existing Diagnostics
695       •   '/' does not take a repeat count in %s
696
697           This warning used to not include the "in %s".
698
699       •   Subroutine %s redefined
700
701           Localized subroutine redefinitions no longer trigger this warning.
702
703       •   unexpected constant lvalue entersub entry via type/targ %d:%d" now
704           has a panic prefix
705
706           This makes it consistent with other checks of internal consistency
707           when compiling a subroutine.
708
709       •   Useless use of sort in scalar context is now in the new "scalar"
710           category.
711
712           When "sort" is used in scalar context, it provokes a warning that
713           doing this is not useful. This warning used to be in the "void"
714           category. A new category for warnings about scalar context has now
715           been added, called "scalar".
716
717       •   Removed a number of diagnostics
718
719           Many diagnostics that have been removed from the perl core across
720           many years have now also been removed from the documentation.
721

Configuration and Compilation

723       •   The Perl C source code now uses some C99 features, which we have
724           verified are supported by all compilers we target. This means that
725           Perl's headers now contain some code that is legal in C99 but not
726           C89.
727
728           This may cause problems for some XS modules that unconditionally
729           add "-Werror=declaration-after-statement" to their C compiler flags
730           if compiling with gcc or clang. Earlier versions of Perl support
731           long obsolete compilers that are strict in rejecting certain C99
732           features, particularly mixed declarations and code, and hence it
733           makes sense for XS module authors to audit that their code does not
734           violate this. However, doing this is now only possible on these
735           earlier versions of Perl, hence these modules need to be changed to
736           only add this flag for "$] < 5.035005".
737
738       •   The makedepend step is now run in parallel by using make
739
740           When using MAKEFLAGS=-j8, this significantly reduces the time
741           required for:
742
743               sh ./makedepend MAKE=make cflags
744
745Configure now tests whether "#include <xlocale.h>" is required to
746           use the POSIX 1003 thread-safe locale functions or some related
747           extensions.  This prevents problems where a non-public xlocale.h is
748           removed in a library update, or xlocale.h isn't intended for public
749           use. (github #18936 <https://github.com/Perl/perl5/pull/18936>)
750

Testing

752       Tests were added and changed to reflect the other additions and changes
753       in this release.
754

Platform Support

756   Windows
757       •   Support for old MSVC++ (pre-VC12) has been removed
758
759           These did not support C99 and hence can no longer be used to
760           compile perl.
761
762       •   Support for compiling perl on Windows using Microsoft Visual Studio
763           2022 (containing Visual C++ 14.3) has been added.
764
765       •   The :win32 IO layer has been removed. This experimental replacement
766           for the :unix layer never reached maturity in its nearly two
767           decades of existence.
768
769   VMS
770       "keys %ENV" on VMS returns consistent results
771           On VMS entries in the %ENV hash are loaded from the OS environment
772           on first access, hence the first iteration of %ENV requires the
773           entire environment to be scanned to find all possible keys. This
774           initialisation had always been done correctly for full iteration,
775           but previously was not happening for %ENV in scalar context,
776           meaning that "scalar %ENV" would return 0 if called before any
777           other %ENV access, or would only return the count of keys accessed
778           if there had been no iteration.
779
780           These bugs are now fixed - %ENV and "keys %ENV" in scalar context
781           now return the correct result - the count of all keys in the
782           environment.
783
784   Discontinued Platforms
785       AT&T UWIN
786           UWIN is a UNIX compatibility layer for Windows.  It was last
787           released in 2012 and has been superseded by Cygwin these days.
788
789       DOS/DJGPP
790           DJGPP is a port of the GNU toolchain to 32-bit x86 systems running
791           DOS.  The last known attempt to build Perl on it was on 5.20, which
792           only got as far as building miniperl.
793
794       NetWare
795           Support code for Novell NetWare has been removed.  NetWare was a
796           server operating system by Novell.  The port was last updated in
797           July 2002, and the platform itself in May 2009.
798
799           Unrelated changes accidentally broke the build for the NetWare port
800           in September 2009, and in 12 years no-one has reported this.
801
802   Platform-Specific Notes
803       z/OS
804           This update enables us to build EBCDIC static/dynamic and
805           31-bit/64-bit addressing mode Perl. The number of tests that pass
806           is consistent with the baseline before these updates.
807
808           These changes also provide the base support to be able to provide
809           ASCII static/dynamic and 31-bit/64-bit addressing mode Perl.
810
811           The z/OS (previously called OS/390) README was updated to describe
812           ASCII and EBCDIC builds.
813

Internal Changes

815       •   Since the removal of PERL_OBJECT in Perl 5.8, PERL_IMPLICIT_CONTEXT
816           and MULTIPLICITY have been synonymous and they were being used
817           interchangeably.  To simplify the code, all instances of
818           PERL_IMPLICIT_CONTEXT have been replaced with MULTIPLICITY.
819
820           PERL_IMPLICIT_CONTEXT will remain defined for compatibility with XS
821           modules.
822
823       •   The API constant formerly named "G_ARRAY", indicating list context,
824           has now been renamed to a more accurate "G_LIST".  A compatibilty
825           macro "G_ARRAY" has been added to allow existing code to work
826           unaffected.  New code should be written using the new constant
827           instead.  This is supported by "Devel::PPPort" version 3.63.
828
829       •   Macros have been added to perl.h to facilitate version comparisons:
830           "PERL_GCC_VERSION_GE", "PERL_GCC_VERSION_GT", "PERL_GCC_VERSION_LE"
831           and "PERL_GCC_VERSION_LT".
832
833           Inline functions have been added to embed.h to determine the
834           position of the least significant 1 bit in a word: "lsbit_pos32"
835           and "lsbit_pos64".
836
837       •   "Perl_ptr_table_clear" has been deleted. This has been marked as
838           deprecated since v5.14.0 (released in 2011), and is not used by any
839           code on CPAN.
840
841       •   Added new boolean macros and functions. See "Stable boolean
842           tracking" for related information and perlapi for documentation.
843
844           •   sv_setbool
845
846           •   sv_setbool_mg
847
848           •   SvIsBOOL
849
850       •   Added 4 missing functions for dealing with RVs:
851
852           •   sv_setrv_noinc
853
854           •   sv_setrv_noinc_mg
855
856           •   sv_setrv_inc
857
858           •   sv_setrv_inc_mg
859
860       •   xs_handshake()'s two failure modes now provide distinct messages.
861
862       •   Memory for hash iterator state ("struct xpvhv_aux") is now
863           allocated as part of the hash body, instead of as part of the block
864           of memory allocated for the main hash array.
865
866       •   A new phase_name() interface provides access to the name for each
867           interpreter phase (i.e., PL_phase value).
868
869       •   The "pack" behavior of "U" has changed for EBCDIC.
870
871       •   New equality-test functions "sv_numeq" and "sv_streq" have been
872           added, along with "..._flags"-suffixed variants.  These expose a
873           simple and consistent API to perform numerical or string comparison
874           which is aware of operator overloading.
875
876       •   Reading the string form of an integer value no longer sets the flag
877           "SVf_POK".  The string form is still cached internally, and still
878           re-read directly by the macros SvPV(sv) etc (inline, without
879           calling a C function). XS code that already calls the APIs to get
880           values will not be affected by this change. XS code that accesses
881           flags directly instead of using API calls to express its intent
882           might break, but such code likely is already buggy if passed some
883           other values, such as floating point values or objects with string
884           overloading.
885
886           This small change permits code (such as JSON serializers) to
887           reliably determine between
888
889           •   a value that was initially written as an integer, but then read
890               as a string
891
892                   my $answer = 42;
893                   print "The answer is $answer\n";
894
895           •   that same value that was initially written as a string, but
896               then read as an integer
897
898                   my $answer = "42";
899                   print "That doesn't look right\n"
900                       unless $answer == 6 * 9;
901
902           For the first case (originally written as an integer), we now have:
903
904               use Devel::Peek;
905               my $answer = 42;
906               Dump ($answer);
907               my $void = "$answer";
908               print STDERR "\n";
909               Dump($answer)
910
911
912               SV = IV(0x562538925778) at 0x562538925788
913                 REFCNT = 1
914                 FLAGS = (IOK,pIOK)
915                 IV = 42
916
917               SV = PVIV(0x5625389263c0) at 0x562538925788
918                 REFCNT = 1
919                 FLAGS = (IOK,pIOK,pPOK)
920                 IV = 42
921                 PV = 0x562538919b50 "42"\0
922                 CUR = 2
923                 LEN = 10
924
925           For the second (originally written as a string), we now have:
926
927               use Devel::Peek;
928               my $answer = "42";
929               Dump ($answer);
930               my $void = $answer == 6 * 9;
931               print STDERR "\n";
932               Dump($answer)'
933
934
935               SV = PV(0x5586ffe9bfb0) at 0x5586ffec0788
936                 REFCNT = 1
937                 FLAGS = (POK,IsCOW,pPOK)
938                 PV = 0x5586ffee7fd0 "42"\0
939                 CUR = 2
940                 LEN = 10
941                 COW_REFCNT = 1
942
943               SV = PVIV(0x5586ffec13c0) at 0x5586ffec0788
944                 REFCNT = 1
945                 FLAGS = (IOK,POK,IsCOW,pIOK,pPOK)
946                 IV = 42
947                 PV = 0x5586ffee7fd0 "42"\0
948                 CUR = 2
949                 LEN = 10
950                 COW_REFCNT = 1
951
952           (One can't rely on the presence or absence of the flag "SVf_IsCOW"
953           to determine the history of operations on a scalar.)
954
955           Previously both cases would be indistinguishable, with all 4 flags
956           set:
957
958               SV = PVIV(0x55d4d62edaf0) at 0x55d4d62f0930
959                 REFCNT = 1
960                 FLAGS = (IOK,POK,pIOK,pPOK)
961                 IV = 42
962                 PV = 0x55d4d62e1740 "42"\0
963                 CUR = 2
964                 LEN = 10
965
966           (and possibly "SVf_IsCOW", but not always)
967
968           This now means that if XS code really needs to determine which form
969           a value was first written as, it should implement logic roughly
970
971               if (flags & SVf_IOK|SVf_NOK) && !(flags & SVf_POK)
972                   serialize as number
973               else if (flags & SVf_POK)
974                   serialize as string
975               else
976                   the existing guesswork ...
977
978           Note that this doesn't cover "dualvars" - scalars that report
979           different values when asked for their string form or number form
980           (such as $!).  Most serialization formats cannot represent such
981           duplicity.
982
983           The existing guesswork remains because as well as dualvars, values
984           might be "undef", references, overloaded references, typeglobs and
985           other things that Perl itself can represent but do not map one-to-
986           one into external formats, so need some amount of approximation or
987           encapsulation.
988
989       •   "sv_dump" (and Devel::Peek’s "Dump" function) now escapes high-bit
990           octets in the PV as hex rather than octal. Since most folks
991           understand hex more readily than octal, this should make these
992           dumps a bit more legible.  This does not affect any other
993           diagnostic interfaces like "pv_display".
994

Selected Bug Fixes

996utime() now correctly sets errno/$! when called on a closed handle.
997
998       •   The flags on the OPTVAL parameter to setsockopt() were previously
999           checked before magic was called, possibly treating a numeric value
1000           as a packed buffer or vice versa.  It also ignored the UTF-8 flag,
1001           potentially treating the internal representation of an upgraded SV
1002           as the bytes to supply to the setsockopt() system call.  (github
1003           #18660 <https://github.com/Perl/perl5/issues/18660>)
1004
1005       •   Only set IOKp, not IOK on $) and $(.  This was issue #18955
1006           <https://github.com/Perl/perl5/issues/18955>: This will prevent
1007           serializers from serializing these variables as numbers (which
1008           loses the additional groups).  This restores behaviour from 5.16
1009
1010       •   Use of the "mktables" debugging facility would cause perl to croak
1011           since v5.31.10; this problem has now been fixed.
1012
1013       •   "makedepend" logic is now compatible with BSD make (fixes GH #19046
1014           <https://github.com/Perl/perl5/issues/19046>).
1015
1016       •   Calling "untie" on a tied hash that is partway through iteration
1017           now frees the iteration state immediately.
1018
1019           Iterating a tied hash causes perl to store a copy of the current
1020           hash key to track the iteration state, with this stored copy passed
1021           as the second parameter to "NEXTKEY". This internal state is freed
1022           immediately when tie hash iteration completes, or if the hash is
1023           destroyed, but due to an implementation oversight, it was not freed
1024           if the hash was untied. In that case, the internal copy of the key
1025           would persist until the earliest of
1026
1027           1.  "tie" was called again on the same hash
1028
1029           2.  The (now untied) hash was iterated (ie passed to any of "keys",
1030               "values" or "each")
1031
1032           3.  The hash was destroyed.
1033
1034           This inconsistency is now fixed - the internal state is now freed
1035           immediately by "untie".
1036
1037           As the precise timing of this behaviour can be observed with pure
1038           Perl code (the timing of "DESTROY" on objects returned from
1039           "FIRSTKEY" and "NEXTKEY") it's just possible that some code is
1040           sensitive to it.
1041
1042       •   The Internals::getcwd() function added for bootstrapping miniperl
1043           in perl 5.30.0 is now only available in miniperl. [github #19122]
1044
1045       •   Setting a breakpoint on a BEGIN or equivalently a "use" statement
1046           could cause a memory write to a freed "dbstate" op.  [GH #19198
1047           <https://github.com/Perl/perl5/issues/19198>]
1048
1049       •   When bareword filehandles are disabled, the parser was interpreting
1050           any bareword as a filehandle, even when immediatey followed by
1051           parens.
1052

Errata From Previous Releases

1054       •   perl5300delta mistakenly identified a CVE whose correct
1055           identification is CVE-2015-1592.
1056

Obituaries

1058       Raun "Spider" Boardman (SPIDB on CPAN), author of at least 66 commits
1059       to the Perl 5 core distribution between 1996 and 2002, passed away May
1060       24, 2021 from complications of COVID.  He will be missed.
1061
1062       David H. Adler (DHA) passed away on November 16, 2021.  In 1997, David
1063       co-founded NY.pm, the first Perl user group, and in 1998 co-founded
1064       Perl Mongers to help establish other user groups across the globe.  He
1065       was a frequent attendee at Perl conferences in both North America and
1066       Europe and well known for his role in organizing Bad Movie Night
1067       celebrations at those conferences.  He also contributed to the work of
1068       the Perl Foundation, including administering the White Camel awards for
1069       community service.  He will be missed.
1070

Acknowledgements

1072       Perl 5.36.0 represents approximately a year of development since Perl
1073       5.34.0 and contains approximately 250,000 lines of changes across 2,000
1074       files from 82 authors.
1075
1076       Excluding auto-generated files, documentation and release tools, there
1077       were approximately 190,000 lines of changes to 1,300 .pm, .t, .c and .h
1078       files.
1079
1080       Perl continues to flourish into its fourth decade thanks to a vibrant
1081       community of users and developers. The following people are known to
1082       have contributed the improvements that became Perl 5.36.0:
1083
1084       Alyssa Ross, Andrew Fresh, Aristotle Pagaltzis, Asher Mancinelli,
1085       Atsushi Sugawara, Ben Cornett, Bernd, Biswapriyo Nath, Brad Barden,
1086       Bram, Branislav Zahradník, brian d foy, Chad Granum, Chris 'BinGOs'
1087       Williams, Christian Walde (Mithaldu), Christopher Yeleighton, Craig A.
1088       Berry, cuishuang, Curtis Poe, Dagfinn Ilmari Mannsåker, Dan Book,
1089       Daniel Laügt, Dan Jacobson, Dan Kogai, Dave Cross, Dave Lambley, David
1090       Cantrell, David Golden, David Marshall, David Mitchell, E. Choroba,
1091       Eugen Konkov, Felipe Gasper, François Perrad, Graham Knop, H.Merijn
1092       Brand, Hugo van der Sanden, Ilya Sashcheka, Ivan Panchenko, Jakub Wilk,
1093       James E Keenan, James Raspass, Karen Etheridge, Karl Williamson, Leam
1094       Hall, Leon Timmermans, Magnus Woldrich, Matthew Horsfall, Max
1095       Maischein, Michael G Schwern, Michiel Beijen, Mike Fulton, Neil Bowers,
1096       Nicholas Clark, Nicolas R, Niyas Sait, Olaf Alders, Paul Evans, Paul
1097       Marquess, Petar-Kaleychev, Pete Houston, Renee Baecker, Ricardo Signes,
1098       Richard Leach, Robert Rothenberg, Sawyer X, Scott Baker, Sergey
1099       Poznyakoff, Sergey Zhmylove, Sisyphus, Slaven Rezic, Steve Hay, Sven
1100       Kirmess, TAKAI Kousuke, Thibault Duponchelle, Todd Rinaldo, Tomasz
1101       Konojacki, Tomoyuki Sadahiro, Tony Cook, Unicode Consortium, Yves
1102       Orton, Михаил Козачков.
1103
1104       The list above is almost certainly incomplete as it is automatically
1105       generated from version control history. In particular, it does not
1106       include the names of the (very much appreciated) contributors who
1107       reported issues to the Perl bug tracker.
1108
1109       Many of the changes included in this version originated in the CPAN
1110       modules included in Perl's core. We're grateful to the entire CPAN
1111       community for helping Perl to flourish.
1112
1113       For a more complete list of all of Perl's historical contributors,
1114       please see the AUTHORS file in the Perl source distribution.
1115

Reporting Bugs

1117       If you find what you think is a bug, you might check the perl bug
1118       database at <https://github.com/Perl/perl5/issues>.  There may also be
1119       information at <http://www.perl.org/>, the Perl Home Page.
1120
1121       If you believe you have an unreported bug, please open an issue at
1122       <https://github.com/Perl/perl5/issues>.  Be sure to trim your bug down
1123       to a tiny but sufficient test case.
1124
1125       If the bug you are reporting has security implications which make it
1126       inappropriate to send to a public issue tracker, then see "SECURITY
1127       VULNERABILITY CONTACT INFORMATION" in perlsec for details of how to
1128       report the issue.
1129

Give Thanks

1131       If you wish to thank the Perl 5 Porters for the work we had done in
1132       Perl 5, you can do so by running the "perlthanks" program:
1133
1134           perlthanks
1135
1136       This will send an email to the Perl 5 Porters list with your show of
1137       thanks.
1138

SEE ALSO

1140       The Changes file for an explanation of how to view exhaustive details
1141       on what changed.
1142
1143       The INSTALL file for how to build Perl.
1144
1145       The README file for general stuff.
1146
1147       The Artistic and Copying files for copyright information.
1148
1149
1150
1151perl v5.38.2                      2023-11-30                  PERL5360DELTA(1)
Impressum