1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
|
.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "PERL5360DELTA 1"
.TH PERL5360DELTA 1 2024-01-25 "perl v5.38.2" "Perl Programmers Reference Guide"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
perl5360delta \- what is new for perl v5.36.0
.SH DESCRIPTION
.IX Header "DESCRIPTION"
This document describes differences between the 5.34.0 release and the 5.36.0
release.
.SH "Core Enhancements"
.IX Header "Core Enhancements"
.ie n .SS """use v5.36"""
.el .SS "\f(CWuse v5.36\fP"
.IX Subsection "use v5.36"
As always, \f(CW\*(C`use v5.36\*(C'\fR turns on the feature bundle for that version of Perl.
.PP
The 5.36 bundle enables the \f(CW\*(C`signatures\*(C'\fR feature. Introduced in Perl version
5.20.0, and modified several times since, the subroutine signatures feature is
now no longer considered experimental. It is now considered a stable language
feature and no longer prints a warning.
.PP
.Vb 1
\& use v5.36;
\&
\& sub add ($x, $y) {
\& return $x + $y;
\& }
.Ve
.PP
Despite this, certain elements of signatured subroutines remain experimental;
see below.
.PP
The 5.36 bundle enables the \f(CW\*(C`isa\*(C'\fR feature. Introduced in Perl version 5.32.0,
this operator has remained unchanged since then. The operator is now considered
a stable language feature. For more detail see "Class Instance
Operator" in perlop.
.PP
The 5.36 bundle also \fIdisables\fR the features \f(CW\*(C`indirect\*(C'\fR, and
\&\f(CW\*(C`multidimensional\*(C'\fR. These will forbid, respectively: the use of "indirect"
method calls (like \f(CW\*(C`$x = new Class;\*(C'\fR); the use of a list expression as a hash
key to simulate sparse multidimensional arrays. The specifics of these changes
can be found in feature, but the short version is: this is a bit like having
more \f(CW\*(C`use strict\*(C'\fR turned on, disabling features that cause more trouble than
they're worth.
.PP
Furthermore, \f(CW\*(C`use v5.36\*(C'\fR will also enable warnings as if you'd written \f(CW\*(C`use
warnings\*(C'\fR.
.PP
Finally, with this release, the experimental \f(CW\*(C`switch\*(C'\fR feature, present in
every feature bundle since they were introduced in v5.10, has been removed from
the v5.36 bundle. If you want to use it (against our advice), you'll have to
enable it explicitly.
.SS "\-g command-line flag"
.IX Subsection "-g command-line flag"
A new command-line flag, \-g, is available. It is a simpler alias for \-0777.
.PP
For more information, see "\-g" in perlrun.
.SS "Unicode 14.0 is supported"
.IX Subsection "Unicode 14.0 is supported"
See <https://www.unicode.org/versions/Unicode14.0.0/> for details.
.SS "regex sets are no longer considered experimental"
.IX Subsection "regex sets are no longer considered experimental"
Prior to this release, the regex sets feature (officially named
"Extended Bracketed Character Classes") was considered experimental.
Introduced in Perl version 5.18.0, and modified several times since,
this is now considered a stable language feature and its use no longer
prints a warning. See "Extended Bracketed Character
Classes" in perlrecharclass.
.SS "Variable length lookbehind is mostly no longer considered experimental"
.IX Subsection "Variable length lookbehind is mostly no longer considered experimental"
Prior to this release, any form of variable length lookbehind was
considered experimental. With this release the experimental status has
been reduced to cover only lookbehind that contains capturing parenthesis.
This is because it is not clear if
.PP
.Vb 1
\& "aaz"=~/(?=z)(?<=(a|aa))/
.Ve
.PP
should match and leave \f(CW$1\fR equaling "a" or "aa". Currently it will match
the longest possible alternative, "aa". While we are confident that the overall
construct will now match only when it should, we are not confident that we
will keep the current "longest match" behavior.
.SS "SIGFPE no longer deferred"
.IX Subsection "SIGFPE no longer deferred"
Floating-point exceptions are now delivered immediately, in the same way
as other "fault"\-like signals such as SIGSEGV. This means one has at
least a chance to catch such a signal with a \f(CW$SIG{FPE}\fR handler, e.g.
so that \f(CW\*(C`die\*(C'\fR can report the line in perl that triggered it.
.SS "Stable boolean tracking"
.IX Subsection "Stable boolean tracking"
The "true" and "false" boolean values, often accessed by constructions like
\&\f(CW\*(C`!!0\*(C'\fR and \f(CW\*(C`!!1\*(C'\fR, as well as being returned from many core functions and
operators, now remember their boolean nature even through assignment into
variables. The new function \f(CWis_bool()\fR in builtin can check whether
a value has boolean nature.
.PP
This is likely to be useful when interoperating with other languages or
data-type serialisation, among other places.
.SS "iterating over multiple values at a time (experimental)"
.IX Subsection "iterating over multiple values at a time (experimental)"
You can now iterate over multiple values at a time by specifying a list of
lexicals within parentheses. For example,
.PP
.Vb 2
\& for my ($key, $value) (%hash) { ... }
\& for my ($left, $right, $gripping) (@moties) { ... }
.Ve
.PP
Prior to perl v5.36, attempting to specify a list after \f(CW\*(C`for my\*(C'\fR was a syntax
error.
.PP
This feature is currently experimental and will cause a warning of category
\&\f(CW\*(C`experimental::for_list\*(C'\fR. For more detail see "Compound Statements" in perlsyn.
See also "builtin::indexed" in this document, which is a handy companion to
n\-at-a-time foreach.
.SS "builtin functions (experimental)"
.IX Subsection "builtin functions (experimental)"
A new core module builtin has been added, which provides documentation for
new always-present functions that are built into the interpreter.
.PP
.Vb 1
\& say "Reference type of arrays is ", builtin::reftype([]);
.Ve
.PP
It also provides a lexical import mechanism for providing short name versions
of these functions.
.PP
.Vb 2
\& use builtin \*(Aqreftype\*(Aq;
\& say "Reference type of arrays is ", reftype([]);
.Ve
.PP
This builtin function mechanism and the functions it provides are all
currently \fBexperimental\fR. We expect that \f(CW\*(C`builtin\*(C'\fR itself will cease to be
experimental in the near future, but that individual functions in it may become
stable on an ongoing basis. Other functions will be added to \f(CW\*(C`builtin\*(C'\fR over
time.
.PP
For details, see builtin, but here's a summary of builtin functions in
v5.36:
.IP builtin::trim 4
.IX Item "builtin::trim"
This function treats its argument as a string, returning the result of removing
all white space at its beginning and ending.
.IP builtin::indexed 4
.IX Item "builtin::indexed"
This function returns a list twice as big as its argument list, where each item
is preceded by its index within that list. This is primarily useful for using
the new \f(CW\*(C`foreach\*(C'\fR syntax with multiple iterator variables to iterate over an
array or list, while also tracking the index of each item:
.Sp
.Vb 1
\& use builtin \*(Aqindexed\*(Aq;
\&
\& foreach my ($index, $val) (indexed @array) {
\& ...
\& }
.Ve
.IP "builtin::true, builtin::false, builtin::is_bool" 4
.IX Item "builtin::true, builtin::false, builtin::is_bool"
\&\f(CW\*(C`true\*(C'\fR and \f(CW\*(C`false\*(C'\fR return boolean true and false values. Perl is still perl,
and doesn't have strict typing of booleans, but these values will be known to
have been created as booleans. \f(CW\*(C`is_bool\*(C'\fR will tell you whether a value was
known to have been created as a boolean.
.IP "builtin::weaken, builtin::unweaken, builtin::is_weak" 4
.IX Item "builtin::weaken, builtin::unweaken, builtin::is_weak"
These functions will, respectively: weaken a reference; strengthen a reference;
and return whether a reference is weak. (A weak reference is not counted for
garbage collection purposes. See perlref.) These can take the place of
some similar routines in Scalar::Util.
.IP "builtin::blessed, builtin::refaddr, builtin::reftype" 4
.IX Item "builtin::blessed, builtin::refaddr, builtin::reftype"
These functions provide more data about references (or non-references,
actually!) and can take the place of similar routines found in Scalar::Util.
.IP "builtin::ceil, builtin::floor" 4
.IX Item "builtin::ceil, builtin::floor"
\&\f(CW\*(C`ceil\*(C'\fR returns the smallest integer greater than or equal to its argument.
\&\f(CW\*(C`floor\*(C'\fR returns the largest integer less than or equal to its argument. These
can take the place of similar routines found in POSIX.
.ie n .SS """defer"" blocks (experimental)"
.el .SS "\f(CWdefer\fP blocks (experimental)"
.IX Subsection "defer blocks (experimental)"
This release adds support for \f(CW\*(C`defer\*(C'\fR blocks, which are blocks of code
prefixed by the \f(CW\*(C`defer\*(C'\fR modifier. They provide a section of code which runs
at a later time, during scope exit.
.PP
In brief, when a \f(CW\*(C`defer\*(C'\fR block is reached at runtime, its body is set aside to
be run when the enclosing scope is exited. It is unlike a UNITCHECK (among
other reasons) in that if the block \fIcontaining\fR the \f(CW\*(C`defer\*(C'\fR block is exited
before the block is reached, it will not be run.
.PP
\&\f(CW\*(C`defer\*(C'\fR blocks can be used to take the place of "scope guard" objects where an
object is passed a code block to be run by its destructor.
.PP
For more information, see "defer blocks" in perlsyn.
.ie n .SS "try/catch can now have a ""finally"" block (experimental)"
.el .SS "try/catch can now have a \f(CWfinally\fP block (experimental)"
.IX Subsection "try/catch can now have a finally block (experimental)"
The experimental \f(CW\*(C`try\*(C'\fR/\f(CW\*(C`catch\*(C'\fR syntax has been extended to support an
optional third block introduced by the \f(CW\*(C`finally\*(C'\fR keyword.
.PP
.Vb 10
\& try {
\& attempt();
\& print "Success\en";
\& }
\& catch ($e) {
\& print "Failure\en";
\& }
\& finally {
\& print "This happens regardless\en";
\& }
.Ve
.PP
This provides code which runs at the end of the \f(CW\*(C`try\*(C'\fR/\f(CW\*(C`catch\*(C'\fR construct,
even if aborted by an exception or control-flow keyword. They are similar
to \f(CW\*(C`defer\*(C'\fR blocks.
.PP
For more information, see "Try Catch Exception Handling" in perlsyn.
.SS "non-ASCII delimiters for quote-like operators (experimental)"
.IX Subsection "non-ASCII delimiters for quote-like operators (experimental)"
Perl traditionally has allowed just four pairs of string/pattern
delimiters: \f(CW\*(C`(\ )\*(C'\fR \f(CW\*(C`{\ }\*(C'\fR \f(CW\*(C`[\ ]\*(C'\fR and \f(CW\*(C`<\ >\*(C'\fR, all in the
ASCII range. Unicode has hundreds more possibilities, and using this
feature enables many of them. When enabled, you can say \f(CW\*(C`qr«\ »\*(C'\fR for
example, or \f(CW\*(C`use\ utf8;\ q𝄃string𝄂\*(C'\fR. See "The
\&'extra_paired_delimiters' feature" in feature for details.
.ie n .SS "@_ is now experimental within signatured subs"
.el .SS "\f(CW@_\fP is now experimental within signatured subs"
.IX Subsection "@_ is now experimental within signatured subs"
Even though subroutine signatures are now stable, use of the legacy arguments
array (\f(CW@_\fR) with a subroutine that has a signature \fIremains\fR experimental,
with its own warning category. Silencing the \f(CW\*(C`experimental::signatures\*(C'\fR
warning category is not sufficient to dismiss this. The new warning is emitted
with the category name \f(CW\*(C`experimental::args_array_with_signatures\*(C'\fR.
.PP
Any subroutine that has a signature and tries to make use of the defaults
argument array or an element thereof (\f(CW@_\fR or \f(CW$_[INDEX]\fR), either
explicitly or implicitly (such as \f(CW\*(C`shift\*(C'\fR or \f(CW\*(C`pop\*(C'\fR with no argument) will
provoke a warning at compile-time:
.PP
.Vb 1
\& use v5.36;
\&
\& sub f ($x, $y = 123) {
\& say "The first argument is $_[0]";
\& }
.Ve
.PP
.PP
.Vb 2
\& Use of @_ in array element with signatured subroutine is experimental
\& at file.pl line 4.
.Ve
.PP
The behaviour of code which attempts to do this is no longer specified, and
may be subject to change in a future version.
.SH "Incompatible Changes"
.IX Header "Incompatible Changes"
.SS "A physically empty sort is now a compile-time error"
.IX Subsection "A physically empty sort is now a compile-time error"
.Vb 3
\& @a = sort @empty; # unaffected
\& @a = sort; # now a compile\-time error
\& @a = sort (); # also a compile\-time error
.Ve
.PP
A bare sort used to be a weird way to create an empty list; now it croaks
at compile time. This change is intended to free up some of the syntax space
for possible future enhancements to \f(CW\*(C`sort\*(C'\fR.
.SH Deprecations
.IX Header "Deprecations"
.ie n .SS """use VERSION"" (where VERSION is below v5.11) after ""use v5.11"" is deprecated"
.el .SS "\f(CWuse VERSION\fP (where VERSION is below v5.11) after \f(CWuse v5.11\fP is deprecated"
.IX Subsection "use VERSION (where VERSION is below v5.11) after use v5.11 is deprecated"
When in the scope of \f(CW\*(C`use v5.11\*(C'\fR or later, a \f(CW\*(C`use vX\*(C'\fR line where \fIX\fR is
lower than v5.11 will now issue a warning:
.PP
.Vb 1
\& Downgrading a use VERSION declaration to below v5.11 is deprecated
.Ve
.PP
For example:
.PP
.Vb 4
\& use v5.14;
\& say "The say statement is permitted";
\& use v5.8; # This will print a warning
\& print "We must use print\en";
.Ve
.PP
This is because the Perl team plans to change the behavior in this case. Since
Perl v5.12 (and parts of v5.11), strict is enabled \fIunless it had previously
been disabled\fR. In other words:
.PP
.Vb 3
\& no strict;
\& use v5.12; # will not enable strict, because "no strict" preceded it
\& $x = 1; # permitted, despite no "my" declaration
.Ve
.PP
In the future, this behavior will be eliminated and \f(CW\*(C`use VERSION\*(C'\fR will
\&\fIalways\fR enable strict for versions v5.12 and later.
.PP
Code which wishes to mix versions in this manner should use lexical scoping
with block syntax to ensure that the differently versioned regions remain
lexically isolated.
.PP
.Vb 4
\& {
\& use v5.14;
\& say "The say statement is permitted";
\& }
\&
\& {
\& use v5.8; # No warning is emitted
\& print "We must use print\en";
\& }
.Ve
.PP
Of course, this is probably not something you ever need to do! If the first
block compiles, it means you're using perl v5.14.0 or later.
.SH "Performance Enhancements"
.IX Header "Performance Enhancements"
.IP \(bu 4
We now probe for compiler support for C11 thread local storage, and where
available use this for "implicit context" for XS extensions making API calls for
a threaded Perl build. This requires fewer function calls at the C level than
POSIX thread specific storage. We continue to use the pthreads approach if
the C11 approach is not available.
.Sp
\&\fIConfigure\fR run with the defaults will build an unthreaded Perl (which is
slightly faster), but most operating systems ship a threaded Perl.
.IP \(bu 4
Perl can now be configured to no longer allocate keys for large hashes
from the shared string table.
.Sp
The same internal datatype (\f(CW\*(C`PVHV\*(C'\fR) is used for all of
.RS 4
.IP \(bu 4
Symbol tables
.IP \(bu 4
Objects (by default)
.IP \(bu 4
Associative arrays
.RE
.RS 4
.Sp
The shared string table was originally added to improve performance for blessed
hashes used as objects, because every object instance has the same keys, so it
is an optimisation to share memory between them. It also makes sense for symbol
tables, where derived classes will have the same keys (typically method names),
and the OP trees built for method calls can also share memory. The shared
string table behaves roughly like a cache for hash keys.
.Sp
But for hashes actually used as associative arrays \- mapping keys to values \-
typically the keys are not re-used in other hashes. For example, "seen" hashes
are keyed by object IDs (or addresses), and logically these keys won't repeat
in other hashes.
.Sp
Storing these "used just once" keys in the shared string table increases CPU
and RAM use for no gain. For such keys the shared string table behaves as a
cache with a 0% hit rate. Storing all the keys there increases the total size
of the shared string table, as well as increasing the number of times it is
resized as it grows. \fBWorse\fR \- in any environment that has "copy on write"
memory for child process (such as a pre-forking server), the memory pages used
for the shared string table rapidly need to be copied as the child process
manipulates hashes. Hence if most of the shared string table is such that keys
are used only in one place, there is no benefit from re-use within the perl
interpreter, but a high cost due to more pages for the OS to copy.
.Sp
The perl interpreter can now be Configured to disable shared hash keys
for "large" hashes (that are neither objects nor symbol tables). To do
so, add \f(CW\*(C`\-Accflags=\*(Aq\-DPERL_USE_UNSHARED_KEYS_IN_LARGE_HASHES\*(Aq\*(C'\fR to
your \fIConfigure\fR options. "Large" is a heuristic \-\- currently the
heuristic is that sharing is disabled when adding a key to a hash
triggers allocation of more storage, and the hash has more than 42 keys.
.Sp
This \fBmight\fR cause slightly increased memory usage for programs that create
(unblessed) data structures that contain multiple large hashes that share the
same keys. But generally our testing suggests that for the specific cases
described it is a win, and other code is unaffected.
.RE
.IP \(bu 4
In certain scenarios, creation of new scalars is now noticeably faster.
.Sp
For example, the following code is now executing ~30% faster:
.Sp
.Vb 4
\& $str = "A" x 64;
\& for (0..1_000_000) {
\& @svs = split //, $str
\& }
.Ve
.Sp
(You can read more about this one in [perl
#19414] <https://github.com/Perl/perl5/pull/19414>.)
.SH "Modules and Pragmata"
.IX Header "Modules and Pragmata"
.SS "Updated Modules and Pragmata"
.IX Subsection "Updated Modules and Pragmata"
.IP \(bu 4
Archive::Tar has been upgraded from version 2.38 to 2.40.
.IP \(bu 4
Attribute::Handlers has been upgraded from version 1.01 to 1.02.
.IP \(bu 4
attributes has been upgraded from version 0.33 to 0.34.
.IP \(bu 4
B has been upgraded from version 1.82 to 1.83.
.IP \(bu 4
B::Concise has been upgraded from version 1.004 to 1.006.
.IP \(bu 4
B::Deparse has been upgraded from version 1.56 to 1.64.
.IP \(bu 4
bignum has been upgraded from version 0.51 to 0.65.
.IP \(bu 4
charnames has been upgraded from version 1.48 to 1.50.
.IP \(bu 4
Compress::Raw::Bzip2 has been upgraded from version 2.101 to 2.103.
.IP \(bu 4
Compress::Raw::Zlib has been upgraded from version 2.101 to 2.105.
.IP \(bu 4
CPAN has been upgraded from version 2.28 to 2.33.
.IP \(bu 4
Data::Dumper has been upgraded from version 2.179 to 2.184.
.IP \(bu 4
DB_File has been upgraded from version 1.855 to 1.857.
.IP \(bu 4
Devel::Peek has been upgraded from version 1.30 to 1.32.
.IP \(bu 4
Devel::PPPort has been upgraded from version 3.62 to 3.68.
.IP \(bu 4
diagnostics has been upgraded from version 1.37 to 1.39.
.IP \(bu 4
Digest has been upgraded from version 1.19 to 1.20.
.IP \(bu 4
DynaLoader has been upgraded from version 1.50 to 1.52.
.IP \(bu 4
Encode has been upgraded from version 3.08 to 3.17.
.IP \(bu 4
Errno has been upgraded from version 1.33 to 1.36.
.IP \(bu 4
experimental has been upgraded from version 0.024 to 0.028.
.IP \(bu 4
Exporter has been upgraded from version 5.76 to 5.77.
.IP \(bu 4
ExtUtils::MakeMaker has been upgraded from version 7.62 to 7.64.
.IP \(bu 4
ExtUtils::Miniperl has been upgraded from version 1.10 to 1.11.
.IP \(bu 4
ExtUtils::ParseXS has been upgraded from version 3.43 to 3.45.
.IP \(bu 4
ExtUtils::Typemaps has been upgraded from version 3.43 to 3.45.
.IP \(bu 4
Fcntl has been upgraded from version 1.14 to 1.15.
.IP \(bu 4
feature has been upgraded from version 1.64 to 1.72.
.IP \(bu 4
File::Compare has been upgraded from version 1.1006 to 1.1007.
.IP \(bu 4
File::Copy has been upgraded from version 2.35 to 2.39.
.IP \(bu 4
File::Fetch has been upgraded from version 1.00 to 1.04.
.IP \(bu 4
File::Find has been upgraded from version 1.39 to 1.40.
.IP \(bu 4
File::Glob has been upgraded from version 1.33 to 1.37.
.IP \(bu 4
File::Spec has been upgraded from version 3.80 to 3.84.
.IP \(bu 4
File::stat has been upgraded from version 1.09 to 1.12.
.IP \(bu 4
FindBin has been upgraded from version 1.52 to 1.53.
.IP \(bu 4
GDBM_File has been upgraded from version 1.19 to 1.23.
.IP \(bu 4
Hash::Util has been upgraded from version 0.25 to 0.28.
.IP \(bu 4
Hash::Util::FieldHash has been upgraded from version 1.21 to 1.26.
.IP \(bu 4
HTTP::Tiny has been upgraded from version 0.076 to 0.080.
.IP \(bu 4
I18N::Langinfo has been upgraded from version 0.19 to 0.21.
.IP \(bu 4
if has been upgraded from version 0.0609 to 0.0610.
.IP \(bu 4
IO has been upgraded from version 1.46 to 1.50.
.IP \(bu 4
IO-Compress has been upgraded from version 2.102 to 2.106.
.IP \(bu 4
IPC::Open3 has been upgraded from version 1.21 to 1.22.
.IP \(bu 4
JSON::PP has been upgraded from version 4.06 to 4.07.
.IP \(bu 4
libnet has been upgraded from version 3.13 to 3.14.
.IP \(bu 4
Locale::Maketext has been upgraded from version 1.29 to 1.31.
.IP \(bu 4
Math::BigInt has been upgraded from version 1.999818 to 1.999830.
.IP \(bu 4
Math::BigInt::FastCalc has been upgraded from version 0.5009 to 0.5012.
.IP \(bu 4
Math::BigRat has been upgraded from version 0.2614 to 0.2621.
.IP \(bu 4
Module::CoreList has been upgraded from version 5.20210520 to 5.20220520.
.IP \(bu 4
mro has been upgraded from version 1.25_001 to 1.26.
.IP \(bu 4
NEXT has been upgraded from version 0.68 to 0.69.
.IP \(bu 4
Opcode has been upgraded from version 1.50 to 1.57.
.IP \(bu 4
open has been upgraded from version 1.12 to 1.13.
.IP \(bu 4
overload has been upgraded from version 1.33 to 1.35.
.IP \(bu 4
perlfaq has been upgraded from version 5.20210411 to 5.20210520.
.IP \(bu 4
PerlIO has been upgraded from version 1.11 to 1.12.
.IP \(bu 4
Pod::Functions has been upgraded from version 1.13 to 1.14.
.IP \(bu 4
Pod::Html has been upgraded from version 1.27 to 1.33.
.IP \(bu 4
Pod::Simple has been upgraded from version 3.42 to 3.43.
.IP \(bu 4
POSIX has been upgraded from version 1.97 to 2.03.
.IP \(bu 4
re has been upgraded from version 0.41 to 0.43.
.IP \(bu 4
Scalar::Util has been upgraded from version 1.55 to 1.62.
.IP \(bu 4
sigtrap has been upgraded from version 1.09 to 1.10.
.IP \(bu 4
Socket has been upgraded from version 2.031 to 2.033.
.IP \(bu 4
sort has been upgraded from version 2.04 to 2.05.
.IP \(bu 4
Storable has been upgraded from version 3.23 to 3.26.
.IP \(bu 4
Sys::Hostname has been upgraded from version 1.23 to 1.24.
.IP \(bu 4
Test::Harness has been upgraded from version 3.43 to 3.44.
.IP \(bu 4
Test::Simple has been upgraded from version 1.302183 to 1.302190.
.IP \(bu 4
Text::ParseWords has been upgraded from version 3.30 to 3.31.
.IP \(bu 4
Text::Tabs has been upgraded from version 2013.0523 to 2021.0814.
.IP \(bu 4
Text::Wrap has been upgraded from version 2013.0523 to 2021.0814.
.IP \(bu 4
threads has been upgraded from version 2.26 to 2.27.
.IP \(bu 4
threads::shared has been upgraded from version 1.62 to 1.64.
.IP \(bu 4
Tie::Handle has been upgraded from version 4.2 to 4.3.
.IP \(bu 4
Tie::Hash has been upgraded from version 1.05 to 1.06.
.IP \(bu 4
Tie::Scalar has been upgraded from version 1.05 to 1.06.
.IP \(bu 4
Tie::SubstrHash has been upgraded from version 1.00 to 1.01.
.IP \(bu 4
Time::HiRes has been upgraded from version 1.9767 to 1.9770.
.IP \(bu 4
Unicode::Collate has been upgraded from version 1.29 to 1.31.
.IP \(bu 4
Unicode::Normalize has been upgraded from version 1.28 to 1.31.
.IP \(bu 4
Unicode::UCD has been upgraded from version 0.75 to 0.78.
.IP \(bu 4
UNIVERSAL has been upgraded from version 1.13 to 1.14.
.IP \(bu 4
version has been upgraded from version 0.9928 to 0.9929.
.IP \(bu 4
VMS::Filespec has been upgraded from version 1.12 to 1.13.
.IP \(bu 4
VMS::Stdio has been upgraded from version 2.45 to 2.46.
.IP \(bu 4
warnings has been upgraded from version 1.51 to 1.58.
.IP \(bu 4
Win32 has been upgraded from version 0.57 to 0.59.
.IP \(bu 4
XS::APItest has been upgraded from version 1.16 to 1.22.
.IP \(bu 4
XS::Typemap has been upgraded from version 0.18 to 0.19.
.IP \(bu 4
XSLoader has been upgraded from version 0.30 to 0.31.
.SH Documentation
.IX Header "Documentation"
.SS "New Documentation"
.IX Subsection "New Documentation"
\fIPorting/vote_admin_guide.pod\fR
.IX Subsection "Porting/vote_admin_guide.pod"
.PP
This document provides the process for administering an election or vote
within the Perl Core Team.
.SS "Changes to Existing Documentation"
.IX Subsection "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>.
.PP
Additionally, the following selected changes have been made:
.PP
\fIperlapi\fR
.IX Subsection "perlapi"
.IP \(bu 4
This has been cleaned up some, and more than 80% of the (previously
many) undocumented functions have now either been documented or deemed
to have been inappropriately marked as API.
.Sp
As always, Patches Welcome!
.PP
\fIperldeprecation\fR
.IX Subsection "perldeprecation"
.IP \(bu 4
notes the new location for functions moved from Pod::Html to
Pod::Html::Util that are no longer intended to be used outside of core.
.PP
\fIperlexperiment\fR
.IX Subsection "perlexperiment"
.IP \(bu 4
notes the \f(CW\*(C`:win32\*(C'\fR IO pseudolayer is removed (this happened in 5.35.2).
.PP
\fIperlgov\fR
.IX Subsection "perlgov"
.IP \(bu 4
The election process has been finetuned to allow the vote to be skipped if there
are no more candidates than open seats.
.IP \(bu 4
A special election is now allowed to be postponed for up to twelve weeks, for
example until a normal election.
.PP
\fIperlop\fR
.IX Subsection "perlop"
.IP \(bu 4
now notes that an invocant only needs to be an object or class name
for method calls, not for subroutine references.
.PP
\fIperlre\fR
.IX Subsection "perlre"
.IP \(bu 4
Updated to discourage the use of the /d regexp modifier.
.PP
\fIperlrun\fR
.IX Subsection "perlrun"
.IP \(bu 4
\&\fB\-?\fR is now a synonym for \fB\-h\fR
.IP \(bu 4
\&\fB\-g\fR is now a synonym for \fB\-0777\fR
.SH Diagnostics
.IX Header "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.
.SS "New Diagnostics"
.IX Subsection "New Diagnostics"
\fINew Errors\fR
.IX Subsection "New Errors"
.IP \(bu 4
Can't "%s" out of a "defer" block
.Sp
(F) An attempt was made to jump out of the scope of a defer block by using
a control-flow statement such as \f(CW\*(C`return\*(C'\fR, \f(CW\*(C`goto\*(C'\fR or a loop control. This is
not permitted.
.IP \(bu 4
Can't modify \f(CW%s\fR in \f(CW%s\fR (for scalar
assignment to \f(CW\*(C`undef\*(C'\fR)
.Sp
Attempting to perform a scalar assignment to \f(CW\*(C`undef\*(C'\fR, for example via
\&\f(CW\*(C`undef = $foo;\*(C'\fR, previously triggered a fatal runtime error with the
message "Modification of a read-only value attempted."
It is more helpful to detect such attempted assignments prior to runtime, so
they are now compile time errors, resulting in the message "Can't modify undef
operator in scalar assignment".
.IP \(bu 4
panic: newFORLOOP, \f(CW%s\fR
.Sp
The parser failed an internal consistency check while trying to parse
a \f(CW\*(C`foreach\*(C'\fR loop.
.PP
\fINew Warnings\fR
.IX Subsection "New Warnings"
.IP \(bu 4
Built-in function '%s' is experimental
.Sp
A call is being made to a function in the \f(CW\*(C`builtin::\*(C'\fR namespace, which is
currently experimental.
.IP \(bu 4
defer is experimental
.Sp
The \f(CW\*(C`defer\*(C'\fR block modifier is experimental. If you want to use the feature,
disable the warning with \f(CW\*(C`no warnings \*(Aqexperimental::defer\*(Aq\*(C'\fR, but know that in
doing so you are taking the risk that your code may break in a future Perl
version.
.IP \(bu 4
Downgrading a use VERSION declaration to below v5.11 is deprecated
.Sp
This warning is emitted on a \f(CW\*(C`use VERSION\*(C'\fR statement that
requests a version below v5.11 (when the effects of \f(CW\*(C`use strict\*(C'\fR would be
disabled), after a previous declaration of one having a larger number (which
would have enabled these effects)
.IP \(bu 4
for my (...) is experimental
.Sp
This warning is emitted if you use \f(CW\*(C`for\*(C'\fR to iterate multiple values at
a time. This syntax is currently experimental and its behaviour may
change in future releases of Perl.
.IP \(bu 4
Implicit use of \f(CW@_\fR in \f(CW%s\fR with signatured subroutine is experimental
.Sp
An expression that implicitly involves the \f(CW@_\fR arguments array was found in
a subroutine that uses a signature.
.IP \(bu 4
Use of \f(CW@_\fR in \f(CW%s\fR with signatured subroutine is experimental
.Sp
An expression involving the \f(CW@_\fR arguments array was found in a subroutine that uses a signature.
.IP \(bu 4
Wide character in \f(CW$0\fR
.Sp
Attempts to put wide characters into the program name (\f(CW$0\fR) now provoke this
warning.
.SS "Changes to Existing Diagnostics"
.IX Subsection "Changes to Existing Diagnostics"
.IP \(bu 4
\&'/' does not take a repeat count in \f(CW%s\fR
.Sp
This warning used to not include the \f(CW\*(C`in %s\*(C'\fR.
.IP \(bu 4
Subroutine \f(CW%s\fR redefined
.Sp
Localized subroutine redefinitions no longer trigger this warning.
.IP \(bu 4
unexpected constant lvalue entersub entry via type/targ \f(CW%d:\fR%d" now has a panic prefix
.Sp
This makes it consistent with other checks of internal consistency when
compiling a subroutine.
.IP \(bu 4
Useless use of sort in scalar context is now in the new \f(CW\*(C`scalar\*(C'\fR category.
.Sp
When \f(CW\*(C`sort\*(C'\fR is used in scalar context, it provokes a warning that doing this
is not useful. This warning used to be in the \f(CW\*(C`void\*(C'\fR category. A new category
for warnings about scalar context has now been added, called \f(CW\*(C`scalar\*(C'\fR.
.IP \(bu 4
Removed a number of diagnostics
.Sp
Many diagnostics that have been removed from the perl core across many years
have now \fIalso\fR been removed from the documentation.
.SH "Configuration and Compilation"
.IX Header "Configuration and Compilation"
.IP \(bu 4
The Perl C source code now uses some C99 features, which we have verified are
supported by all compilers we target. This means that Perl's headers now
contain some code that is legal in C99 but not C89.
.Sp
This may cause problems for some XS modules that unconditionally add
\&\f(CW\*(C`\-Werror=declaration\-after\-statement\*(C'\fR to their C compiler flags if compiling
with gcc or clang. Earlier versions of Perl support long obsolete compilers
that are strict in rejecting certain C99 features, particularly mixed
declarations and code, and hence it makes sense for XS module authors to audit
that their code does not violate this. However, doing this is now only
possible on these earlier versions of Perl, hence these modules need to be
changed to only add this flag for \f(CW\*(C`$] < 5.035005\*(C'\fR.
.IP \(bu 4
The makedepend step is now run in parallel by using make
.Sp
When using MAKEFLAGS=\-j8, this significantly reduces the time required for:
.Sp
.Vb 1
\& sh ./makedepend MAKE=make cflags
.Ve
.IP \(bu 4
\&\fIConfigure\fR now tests whether \f(CW\*(C`#include <xlocale.h>\*(C'\fR is required
to use the POSIX 1003 thread-safe locale functions or some related
extensions. This prevents problems where a non-public \fIxlocale.h\fR is
removed in a library update, or \fIxlocale.h\fR isn't intended for public
use. (github #18936 <https://github.com/Perl/perl5/pull/18936>)
.SH Testing
.IX Header "Testing"
Tests were added and changed to reflect the other additions and changes
in this release.
.SH "Platform Support"
.IX Header "Platform Support"
.SS Windows
.IX Subsection "Windows"
.IP \(bu 4
Support for old MSVC++ (pre\-VC12) has been removed
.Sp
These did not support C99 and hence can no longer be used to compile perl.
.IP \(bu 4
Support for compiling perl on Windows using Microsoft Visual Studio 2022
(containing Visual C++ 14.3) has been added.
.IP \(bu 4
The :win32 IO layer has been removed. This experimental replacement for the
:unix layer never reached maturity in its nearly two decades of existence.
.SS VMS
.IX Subsection "VMS"
.ie n .IP """keys %ENV"" on VMS returns consistent results" 4
.el .IP "\f(CWkeys %ENV\fR on VMS returns consistent results" 4
.IX Item "keys %ENV on VMS returns consistent results"
On VMS entries in the \f(CW%ENV\fR hash are loaded from the OS environment on
first access, hence the first iteration of \f(CW%ENV\fR requires the entire
environment to be scanned to find all possible keys. This initialisation had
always been done correctly for full iteration, but previously was not
happening for \f(CW%ENV\fR in scalar context, meaning that \f(CW\*(C`scalar %ENV\*(C'\fR would
return 0 if called before any other \f(CW%ENV\fR access, or would only return the
count of keys accessed if there had been no iteration.
.Sp
These bugs are now fixed \- \f(CW%ENV\fR and \f(CW\*(C`keys %ENV\*(C'\fR in scalar context now
return the correct result \- the count of all keys in the environment.
.SS "Discontinued Platforms"
.IX Subsection "Discontinued Platforms"
.IP "AT&T UWIN" 4
.IX Item "AT&T UWIN"
UWIN is a UNIX compatibility layer for Windows. It was last released
in 2012 and has been superseded by Cygwin these days.
.IP DOS/DJGPP 4
.IX Item "DOS/DJGPP"
DJGPP is a port of the GNU toolchain to 32\-bit x86 systems running
DOS. The last known attempt to build Perl on it was on 5.20, which
only got as far as building miniperl.
.IP NetWare 4
.IX Item "NetWare"
Support code for Novell NetWare has been removed. NetWare was a
server operating system by Novell. The port was last updated in July
2002, and the platform itself in May 2009.
.Sp
Unrelated changes accidentally broke the build for the NetWare port in
September 2009, and in 12 years no-one has reported this.
.SS "Platform-Specific Notes"
.IX Subsection "Platform-Specific Notes"
.IP z/OS 4
.IX Item "z/OS"
This update enables us to build EBCDIC static/dynamic and 31\-bit/64\-bit
addressing mode Perl. The number of tests that pass is consistent with the
baseline before these updates.
.Sp
These changes also provide the base support to be able to provide ASCII
static/dynamic and 31\-bit/64\-bit addressing mode Perl.
.Sp
The z/OS (previously called OS/390) README was updated to describe ASCII and
EBCDIC builds.
.SH "Internal Changes"
.IX Header "Internal Changes"
.IP \(bu 4
Since the removal of PERL_OBJECT in Perl 5.8, PERL_IMPLICIT_CONTEXT and
MULTIPLICITY have been synonymous and they were being used interchangeably.
To simplify the code, all instances of PERL_IMPLICIT_CONTEXT have been
replaced with MULTIPLICITY.
.Sp
PERL_IMPLICIT_CONTEXT will remain defined for compatibility with XS modules.
.IP \(bu 4
The API constant formerly named \f(CW\*(C`G_ARRAY\*(C'\fR, indicating list context, has now
been renamed to a more accurate \f(CW\*(C`G_LIST\*(C'\fR. A compatibilty macro \f(CW\*(C`G_ARRAY\*(C'\fR has
been added to allow existing code to work unaffected. New code should be
written using the new constant instead. This is supported by \f(CW\*(C`Devel::PPPort\*(C'\fR
version 3.63.
.IP \(bu 4
Macros have been added to \fIperl.h\fR to facilitate version comparisons:
\&\f(CW\*(C`PERL_GCC_VERSION_GE\*(C'\fR, \f(CW\*(C`PERL_GCC_VERSION_GT\*(C'\fR, \f(CW\*(C`PERL_GCC_VERSION_LE\*(C'\fR and
\&\f(CW\*(C`PERL_GCC_VERSION_LT\*(C'\fR.
.Sp
Inline functions have been added to \fIembed.h\fR to determine the position of
the least significant 1 bit in a word: \f(CW\*(C`lsbit_pos32\*(C'\fR and \f(CW\*(C`lsbit_pos64\*(C'\fR.
.IP \(bu 4
\&\f(CW\*(C`Perl_ptr_table_clear\*(C'\fR has been deleted. This has been marked as deprecated
since v5.14.0 (released in 2011), and is not used by any code on CPAN.
.IP \(bu 4
Added new boolean macros and functions. See "Stable boolean tracking" for
related information and perlapi for documentation.
.RS 4
.IP \(bu 4
sv_setbool
.IP \(bu 4
sv_setbool_mg
.IP \(bu 4
SvIsBOOL
.RE
.RS 4
.RE
.IP \(bu 4
Added 4 missing functions for dealing with RVs:
.RS 4
.IP \(bu 4
sv_setrv_noinc
.IP \(bu 4
sv_setrv_noinc_mg
.IP \(bu 4
sv_setrv_inc
.IP \(bu 4
sv_setrv_inc_mg
.RE
.RS 4
.RE
.IP \(bu 4
\&\f(CWxs_handshake()\fR's two failure modes now provide distinct messages.
.IP \(bu 4
Memory for hash iterator state (\f(CW\*(C`struct xpvhv_aux\*(C'\fR) is now allocated as part
of the hash body, instead of as part of the block of memory allocated for the
main hash array.
.IP \(bu 4
A new \fBphase_name()\fR interface provides access to the name for each interpreter
phase (i.e., PL_phase value).
.IP \(bu 4
The \f(CW\*(C`pack\*(C'\fR behavior of \f(CW\*(C`U\*(C'\fR has changed for EBCDIC.
.IP \(bu 4
New equality-test functions \f(CW\*(C`sv_numeq\*(C'\fR and \f(CW\*(C`sv_streq\*(C'\fR have been added, along
with \f(CW\*(C`..._flags\*(C'\fR\-suffixed variants. These expose a simple and consistent API
to perform numerical or string comparison which is aware of operator
overloading.
.IP \(bu 4
Reading the string form of an integer value no longer sets the flag \f(CW\*(C`SVf_POK\*(C'\fR.
The string form is still cached internally, and still re-read directly by the
macros \f(CWSvPV(sv)\fR \fIetc\fR (inline, without calling a C function). XS code that
already calls the APIs to get values will not be affected by this change. XS
code that accesses flags directly instead of using API calls to express its
intent \fImight\fR break, but such code likely is already buggy if passed some
other values, such as floating point values or objects with string overloading.
.Sp
This small change permits code (such as JSON serializers) to reliably determine
between
.RS 4
.IP \(bu 4
a value that was initially \fBwritten\fR as an integer, but then \fBread\fR as a string
.Sp
.Vb 2
\& my $answer = 42;
\& print "The answer is $answer\en";
.Ve
.IP \(bu 4
that same value that was initially \fBwritten\fR as a string, but then \fBread\fR as an integer
.Sp
.Vb 3
\& my $answer = "42";
\& print "That doesn\*(Aqt look right\en"
\& unless $answer == 6 * 9;
.Ve
.RE
.RS 4
.Sp
For the first case (originally written as an integer), we now have:
.Sp
.Vb 6
\& use Devel::Peek;
\& my $answer = 42;
\& Dump ($answer);
\& my $void = "$answer";
\& print STDERR "\en";
\& Dump($answer)
\&
\&
\& SV = IV(0x562538925778) at 0x562538925788
\& REFCNT = 1
\& FLAGS = (IOK,pIOK)
\& IV = 42
\&
\& SV = PVIV(0x5625389263c0) at 0x562538925788
\& REFCNT = 1
\& FLAGS = (IOK,pIOK,pPOK)
\& IV = 42
\& PV = 0x562538919b50 "42"\e0
\& CUR = 2
\& LEN = 10
.Ve
.Sp
For the second (originally written as a string), we now have:
.Sp
.Vb 6
\& use Devel::Peek;
\& my $answer = "42";
\& Dump ($answer);
\& my $void = $answer == 6 * 9;
\& print STDERR "\en";
\& Dump($answer)\*(Aq
\&
\&
\& SV = PV(0x5586ffe9bfb0) at 0x5586ffec0788
\& REFCNT = 1
\& FLAGS = (POK,IsCOW,pPOK)
\& PV = 0x5586ffee7fd0 "42"\e0
\& CUR = 2
\& LEN = 10
\& COW_REFCNT = 1
\&
\& SV = PVIV(0x5586ffec13c0) at 0x5586ffec0788
\& REFCNT = 1
\& FLAGS = (IOK,POK,IsCOW,pIOK,pPOK)
\& IV = 42
\& PV = 0x5586ffee7fd0 "42"\e0
\& CUR = 2
\& LEN = 10
\& COW_REFCNT = 1
.Ve
.Sp
(One can't rely on the presence or absence of the flag \f(CW\*(C`SVf_IsCOW\*(C'\fR to
determine the history of operations on a scalar.)
.Sp
Previously both cases would be indistinguishable, with all 4 flags set:
.Sp
.Vb 7
\& SV = PVIV(0x55d4d62edaf0) at 0x55d4d62f0930
\& REFCNT = 1
\& FLAGS = (IOK,POK,pIOK,pPOK)
\& IV = 42
\& PV = 0x55d4d62e1740 "42"\e0
\& CUR = 2
\& LEN = 10
.Ve
.Sp
(and possibly \f(CW\*(C`SVf_IsCOW\*(C'\fR, but not always)
.Sp
This now means that if XS code \fIreally\fR needs to determine which form a value
was first written as, it should implement logic roughly
.Sp
.Vb 6
\& if (flags & SVf_IOK|SVf_NOK) && !(flags & SVf_POK)
\& serialize as number
\& else if (flags & SVf_POK)
\& serialize as string
\& else
\& the existing guesswork ...
.Ve
.Sp
Note that this doesn't cover "dualvars" \- scalars that report different
values when asked for their string form or number form (such as \f(CW$!\fR).
Most serialization formats cannot represent such duplicity.
.Sp
\&\fIThe existing guesswork\fR remains because as well as dualvars, values might
be \f(CW\*(C`undef\*(C'\fR, references, overloaded references, typeglobs and other things that
Perl itself can represent but do not map one-to-one into external formats, so
need some amount of approximation or encapsulation.
.RE
.IP \(bu 4
\&\f(CW\*(C`sv_dump\*(C'\fR (and Devel::Peek’s \f(CW\*(C`Dump\*(C'\fR function) now escapes high-bit
octets in the PV as hex rather than octal. Since most folks understand hex
more readily than octal, this should make these dumps a bit more legible.
This does \fBnot\fR affect any other diagnostic interfaces like \f(CW\*(C`pv_display\*(C'\fR.
.SH "Selected Bug Fixes"
.IX Header "Selected Bug Fixes"
.IP \(bu 4
\&\fButime()\fR now correctly sets errno/\f(CW$!\fR when called on a closed handle.
.IP \(bu 4
The flags on the OPTVAL parameter to \fBsetsockopt()\fR were previously
checked before magic was called, possibly treating a numeric value as
a packed buffer or vice versa. It also ignored the UTF\-8 flag,
potentially treating the internal representation of an upgraded SV as
the bytes to supply to the \fBsetsockopt()\fR system call. (github #18660 <https://github.com/Perl/perl5/issues/18660>)
.IP \(bu 4
Only set IOKp, not IOK on $) and $(.
This was issue #18955 <https://github.com/Perl/perl5/issues/18955>: This will prevent serializers from serializing these
variables as numbers (which loses the additional groups).
This restores behaviour from 5.16
.IP \(bu 4
Use of the \f(CW\*(C`mktables\*(C'\fR debugging facility would cause perl to croak since
v5.31.10; this problem has now been fixed.
.IP \(bu 4
\&\f(CW\*(C`makedepend\*(C'\fR logic is now compatible with BSD make (fixes
GH #19046 <https://github.com/Perl/perl5/issues/19046>).
.IP \(bu 4
Calling \f(CW\*(C`untie\*(C'\fR on a tied hash that is partway through iteration now frees the
iteration state immediately.
.Sp
Iterating a tied hash causes perl to store a copy of the current hash key to
track the iteration state, with this stored copy passed as the second parameter
to \f(CW\*(C`NEXTKEY\*(C'\fR. This internal state is freed immediately when tie hash iteration
completes, or if the hash is destroyed, but due to an implementation oversight,
it was not freed if the hash was untied. In that case, the internal copy of the
key would persist until the earliest of
.RS 4
.IP 1. 4
\&\f(CW\*(C`tie\*(C'\fR was called again on the same hash
.IP 2. 4
The (now untied) hash was iterated (ie passed to any of \f(CW\*(C`keys\*(C'\fR, \f(CW\*(C`values\*(C'\fR or
\&\f(CW\*(C`each\*(C'\fR)
.IP 3. 4
The hash was destroyed.
.RE
.RS 4
.Sp
This inconsistency is now fixed \- the internal state is now freed immediately by
\&\f(CW\*(C`untie\*(C'\fR.
.Sp
As the precise timing of this behaviour can be observed with pure Perl code
(the timing of \f(CW\*(C`DESTROY\*(C'\fR on objects returned from \f(CW\*(C`FIRSTKEY\*(C'\fR and \f(CW\*(C`NEXTKEY\*(C'\fR)
it's just possible that some code is sensitive to it.
.RE
.IP \(bu 4
The \f(CWInternals::getcwd()\fR function added for bootstrapping miniperl
in perl 5.30.0 is now only available in miniperl. [github #19122]
.IP \(bu 4
Setting a breakpoint on a BEGIN or equivalently a \f(CW\*(C`use\*(C'\fR statement
could cause a memory write to a freed \f(CW\*(C`dbstate\*(C'\fR op.
[GH #19198 <https://github.com/Perl/perl5/issues/19198>]
.IP \(bu 4
When bareword filehandles are disabled, the parser was interpreting
any bareword as a filehandle, even when immediatey followed by parens.
.SH "Errata From Previous Releases"
.IX Header "Errata From Previous Releases"
.IP \(bu 4
perl5300delta mistakenly identified a CVE whose correct identification is
CVE\-2015\-1592.
.SH Obituaries
.IX Header "Obituaries"
Raun "Spider" Boardman (SPIDB on CPAN), author of at least 66 commits to the
Perl 5 core distribution between 1996 and 2002, passed away May 24, 2021 from
complications of COVID. He will be missed.
.PP
David H. Adler (DHA) passed away on November 16, 2021. In 1997, David
co-founded NY.pm, the first Perl user group, and in 1998 co-founded Perl
Mongers to help establish other user groups across the globe. He was a
frequent attendee at Perl conferences in both North America and Europe and well
known for his role in organizing \fIBad Movie Night\fR celebrations at those
conferences. He also contributed to the work of the Perl Foundation, including
administering the White Camel awards for community service. He will be missed.
.SH Acknowledgements
.IX Header "Acknowledgements"
Perl 5.36.0 represents approximately a year of development since Perl
5.34.0 and contains approximately 250,000 lines of changes across 2,000
files from 82 authors.
.PP
Excluding auto-generated files, documentation and release tools, there were
approximately 190,000 lines of changes to 1,300 .pm, .t, .c and .h files.
.PP
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.36.0:
.PP
Alyssa Ross, Andrew Fresh, Aristotle Pagaltzis, Asher Mancinelli, Atsushi
Sugawara, Ben Cornett, Bernd, Biswapriyo Nath, Brad Barden, Bram, Branislav
Zahradník, brian d foy, Chad Granum, Chris 'BinGOs' Williams, Christian
Walde (Mithaldu), Christopher Yeleighton, Craig A. Berry, cuishuang, Curtis
Poe, Dagfinn Ilmari Mannsåker, Dan Book, Daniel Laügt, Dan Jacobson, Dan
Kogai, Dave Cross, Dave Lambley, David Cantrell, David Golden, David
Marshall, David Mitchell, E. Choroba, Eugen Konkov, Felipe Gasper, François
Perrad, Graham Knop, H.Merijn Brand, Hugo van der Sanden, Ilya Sashcheka,
Ivan Panchenko, Jakub Wilk, James E Keenan, James Raspass, Karen Etheridge,
Karl Williamson, Leam Hall, Leon Timmermans, Magnus Woldrich, Matthew
Horsfall, Max Maischein, Michael G Schwern, Michiel Beijen, Mike Fulton,
Neil Bowers, Nicholas Clark, Nicolas R, Niyas Sait, Olaf Alders, Paul Evans,
Paul Marquess, Petar-Kaleychev, Pete Houston, Renee Baecker, Ricardo Signes,
Richard Leach, Robert Rothenberg, Sawyer X, Scott Baker, Sergey Poznyakoff,
Sergey Zhmylove, Sisyphus, Slaven Rezic, Steve Hay, Sven Kirmess, TAKAI
Kousuke, Thibault Duponchelle, Todd Rinaldo, Tomasz Konojacki, Tomoyuki
Sadahiro, Tony Cook, Unicode Consortium, Yves Orton, Михаил
Козачков.
.PP
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.
.PP
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.
.PP
For a more complete list of all of Perl's historical contributors, please
see the AUTHORS file in the Perl source distribution.
.SH "Reporting Bugs"
.IX Header "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
<http://www.perl.org/>, the Perl Home Page.
.PP
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.
.PP
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.
.SH "Give Thanks"
.IX Header "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 \f(CW\*(C`perlthanks\*(C'\fR program:
.PP
.Vb 1
\& perlthanks
.Ve
.PP
This will send an email to the Perl 5 Porters list with your show of thanks.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
The \fIChanges\fR file for an explanation of how to view exhaustive details on
what changed.
.PP
The \fIINSTALL\fR file for how to build Perl.
.PP
The \fIREADME\fR file for general stuff.
.PP
The \fIArtistic\fR and \fICopying\fR files for copyright information.
|