summaryrefslogtreecommitdiffstats
path: root/upstream/debian-unstable/man1/perl5380delta.1
blob: adf57a02b93d63a134bdbcb5475bacdc8c2bed33 (plain)
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
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
.\" -*- 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 "PERL5380DELTA 1"
.TH PERL5380DELTA 1 2024-01-12 "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
perl5380delta \- what is new for perl v5.38.0
.SH DESCRIPTION
.IX Header "DESCRIPTION"
This document describes differences between the 5.36.0 release and the 5.38.0
release.
.SH "Core Enhancements"
.IX Header "Core Enhancements"
.ie n .SS "New ""class"" Feature"
.el .SS "New \f(CWclass\fP Feature"
.IX Subsection "New class Feature"
A new \fBexperimental\fR syntax is now available for defining object classes,
where per-instance data is stored in "field" variables that behave like
lexicals.
.PP
.Vb 1
\&    use feature \*(Aqclass\*(Aq;
\&
\&    class Point
\&    {
\&        field $x;
\&        field $y;
\&
\&        method zero { $x = $y = 0; }
\&    }
.Ve
.PP
This is described in more detail in perlclass.  Notes on the internals of
its implementation and other related details can be found in perlclassguts.
.PP
This remains a new and experimental feature, and is very much still under
development. It will be the subject of much further addition, refinement and
alteration in future releases.  As it is experimental, it yields warnings in
the \f(CW\*(C`experimental::class\*(C'\fR category.  These can be silenced by a
\&\f(CW\*(C`no warnings\*(C'\fR statement.
.PP
.Vb 2
\&    use feature \*(Aqclass\*(Aq;
\&    no warnings \*(Aqexperimental::class\*(Aq;
.Ve
.SS "Unicode 15.0 is supported"
.IX Subsection "Unicode 15.0 is supported"
See <https://www.unicode.org/versions/Unicode15.0.0/> for details.
.SS "Deprecation warnings now have specific subcategories"
.IX Subsection "Deprecation warnings now have specific subcategories"
All deprecation warnings now have their own specific deprecation category which
can be disabled individually. You can see a list of all deprecated features in
perldeprecation, and in warnings. The following list is from warnings:
.PP
.Vb 10
\&         +\- deprecated \-\-\-\-+
\&         |                 |
\&         |                 +\- deprecated::apostrophe_as_package_separator
\&         |                 |
\&         |                 +\- deprecated::delimiter_will_be_paired
\&         |                 |
\&         |                 +\- deprecated::dot_in_inc
\&         |                 |
\&         |                 +\- deprecated::goto_construct
\&         |                 |
\&         |                 +\- deprecated::smartmatch
\&         |                 |
\&         |                 +\- deprecated::unicode_property_name
\&         |                 |
\&         |                 +\- deprecated::version_downgrade
.Ve
.PP
It is still possible to disable all deprecation warnings in a single
statement with
.PP
.Vb 1
\&    no warnings \*(Aqdeprecated\*(Aq;
.Ve
.PP
but now is possible to have a finer grained control. As has historically been
the case these warnings are automatically enabled with
.PP
.Vb 1
\&    use warnings;
.Ve
.SS "%{^HOOK} API introduced"
.IX Subsection "%{^HOOK} API introduced"
For various reasons it can be difficult to create subroutine wrappers
for some of perls keywords. Any keyword which has an undefined
prototype simply cannot be wrapped with a subroutine, and some keywords
which perl permits to be wrapped are in practice very tricky to wrap.
For example \f(CW\*(C`require\*(C'\fR is tricky to wrap, it is possible but doing so
changes the stack depth, and the standard methods of exporting assume
that they will be exporting to a package at certain stack depth up the
stack, and the wrapper will thus change where functions are exported to
unless implemented with a great deal of care. This can be very awkward
to deal with.
.PP
Accordingly we have introduced a new hash called \f(CW\*(C`%{^HOOK}\*(C'\fR which is
intended to facilitate such cases. When a keyword supports any kind of
special hook then the hook will live in this new hash. Hooks in this
hash will be named after the function they are called by, followed by
two underbars and then the phase they are executed in, currently either
before or after the keyword is executed.
.PP
In this initial release we support two hooks \f(CW\*(C`require_\|_before\*(C'\fR and
\&\f(CW\*(C`require_\|_after\*(C'\fR. These are provided to make it easier to perform tasks
before and after a require statement.
.PP
See perlvar for more details.
.SS PERL_RAND_SEED
.IX Subsection "PERL_RAND_SEED"
Added a new environment variable \f(CW\*(C`PERL_RAND_SEED\*(C'\fR which can be used to
cause a perl program which uses \f(CW\*(C`rand\*(C'\fR without using \f(CWsrand()\fR
explicitly or which uses \f(CWsrand()\fR with no arguments to be repeatable.
See perlrun. This feature can be disabled at compile time by passing
.PP
.Vb 1
\&    \-Accflags=\-DNO_PERL_RAND_SEED
.Ve
.PP
to \fIConfigure\fR during the build process.
.SS "Defined-or and logical-or assignment default expressions in signatures"
.IX Subsection "Defined-or and logical-or assignment default expressions in signatures"
The default expression for a subroutine signature parameter can now be
assigned using the \f(CW\*(C`//=\*(C'\fR or \f(CW\*(C`||=\*(C'\fR operators, to apply the defaults whenever
the caller provided an undefined or false value (respectively), rather than
simply when the parameter is missing entirely.  For more detail see the
documentation in perlsub.
.ie n .SS "@INC Hook Enhancements and $INC and INCDIR"
.el .SS "\f(CW@INC\fP Hook Enhancements and \f(CW$INC\fP and INCDIR"
.IX Subsection "@INC Hook Enhancements and $INC and INCDIR"
The internals for \f(CW@INC\fR hooks have been hardened to handle various
edge cases and should no longer segfault or throw assert failures when
hooks modify \f(CW@INC\fR during a require operation.  As part of this we
now ensure that any given hook is executed at most once during a require
call, and that any duplicate directories do not trigger additional
directory probes.
.PP
To provide developers more control over dynamic module lookup, a new hook
method \f(CW\*(C`INCDIR\*(C'\fR is now supported. An object supporting this method may be
injected into the \f(CW@INC\fR array, and when it is encountered in the module
search process it will be executed, just like how INC hooks are executed,
and its return value used as a list of directories to search for the
module. Returning an empty list acts as a no-op. Note that since any
references returned by this hook will be stringified and used as strings,
you may not return a hook to be executed later via this API.
.PP
When an \f(CW@INC\fR hook (either \f(CW\*(C`INC\*(C'\fR or \f(CW\*(C`INCDIR\*(C'\fR) is called during
require, the \f(CW$INC\fR variable will be localized to be the value of the
index of \f(CW@INC\fR that the hook came from. If the hook wishes to override
what the "next" index in \f(CW@INC\fR should be it may update \f(CW$INC\fR to be one
less than the desired index (\f(CW\*(C`undef\*(C'\fR is equivalent to \f(CW\-1\fR). This
allows an \f(CW@INC\fR hook to completely rewrite the \f(CW@INC\fR array and have
perl restart its directory probes from the beginning of \f(CW@INC\fR.
.PP
Blessed CODE references in \f(CW@INC\fR that do not support the \f(CW\*(C`INC\*(C'\fR or
\&\f(CW\*(C`INCDIR\*(C'\fR methods will no longer trigger an exception, and instead will
be treated the same as unblessed coderefs are, and executed as though
they were an \f(CW\*(C`INC\*(C'\fR hook.
.ie n .SS "Forbidden control flow out of ""defer"" or ""finally"" now detected at compile-time"
.el .SS "Forbidden control flow out of \f(CWdefer\fP or \f(CWfinally\fP now detected at compile-time"
.IX Subsection "Forbidden control flow out of defer or finally now detected at compile-time"
It is forbidden to attempt to leave a \f(CW\*(C`defer\*(C'\fR or \f(CW\*(C`finally\*(C'\fR block by means
of control flow such as \f(CW\*(C`return\*(C'\fR or \f(CW\*(C`goto\*(C'\fR. Previous versions of perl could
only detect this when actually attempted at runtime.
.PP
This version of perl adds compile-time detection for many cases that can be
statically determined. This may mean that code which compiled successfully on
a previous version of perl is now reported as a compile-time error with this
one. This only happens in cases where it would have been an error to actually
execute the code anyway; the error simply happens at an earlier time.
.SS "Optimistic Eval in Patterns"
.IX Subsection "Optimistic Eval in Patterns"
The use of \f(CW\*(C`(?{ ... })\*(C'\fR and \f(CW\*(C`(??{ ... })\*(C'\fR in a pattern disables various
optimisations globally in that pattern. This may or may not be desired by the
programmer. This release adds the \f(CW\*(C`(*{ ... })\*(C'\fR
equivalent. The only difference is that it does not and will never disable
any optimisations in the regex engine. This may make it more unstable in the
sense that it may be called more or less times in the future, however the
number of times it executes will truly match how the regex engine functions.
For example, certain types of optimisation are disabled when \f(CW\*(C`(?{ ... })\*(C'\fR is
included in a pattern, so that patterns which are O(N) in normal use become
O(N*N) with a \f(CW\*(C`(?{ ... })\*(C'\fR pattern in them. Switching to \f(CW\*(C`(*{ ... })\*(C'\fR means
the pattern will stay O(N).
.SS "REG_INF has been raised from 65,536 to 2,147,483,647"
.IX Subsection "REG_INF has been raised from 65,536 to 2,147,483,647"
Many regex quantifiers used to be limited to \f(CW\*(C`U16_MAX\*(C'\fR in the past, but are
now limited to \f(CW\*(C`I32_MAX\*(C'\fR, thus it is now possible to write
\&\f(CW\*(C`/(?:word){1000000}/\*(C'\fR for example.  Note that doing so may cause the regex
engine to run longer and use more memory.
.SS "New API functions optimize_optree and finalize_optree"
.IX Subsection "New API functions optimize_optree and finalize_optree"
There are two new API functions for operating on optree fragments, ensuring
you can invoke the required parts of the optree-generation process that might
otherwise not get invoked (e.g. when creating a custom LOGOP).  To get access
to these functions, you first need to set a \f(CW\*(C`#define\*(C'\fR to opt-in to using
these functions.
.PP
.Vb 1
\&  #define PERL_USE_VOLATILE_API
.Ve
.PP
These functions are closely tied to the internals of how the interpreter
works, and could be altered or removed at any time if other internal changes
make that necessary.
.ie n .SS "Some ""goto""s are now permitted in ""defer"" and ""finally"" blocks"
.el .SS "Some \f(CWgoto\fPs are now permitted in \f(CWdefer\fP and \f(CWfinally\fP blocks"
.IX Subsection "Some gotos are now permitted in defer and finally blocks"
Perl version 5.36.0 added \f(CW\*(C`defer\*(C'\fR blocks and permitted the \f(CW\*(C`finally\*(C'\fR keyword
to also add similar behaviour to \f(CW\*(C`try\*(C'\fR/\f(CW\*(C`catch\*(C'\fR syntax.  These did not permit
any \f(CW\*(C`goto\*(C'\fR expression within the body, as it could have caused control flow
to jump out of the block.  Now, some \f(CW\*(C`goto\*(C'\fR expressions are allowed, if they
have a constant target label, and that label is found within the block.
.PP
.Vb 1
\&  use feature \*(Aqdefer\*(Aq;
\&
\&  defer {
\&    goto LABEL;
\&    print "This does not execute\en";
\&    LABEL: print "This does\en";
\&  }
.Ve
.SS "New regexp variable ${^LAST_SUCCESSFUL_PATTERN}"
.IX Subsection "New regexp variable ${^LAST_SUCCESSFUL_PATTERN}"
This allows access to the last succesful pattern that matched in the current
scope.  Many aspects of the regex engine refer to the "last successful
pattern". The empty pattern reuses it, and all of the magic regex vars relate
to it. This allows access to its pattern. The following code
.PP
.Vb 3
\&    if (m/foo/ || m/bar/) {
\&        s//PQR/;
\&    }
.Ve
.PP
can be rewritten as follows
.PP
.Vb 3
\&    if (m/foo/ || m/bar/) {
\&        s/${^LAST_SUCCESSFUL_PATTERN}/PQR/;
\&    }
.Ve
.PP
and it will do the exactly same thing.
.SS "Locale category LC_NAME now supported on participating platforms"
.IX Subsection "Locale category LC_NAME now supported on participating platforms"
On platforms that have the GNU extension \f(CW\*(C`LC_NAME\*(C'\fR category, you may now use
it as the category parameter to "setlocale" in POSIX to set and query its locale.
.SH "Incompatible Changes"
.IX Header "Incompatible Changes"
.SS "\fBreadline()\fP no longer clears the stream error and eof flags"
.IX Subsection "readline() no longer clears the stream error and eof flags"
\&\f(CWreadline()\fR, also spelled \f(CW\*(C`<>\*(C'\fR, would clear the handle's error
and eof flags after an error occurred on the stream.
.PP
In nearly all cases this clear is no longer done, so the error and
eof flags now properly reflect the status of the stream after
\&\fBreadline()\fR.
.PP
Since the error flag is no longer cleared calling \fBclose()\fR on the
stream may fail and if the stream was not explicitly closed, the
implicit close of the stream may produce a warning.
.PP
This has resulted in two main types of problems in downstream CPAN
modules, and these may also occur in your code:
.IP \(bu 4
If your code reads to end of file, and then rebinds the handle to a
new file descriptor, previously since the eof flag wasn't set you
could continue to read from the stream.  You now need to clear the eof
flag yourself with \f(CW\*(C`$handle\->clearerr()\*(C'\fR to continue reading.
.IP \(bu 4
If your code encounters an error on the stream while reading with
\&\fBreadline()\fR you will need to call \f(CW\*(C`$handle\->clearerr\*(C'\fR to continue
reading.  The one case this occurred the underlying file descriptor was
marked non-blocking, so the \fBread()\fR system call was failing with
\&\f(CW\*(C`EAGAIN\*(C'\fR, which resulted in the error flag being set on the stream.
.PP
The only case where error and eof flags continue to cleared on
error is when reading from the child process for \fBglob()\fR in
\&\fIminiperl\fR.  This allows it to correctly report errors from the child
process on \fBclose()\fR.  This is unlikely to be an issue during normal
perl development.
.PP
[GH #20060 <https://github.com/Perl/perl5/issues/20060>]
.ie n .SS """INIT"" blocks no longer run after an exit() in ""BEGIN"""
.el .SS "\f(CWINIT\fP blocks no longer run after an \f(CWexit()\fP in \f(CWBEGIN\fP"
.IX Subsection "INIT blocks no longer run after an exit() in BEGIN"
\&\f(CW\*(C`INIT\*(C'\fR blocks will no longer run after an \f(CWexit()\fR performed inside of
a \f(CW\*(C`BEGIN\*(C'\fR. This means that the combination of the \f(CW\*(C`\-v\*(C'\fR option and the
\&\f(CW\*(C`\-c\*(C'\fR option no longer executes a compile check as well as showing the
perl version. The \f(CW\*(C`\-v\*(C'\fR option executes an \fBexit\fR\|(0) after printing the
version information inside of a \f(CW\*(C`BEGIN\*(C'\fR block, and the \f(CW\*(C`\-c\*(C'\fR check is
implemented by using \f(CW\*(C`INIT\*(C'\fR hooks, resulting in the \f(CW\*(C`\-v\*(C'\fR option taking
precedence.
.PP
[GH #1537 <https://github.com/Perl/perl5/issues/1537>]
[GH #20181 <https://github.com/Perl/perl5/issues/20181>]
.SS "Syntax errors no longer produce ""phantom error messages"""
.IX Subsection "Syntax errors no longer produce ""phantom error messages"""
Generally perl will continue parsing the source code even after
encountering a compile error. In many cases this is helpful, for
instance with misspelled variable names it is helpful to show as many
examples of the error as possible. But in the case of syntax errors
continuing often produces bizarre error messages and may even cause
segmentation faults during the compile process. In this release the
compiler will halt at the first syntax error encountered. This means
that any code expecting to see the specific error messages we used to
produce will be broken. The error that is emitted will be one of the
diagnostics that used to be produced, but in some cases some messages
that used to be produced will no longer be displayed.
.PP
See "Changes to Existing Diagnostics" for more details.
.ie n .SS utf8::upgrade()
.el .SS \f(CWutf8::upgrade()\fP
.IX Subsection "utf8::upgrade()"
Starting in this release, if the input string is \f(CW\*(C`undef\*(C'\fR, it remains
\&\f(CW\*(C`undef\*(C'\fR.  Previously it would be changed into a defined, zero-length
string.
.SS "Changes to ""thread-safe"" locales"
.IX Subsection "Changes to ""thread-safe"" locales"
Perl 5.28 introduced "thread-safe" locales on systems that supported
them, namely modern Windows, and systems supporting POSIX 2008 locale
operations.  These systems accomplish this by having per-thread locales,
while continuing to support the older global locale operations for code
that doesn't take the steps necessary to use the newer per-thread ones.
.PP
It turns out that some POSIX 2008 platforms have or have had buggy
implementations, which forced perl to not use them.  The
\&\f(CW\*(C`${^SAFE_LOCALES}\*(C'\fR scalar variable contains 0 or 1 to indicate whether
or not the current platform is considered by perl to have a working
thread-safe implementation.  Some implementations have been fixed
already, but FreeBSD and Cygwin have been newly discovered to be
sufficiently buggy that the thread-safe operations are no longer used by
perl, starting in this release.  Hence, \f(CW\*(C`${^SAFE_LOCALES}\*(C'\fR is now 0 for
them.  Older versions of perl can be configured to avoid these buggy
implementations by adding the \fIConfigure\fR option
\&\f(CW\*(C`\-DNO_POSIX_2008_LOCALE\*(C'\fR.
.PP
And v5.38 fixes a bug in all previous perls that led to locales not
being fully thread-safe.  The first thread that finishes caused
the main thread (named \f(CW\*(C`thread0\*(C'\fR) to revert to the global locale in
effect at startup, discarding whatever the thread's locale had been
previously set to.  If any other thread had switched to the global
locale by calling \f(CWswitch_to_global_locale()\fR in XS code, those threads
would all share the global locale, and \f(CW\*(C`thread0\*(C'\fR would not be
thread-safe.
.SH Deprecations
.IX Header "Deprecations"
.ie n .SS "Use of ""\*(Aq"" as a package name separator is deprecated"
.el .SS "Use of \f(CW\*(Aq\fP as a package name separator is deprecated"
.IX Subsection "Use of as a package name separator is deprecated"
Using \f(CW\*(C`\*(Aq\*(C'\fR as package separator in a variable named in a double-quoted
string has warned since 5.28.  It is now deprecated in both string
interpolation and non-interpolated contexts, and will be removed in
Perl 5.42.
.SS "Switch and Smart Match operator"
.IX Subsection "Switch and Smart Match operator"
The "switch" feature and the smartmatch operator, \f(CW\*(C`~~\*(C'\fR, were introduced in
v5.10.  Their behavior was significantly changed in v5.10.1.  When the
"experiment" system was added in v5.18.0, switch and smartmatch were
retroactively declared experimental.  Over the years, proposals to fix or
supplement the features have come and gone.
.PP
In v5.38.0, we are declaring the experiment a failure.  Some future system may
take the conceptual place of smartmatch, but it has not yet been designed or
built.
.PP
These features will be entirely removed from perl in v5.42.0.
.SH "Performance Enhancements"
.IX Header "Performance Enhancements"
.IP \(bu 4
Additional optree optimizations for common OP patterns. For example, multiple
simple OPs replaced by a single streamlined OP, so as to be more efficient at
runtime. [GH #19943 <https://github.com/Perl/perl5/pull/19943>],
[GH #20063 <https://github.com/Perl/perl5/pull/20063>],
[GH #20077 <https://github.com/Perl/perl5/pull/20077>].
.IP \(bu 4
Creating an anonymous sub no longer generates an \f(CW\*(C`srefgen\*(C'\fR op, the
reference generation is now done in the \f(CW\*(C`anoncode\*(C'\fR or \f(CW\*(C`anonconst\*(C'\fR
op, saving runtime. [GH #20290 <https://github.com/Perl/perl5/pull/20290>]
.SH "Modules and Pragmata"
.IX Header "Modules and Pragmata"
.SS "Updated Modules and Pragmata"
.IX Subsection "Updated Modules and Pragmata"
.IP \(bu 4
Added the \f(CWis_tainted()\fR builtin function. [GH #19854 <https://github.com/Perl/perl5/issues/19854>]
.IP \(bu 4
Added the \f(CWexport_lexically()\fR builtin function as per PPC 0020 <https://github.com/Perl/PPCs/blob/main/ppcs/ppc0020-lexical-export.md>. [GH #19895 <https://github.com/Perl/perl5/issues/19895>]
.IP \(bu 4
Support for PPC 0018 <https://github.com/Perl/PPCs/blob/main/ppcs/ppc0018-module-true.md>, \f(CW\*(C`use feature "module_true";\*(C'\fR has been added to
the default feature bundle for v5.38 and later. It may also be used
explicitly. When enabled inside of a module the module does not need
to return true explicitly, and in fact the return will be forced to
a simple true value regardless of what it originally was.
.IP \(bu 4
Attribute::Handlers has been upgraded from version 1.02 to 1.03.
.IP \(bu 4
attributes has been upgraded from version 0.34 to 0.35.
.IP \(bu 4
autodie has been upgraded from version 2.34 to 2.36.
.IP \(bu 4
B has been upgraded from version 1.83 to 1.88.
.IP \(bu 4
B::Concise has been upgraded from version 1.006 to 1.007.
.IP \(bu 4
B::Deparse has been upgraded from version 1.64 to 1.74.
.IP \(bu 4
Benchmark has been upgraded from version 1.23 to 1.24.
.IP \(bu 4
bignum has been upgraded from version 0.65 to 0.66.
.IP \(bu 4
Carp has been upgraded from version 1.52 to 1.54.
.IP \(bu 4
Class::Struct has been upgraded from version 0.66 to 0.68.
.IP \(bu 4
Compress::Raw::Bzip2 has been upgraded from version 2.103 to 2.204_001.
.IP \(bu 4
Compress::Raw::Zlib has been upgraded from version 2.105 to 2.204_001.
.IP \(bu 4
Config::Perl::V has been upgraded from version 0.33 to 0.36.
.IP \(bu 4
CPAN has been upgraded from version 2.33 to 2.36.
.IP \(bu 4
Data::Dumper has been upgraded from version 2.184 to 2.188.
.IP \(bu 4
DB_File has been upgraded from version 1.857 to 1.858.
.IP \(bu 4
Devel::Peek has been upgraded from version 1.32 to 1.33.
.IP \(bu 4
Devel::PPPort has been upgraded from version 3.68 to 3.71.
.IP \(bu 4
Digest::MD5 has been upgraded from version 2.58 to 2.58_01.
.IP \(bu 4
Digest::SHA has been upgraded from version 6.02 to 6.04.
.IP \(bu 4
DynaLoader has been upgraded from version 1.52 to 1.54.
.IP \(bu 4
Encode has been upgraded from version 3.17 to 3.19.
.IP \(bu 4
encoding::warnings has been upgraded from version 0.13 to 0.14.
.IP \(bu 4
Env has been upgraded from version 1.05 to 1.06.
.IP \(bu 4
Errno has been upgraded from version 1.36 to 1.37.
.IP \(bu 4
experimental has been upgraded from version 0.028 to 0.031.
.IP \(bu 4
ExtUtils::CBuilder has been upgraded from version 0.280236 to 0.280238.
.IP \(bu 4
ExtUtils::Install has been upgraded from version 2.20 to 2.22.
.IP \(bu 4
ExtUtils::MakeMaker has been upgraded from version 7.64 to 7.70.
.IP \(bu 4
ExtUtils::Miniperl has been upgraded from version 1.11 to 1.13.
.IP \(bu 4
ExtUtils::ParseXS has been upgraded from version 3.45 to 3.51.
.IP \(bu 4
ExtUtils::PL2Bat has been upgraded from version 0.004 to 0.005.
.IP \(bu 4
ExtUtils::Typemaps has been upgraded from version 3.45 to 3.51.
.IP \(bu 4
feature has been upgraded from version 1.72 to 1.82.
.IP \(bu 4
File::Basename has been upgraded from version 2.85 to 2.86.
.IP \(bu 4
File::Copy has been upgraded from version 2.39 to 2.41.
.IP \(bu 4
File::Find has been upgraded from version 1.40 to 1.43.
.IP \(bu 4
File::Glob has been upgraded from version 1.37 to 1.40.
.IP \(bu 4
File::Spec has been upgraded from version 3.84 to 3.89.
.IP \(bu 4
File::stat has been upgraded from version 1.12 to 1.13.
.IP \(bu 4
FileHandle has been upgraded from version 2.03 to 2.05.
.IP \(bu 4
Filter::Util::Call has been upgraded from version 1.60 to 1.64.
.IP \(bu 4
GDBM_File has been upgraded from version 1.23 to 1.24.
.IP \(bu 4
Getopt::Long has been upgraded from version 2.52 to 2.54.
.IP \(bu 4
Hash::Util has been upgraded from version 0.28 to 0.30.
.IP \(bu 4
HTTP::Tiny has been upgraded from version 0.080 to 0.083.
.IP \(bu 4
I18N::Langinfo has been upgraded from version 0.21 to 0.22.
.IP \(bu 4
IO has been upgraded from version 1.50 to 1.52.
.IP \(bu 4
IO-Compress has been upgraded from version 2.106 to 2.204.
.IP \(bu 4
IO::Socket::IP has been upgraded from version 0.41 to 0.41_01.
.Sp
On DragonflyBSD, detect \fBsetsockopt()\fR not actually clearing
\&\f(CW\*(C`IPV6_V6ONLY\*(C'\fR even when \fBsetsockopt()\fR returns success.  [cpan
#148293 <https://rt.cpan.org/Ticket/Display.html?id=148293>]
.IP \(bu 4
IO::Zlib has been upgraded from version 1.11 to 1.14.
.IP \(bu 4
JSON::PP has been upgraded from version 4.07 to 4.16.
.IP \(bu 4
libnet has been upgraded from version 3.14 to 3.15.
.IP \(bu 4
Locale::Maketext has been upgraded from version 1.31 to 1.33.
.IP \(bu 4
Math::BigInt has been upgraded from version 1.999830 to 1.999837.
.IP \(bu 4
Math::BigInt::FastCalc has been upgraded from version 0.5012 to 0.5013.
.IP \(bu 4
Math::BigRat has been upgraded from version 0.2621 to 0.2624.
.IP \(bu 4
Math::Complex has been upgraded from version 1.5902 to 1.62.
.IP \(bu 4
Memoize has been upgraded from version 1.03_01 to 1.16.
.IP \(bu 4
MIME::Base64 has been upgraded from version 3.16 to 3.16_01.
.IP \(bu 4
Module::CoreList has been upgraded from version 5.20220520 to 5.20230520.
.IP \(bu 4
mro has been upgraded from version 1.26 to 1.28.
.IP \(bu 4
NDBM_File has been upgraded from version 1.15 to 1.16.
.IP \(bu 4
Net::Ping has been upgraded from version 2.74 to 2.76.
.IP \(bu 4
ODBM_File has been upgraded from version 1.17 to 1.18.
.IP \(bu 4
Opcode has been upgraded from version 1.57 to 1.64.
.IP \(bu 4
overload has been upgraded from version 1.35 to 1.37.
.IP \(bu 4
parent has been upgraded from version 0.238 to 0.241.
.IP \(bu 4
PerlIO::via::QuotedPrint has been upgraded from version 0.09 to 0.10.
.IP \(bu 4
Pod::Checker has been upgraded from version 1.74 to 1.75.
.IP \(bu 4
Pod::Html has been upgraded from version 1.33 to 1.34.
.IP \(bu 4
Pod::Usage has been upgraded from version 2.01 to 2.03.
.IP \(bu 4
podlators has been upgraded from version 4.14 to 5.01.
.IP \(bu 4
POSIX has been upgraded from version 2.03 to 2.13.
.IP \(bu 4
re has been upgraded from version 0.43 to 0.44.
.IP \(bu 4
Safe has been upgraded from version 2.43 to 2.44.
.IP \(bu 4
Scalar::Util has been upgraded from version 1.62 to 1.63.
.IP \(bu 4
SDBM_File has been upgraded from version 1.15 to 1.17.
.IP \(bu 4
Socket has been upgraded from version 2.033 to 2.036.
.IP \(bu 4
Storable has been upgraded from version 3.26 to 3.32.
.IP \(bu 4
Sys::Hostname has been upgraded from version 1.24 to 1.25.
.IP \(bu 4
Term::Cap has been upgraded from version 1.17 to 1.18.
.IP \(bu 4
Test::Simple has been upgraded from version 1.302190 to 1.302194.
.IP \(bu 4
Text::Balanced has been upgraded from version 2.04 to 2.06.
.IP \(bu 4
threads has been upgraded from version 2.27 to 2.36.
.IP \(bu 4
threads::shared has been upgraded from version 1.64 to 1.68.
.IP \(bu 4
Tie::File has been upgraded from version 1.06 to 1.07.
.IP \(bu 4
Time::HiRes has been upgraded from version 1.9770 to 1.9775.
.IP \(bu 4
Time::Piece has been upgraded from version 1.3401 to 1.3401_01.
.IP \(bu 4
Unicode::Normalize has been upgraded from version 1.31 to 1.32.
.IP \(bu 4
UNIVERSAL has been upgraded from version 1.14 to 1.15.
.IP \(bu 4
User::grent has been upgraded from version 1.03 to 1.04.
.IP \(bu 4
User::pwent has been upgraded from version 1.01 to 1.02.
.IP \(bu 4
utf8 has been upgraded from version 1.24 to 1.25.
.IP \(bu 4
warnings has been upgraded from version 1.58 to 1.65.
.IP \(bu 4
XS::APItest has been upgraded from version 1.22 to 1.32.
.IP \(bu 4
XSLoader has been upgraded from version 0.31 to 0.32.
.SH Documentation
.IX Header "Documentation"
.SS "New Documentation"
.IX Subsection "New Documentation"
\fIperlclass\fR
.IX Subsection "perlclass"
.PP
Describes the new \f(CW\*(C`class\*(C'\fR feature.
.PP
\fIperlclassguts\fR
.IX Subsection "perlclassguts"
.PP
Describes the internals of the new \f(CW\*(C`class\*(C'\fR feature.
.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
Documented \f(CW\*(C`hv_ksplit\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`hv_name_set\*(C'\fR
.IP \(bu 4
\&\f(CW\*(C`hv_store\*(C'\fR and \f(CW\*(C`hv_stores\*(C'\fR
documentation have been greatly improved.
.IP \(bu 4
Documented \f(CW\*(C`gv_autoload_pv\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`gv_autoload_pvn\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`gv_autoload_sv\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`gv_name_set\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`start_subparse\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`SV_CHECK_THINKFIRST_COW_DROP\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`SV_CHECK_THINKFIRST\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`SvPV_shrink_to_cur\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`save_aelem\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`save_aelem_flags\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`save_helem\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`save_helem_flags\*(C'\fR
.PP
\fIperldeprecation\fR
.IX Subsection "perldeprecation"
.IP \(bu 4
Added information about unscheduled deprecations and their categories.
.IP \(bu 4
Added category information for existing scheduled deprecations.
.IP \(bu 4
Added smartmatch and apostrophe as a package separator deprecation data.
.PP
\fIperlintern\fR
.IX Subsection "perlintern"
.IP \(bu 4
Documented \f(CW\*(C`save_pushptr\*(C'\fR
.IP \(bu 4
Documented \f(CW\*(C`save_scalar_at\*(C'\fR
.IP \(bu 4
Entries have been added to perlguts for the new \f(CW\*(C`newAV_alloc_x\*(C'\fR, \f(CW\*(C`newAV_alloc_xz\*(C'\fR and
\&\f(CW*_simple\fR functions.
.IP \(bu 4
References to the now-defunct PrePAN service have been removed from
perlcommunity and perlmodstyle.
.IP \(bu 4
A section on symbol naming has been added to perlhacktips.
.IP \(bu 4
perlexperiment has been edited to properly reference the warning categories
for the defer block modifier and extra paired delimiters for quote-like
operators.
.PP
\fIperlexperiment\fR
.IX Subsection "perlexperiment"
.IP \(bu 4
Smartmatch has been moved from experimental status to deprecated status.
Unfortunately the experiment did not work out.
.PP
\fIperlfunc\fR
.IX Subsection "perlfunc"
.IP \(bu 4
Some wording improvements have been made for the \f(CW\*(C`ucfirst\*(C'\fR, \f(CW\*(C`push\*(C'\fR,
\&\f(CW\*(C`unshift\*(C'\fR and \f(CW\*(C`bless\*(C'\fR functions, as well as additional examples added.
.PP
\fIperlhacktips\fR
.IX Subsection "perlhacktips"
.IP \(bu 4
A new section, "Writing safer macros" in perlhacktips has been added to discuss
pitfalls and solutions to using C macros in C and XS code.
.IP \(bu 4
A new section, "Choosing good symbol names" in perlhacktips, has been added to
discuss unexpected gotchas with names.
.PP
\fIperlop\fR
.IX Subsection "perlop"
.IP \(bu 4
Document the behavior of matching the empty pattern better and specify
its relationship to the new \f(CW\*(C`${^LAST_SUCCESSFUL_PATTERN}\*(C'\fR properly.
.PP
\fIperlvar\fR
.IX Subsection "perlvar"
.IP \(bu 4
Added a section on "Scoping Rules of Regex Variables", and other wording
improvements made throughout.
.IP \(bu 4
Added information on the new \f(CW\*(C`%{^HOOK}\*(C'\fR interface, and the new
\&\f(CW\*(C`require_\|_before\*(C'\fR and \f(CW\*(C`require_\|_after\*(C'\fR hooks which it exposes.
.IP \(bu 4
Correct information on the regex variables \f(CW\*(C`${^PREMATCH}\*(C'\fR, \f(CW\*(C`${^MATCH}\*(C'\fR
and \f(CW\*(C`${^POSTMATCH}\*(C'\fR, all of which were incorrectly documented due to an
oversight. Specifically they only work properly after a regex operation
that used the /p modifier to enable them.
.IP \(bu 4
Added information on the new regex variable \f(CW\*(C`${^LAST_SUCCESSFUL_PATTERN}\*(C'\fR,
which represents the pattern of the last successful regex match in scope.
.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
A new syntax error has been added for the error that a \f(CW\*(C`catch\*(C'\fR block does
not have its required variable declaration. See
catch block requires a (VAR)
.IP \(bu 4
Too many nested BEGIN blocks, maximum of \f(CW%d\fR allowed
.IP \(bu 4
Execution of \f(CW%s\fR aborted due to compilation errors.
.IP \(bu 4
Can't locate object method "INC", nor "INCDIR" nor string overload via
package "%s" \f(CW%s\fR in \f(CW@INC\fR
.IP \(bu 4
Attempt to bless into a class
.Sp
(F) You are attempting to call \f(CW\*(C`bless\*(C'\fR with a package name that is a
new-style \f(CW\*(C`class\*(C'\fR.  This is not necessary, as instances created by the
constructor are already in the correct class.  Instances cannot be created
by other means, such as \f(CW\*(C`bless\*(C'\fR.
.IP \(bu 4
Cannot assign :param(%s) to field \f(CW%s\fR because that name is already in use
.Sp
(F) An attempt was made to apply a parameter name to a field, when the name
is already being used by another field in the same class, or one of its
parent classes. This would cause a name clash so is not allowed.
.IP \(bu 4
Cannot create class \f(CW%s\fR as it already has a non-empty \f(CW@ISA\fR
.Sp
(F) An attempt was made to create a class out of a package that already has
an \f(CW@ISA\fR array, and the array is not empty.  This is not permitted, as it
would lead to a class with inconsistent inheritance.
.IP \(bu 4
Cannot invoke a method of "%s" on an instance of "%s"
.Sp
(F) You tried to directly call a \f(CW\*(C`method\*(C'\fR subroutine of one class by passing
in a value that is an instance of a different class.  This is not permitted,
as the method would not have access to the correct instance fields.
.IP \(bu 4
Cannot invoke method on a non-instance
.Sp
(F) You tried to directly call a \f(CW\*(C`method\*(C'\fR subroutine of a class by passing
in a value that is not an instance of that class.  This is not permitted, as
the method would not then have access to its instance fields.
.IP \(bu 4
Cannot '%s' outside of a 'class'
.Sp
(F) You attempted to use one of the keywords that only makes sense inside
a \f(CW\*(C`class\*(C'\fR definition, at a location that is not inside such a class.
.IP \(bu 4
Cannot reopen existing class "%s"
.Sp
(F) You tried to begin a \f(CW\*(C`class\*(C'\fR definition for a class that already exists.
A class may only have one definition block.
.IP \(bu 4
Can't bless an object reference
.Sp
(F) You attempted to call \f(CW\*(C`bless\*(C'\fR on a value that already refers to a real
object instance.
.IP \(bu 4
can't convert empty path
.Sp
(F) On Cygwin, you called a path conversion function with an empty path.
Only non-empty paths are legal.
.IP \(bu 4
Class already has a superclass, cannot add another
.Sp
(F) You attempted to specify a second superclass for a \f(CW\*(C`class\*(C'\fR by using
the \f(CW\*(C`:isa\*(C'\fR attribute, when one is already specified.  Unlike classes
whose instances are created with \f(CW\*(C`bless\*(C'\fR, classes created via the
\&\f(CW\*(C`class\*(C'\fR keyword cannot have more than one superclass.
.IP \(bu 4
Class attribute \f(CW%s\fR requires a value
.Sp
(F) You specified an attribute for a class that would require a value to
be passed in parentheses, but did not provide one.  Remember that
whitespace is \fBnot\fR permitted between the attribute name and its value;
you must write this as
.Sp
.Vb 1
\&    class Example::Class :attr(VALUE) ...
.Ve
.IP \(bu 4
Class :isa attribute requires a class but "%s" is not one
.Sp
(F) When creating a subclass using the \f(CW\*(C`class\*(C'\fR \f(CW\*(C`:isa\*(C'\fR attribute, the
named superclass must also be a real class created using the \f(CW\*(C`class\*(C'\fR
keyword.
.IP \(bu 4
Field already has a parameter name, cannot add another
.Sp
(F) A field may have at most one application of the \f(CW\*(C`:param\*(C'\fR attribute to
assign a parameter name to it; once applied a second one is not allowed.
.IP \(bu 4
Field attribute \f(CW%s\fR requires a value
.Sp
(F) You specified an attribute for a field that would require a value to
be passed in parentheses, but did not provide one.  Remember that
whitespace is \fBnot\fR permitted between the attribute name and its value;
you must write this as
.Sp
.Vb 1
\&    field $var :attr(VALUE) ...
.Ve
.IP \(bu 4
Field \f(CW%s\fR is not accessible outside a method
.Sp
(F) An attempt was made to access a field variable of a class from code
that does not appear inside the body of a \f(CW\*(C`method\*(C'\fR subroutine.  This is not
permitted, as only methods will have access to the fields of an instance.
.IP \(bu 4
Field \f(CW%s\fR of "%s" is not accessible in a method of "%s"
.Sp
(F) An attempt was made to access a field variable of a class, from a
method of another class nested inside the one that actually defined it.
This is not permitted, as only methods defined by a given class are
permitted to access fields of that class.
.IP \(bu 4
Only scalar fields can take a :param attribute
.Sp
(F) You tried to apply the \f(CW\*(C`:param\*(C'\fR attribute to an array or hash field.
Currently this is not permitted.
.IP \(bu 4
Required parameter '%s' is missing for \f(CW%s\fR constructor
.Sp
(F) You called the constructor for a class that has a required named
parameter, but did not pass that parameter at all.
.IP \(bu 4
Unexpected characters while parsing class :isa attribute: \f(CW%s\fR
.Sp
(F) You tried to specify something other than a single class name with an
optional trailing version number as the value for a \f(CW\*(C`class\*(C'\fR \f(CW\*(C`:isa\*(C'\fR
attribute.  This confused the parser.
.IP \(bu 4
Unrecognized class attribute \f(CW%s\fR
.Sp
(F) You attempted to add a named attribute to a \f(CW\*(C`class\*(C'\fR definition, but
perl does not recognise the name of the requested attribute.
.IP \(bu 4
Unrecognized field attribute \f(CW%s\fR
.Sp
(F) You attempted to add a named attribute to a \f(CW\*(C`field\*(C'\fR definition, but
perl does not recognise the name of the requested attribute.
.IP \(bu 4
${^HOOK}{%s} may only be a CODE reference or undef
.IP \(bu 4
Attempt to set unknown hook '%s' in %{^HOOK}
.IP \(bu 4
Missing or undefined argument to \f(CW%s\fR via %{^HOOK}{require_\|_before}
.IP \(bu 4
Too many capture groups (limit is \f(CW%d\fR) in regex m/%s/
.PP
\fINew Warnings\fR
.IX Subsection "New Warnings"
.IP \(bu 4
Unknown locale category \f(CW%d\fR
.Sp
This is a shortened form of an already existing diagnostic, for use when
there is no new locale being switched to.  The previous diagnostic was
misleading in such circumstances.
.IP \(bu 4
Locale '%s' is unsupported, and may crash the interpreter.
.IP \(bu 4
Treating \f(CW%s::INIT\fR block as BEGIN block as workaround
.IP \(bu 4
Filehandle STD%s reopened as \f(CW%s\fR only for input
.IP \(bu 4
\&\f(CW%s\fR on BEGIN block ignored
.IP \(bu 4
ADJUST is experimental
.Sp
(S experimental::class) This warning is emitted if you use the \f(CW\*(C`ADJUST\*(C'\fR
keyword of \f(CW\*(C`use feature \*(Aqclass\*(Aq\*(C'\fR.  This keyword is currently
experimental and its behaviour may change in future releases of Perl.
.IP \(bu 4
class is experimental
.Sp
(S experimental::class) This warning is emitted if you use the \f(CW\*(C`class\*(C'\fR
keyword of \f(CW\*(C`use feature \*(Aqclass\*(Aq\*(C'\fR.  This keyword is currently
experimental and its behaviour may change in future releases of Perl.
.IP \(bu 4
Method \f(CW%s\fR redefined
.Sp
(W redefine) You redefined a method.  To suppress this warning, say
.Sp
.Vb 4
\&    {
\&       no warnings \*(Aqredefine\*(Aq;
\&       *name = method { ... };
\&    }
.Ve
.IP \(bu 4
Odd number of elements in hash field initialization
.Sp
(W misc) You specified an odd number of elements to initialise a hash
field of an object.  Hashes are initialised from a list of key/value
pairs so there must be a corresponding value to every key.  The final
missing value will be filled in with undef instead.
.IP \(bu 4
Old package separator "'" deprecated
.Sp
(W deprecated, syntax) You used the old package separator "'" in a
variable, subroutine or package name.  Support for the old package
separator will be removed in Perl 5.40.
.IP \(bu 4
field is experimental
.Sp
(S experimental::class) This warning is emitted if you use the \f(CW\*(C`field\*(C'\fR
keyword of \f(CW\*(C`use feature \*(Aqclass\*(Aq\*(C'\fR.  This keyword is currently
experimental and its behaviour may change in future releases of Perl.
.IP \(bu 4
method is experimental
.Sp
(S experimental::class) This warning is emitted if you use the \f(CW\*(C`method\*(C'\fR
keyword of \f(CW\*(C`use feature \*(Aqclass\*(Aq\*(C'\fR.  This keyword is currently
experimental and its behaviour may change in future releases of Perl.
.IP \(bu 4
Can't call destructor for 0x%p in global destruction
.SS "Changes to Existing Diagnostics"
.IX Subsection "Changes to Existing Diagnostics"
.IP \(bu 4
The compiler will now stop parsing on the first syntax error it
encounters. Historically the compiler would attempt to "skip past" the
error and continue parsing so that it could list multiple errors. For
things like undeclared variables under strict this makes sense. For
syntax errors however it has been found that continuing tends to result
in a storm of unrelated or bizarre errors that mostly just obscure the
true error. In extreme cases it can even lead to segfaults and other
incorrect behavior.
.Sp
Therefore we have reformed the continuation logic so that the parse will
stop after the first seen syntax error. Semantic errors like undeclared
variables will not stop the parse, so you may still see multiple errors
when compiling code. However if there is a syntax error it will be the
last error message reported by perl and all of the errors that you see
will be something that actually needs to be fixed.
.IP \(bu 4
Error messages that output class or package names have been modified to
output double quoted strings with various characters escaped so as to
make the exact value clear to a reader. The exact rules on which
characters are escaped may change over time but currently are that
printable ASCII codepoints, with the exception of \f(CW\*(C`"\*(C'\fR and \f(CW\*(C`\e\*(C'\fR, and
unicode word characters whose codepoint is over 255 are output raw, and
any other symbols are escaped much as Data::Dumper might escape them,
using \f(CW\*(C`\en\*(C'\fR for newline and \f(CW\*(C`\e"\*(C'\fR for double quotes, etc. Codepoints in
the range 128\-255 are always escaped as they can cause trouble on
unicode terminals when output raw.
.Sp
In older versions of perl the one liner
.Sp
.Vb 1
\&    $ perl \-le\*(Aq"thing\en"\->foo()\*(Aq
.Ve
.Sp
would output the following error message exactly as shown here, with
text spread over multiple lines because the "\en" would be emitted as
a raw newline character:
.Sp
.Vb 3
\&    Can\*(Aqt locate object method "foo" via package "thing
\&    " (perhaps you forgot to load "thing
\&    "?) at \-e line 1.
.Ve
.Sp
As of this release we would output this instead (as one line):
.Sp
.Vb 2
\&    Can\*(Aqt locate object method "foo" via package "thing\en"
\&      (perhaps you forgot to load "thing\en"?) at \-e line 1.
.Ve
.Sp
Notice the newline in the package name has been quoted and escaped, and
thus the error message is a single line. The text is shown here wrapped
to two lines only for readability.
.IP \(bu 4
When package or class names in errors are very large the middle excess
portion will be elided from the message. As of this release error messages
will show only up to the first 128 characters and the last 128 characters
in a package or class name in error messages. For example
.Sp
.Vb 1
\& $ perl \-le\*(Aq("Foo" x 1000)\->new()\*(Aq
.Ve
.Sp
will output the following as one line:
.Sp
.Vb 10
\& Can\*(Aqt locate object method "new" via package "FooFooFooFooFooFooFoo
\& FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
\& FooFooFooFooFooFooFooFooFooFooFooFooFooFo"..."oFooFooFooFooFooFooFoo
\& FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
\& FooFooFooFooFooFooFooFooFooFooFooFooFoo" (perhaps you forgot to load
\& "FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
\& FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFo"...
\& "oFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
\& FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo"?)
\& at \-e line 1.
.Ve
.Sp
Notice the \f(CW "prefix"..."suffix" \fR form of the package name in this case.
In previous versions of perl the complete string would have been shown
making the error message over 6k long and there was no upper limit on the
length of the error message at all. If you accidentally used a 1MB string
as a class name then the error message would be over 2MB long. In this perl
the upper limit should be around 2k when eliding and escaping are taken into
account.
.IP \(bu 4
Removed \f(CW\*(C`Complex regular subexpression recursion limit (%d) exceeded\*(C'\fR
.Sp
The regular expresion engine has not used recursion in some time. This
warning no longer makes sense.
.Sp
See [GH #19636 <https://github.com/Perl/perl5/pull/19636>].
.IP \(bu 4
Various warnings that used to produce parenthesized hints underneath the
main warning message and after its "location data" were chanaged to put
the hint inline with the main message. For instance:
.Sp
.Vb 2
\& Bareword found where operator expected at \-e line 1, near "foo bar"
\&     (Do you need to predeclare foo?)
.Ve
.Sp
will now look like this but as one line:
.Sp
.Vb 2
\& Bareword found where operator expected (Do you need to predeclare
\& foo?) at \-e line 1, near "foo bar"
.Ve
.Sp
as a result such warnings will no longer trigger \f(CW$SIG{_\|_WARN_\|_}\fR
twice, and the hint will be visible when fatal warnings is in effect.
.IP \(bu 4
The error message that is produced when a \f(CW\*(C`require\*(C'\fR or \f(CW\*(C`use\*(C'\fR statement
fails has been changed. It used to contain the words \f(CW\*(C`@INC contains:\*(C'\fR,
and it used to show the state of \f(CW@INC\fR *after* the require had
completed and failed. The error message has been changed to say \f(CW\*(C`@INC
entries checked:\*(C'\fR and to reflect the actual directories or hooks that
were executed during the require statement. For example:
.Sp
.Vb 4
\&    perl \-e\*(Aqpush @INC, sub {@INC=()}; eval "require Frobnitz"
\&        or die $@\*(Aq
\&    Can\*(Aqt locate Frobnitz.pm in @INC (you may need to install the
\&    Frobnitz module) (@INC contains:) at (eval 1) line 1.
.Ve
.Sp
Will change to (with some output elided for clarity):
.Sp
.Vb 7
\&    perl \-e\*(Aqpush @INC, sub {@INC=()}; eval "require Frobnitz"
\&        or die $@\*(Aq
\&    Can\*(Aqt locate Frobnitz.pm in @INC (you may need to install the
\&    Frobnitz module) (@INC entries checked:
\&    .../site_perl/5.38.0/x86_64\-linux .../site_perl/5.38.0
\&    .../5.38.0/x86_64\-linux .../5.38.0 CODE(0x562745e684b8))
\&    at (eval 1) line 1.
.Ve
.Sp
thus showing the actual directories checked. Code that checks for
\&\f(CW\*(C`@INC contains:\*(C'\fR in error messages should be hardened against any future
wording changes between the \f(CW@INC\fR and \f(CW\*(C`:\*(C'\fR, for instance use
\&\f(CW\*(C`qr/\e@INC[ \ew]+:/\*(C'\fR instead of using \f(CW\*(C`qr/\e@INC contains:/\*(C'\fR or
\&\f(CW\*(C`qr/\e@INC entries checked:/\*(C'\fR in tests as this will ensure both forward
and backward compatibility.
.IP \(bu 4
Old package separator used in string
.Sp
This diagnostic is now also part of the \f(CW\*(C`deprecated\*(C'\fR category.
.IP \(bu 4
given is deprecated replaces \f(CW\*(C`given is experimental\*(C'\fR.
.IP \(bu 4
when is deprecated replaces \f(CW\*(C`when is experimental\*(C'\fR.
.IP \(bu 4
Smartmatch is deprecated replaces \f(CW\*(C`Smartmatch is experimental\*(C'\fR.
.SH "Configuration and Compilation"
.IX Header "Configuration and Compilation"
.IP \(bu 4
\&\f(CW\*(C`make \-j6 minitest\*(C'\fR could fail due to a build conflict in building
\&\f(CW\*(C`$(MINIPERL_EXE)\*(C'\fR between the main make process and a child process.
[GH #19829 <https://github.com/Perl/perl5/issues/19829>]
.IP \(bu 4
Properly populate osvers on Dragonfly BSD when the hostname isn't set.
.IP \(bu 4
Fix typos for C99 macro name \f(CW\*(C`PRIX64\*(C'\fR.
.IP \(bu 4
Remove ancient and broken GCC for VMS support
.IP \(bu 4
Remove vestigial reference to \f(CW\*(C`/VAXC\*(C'\fR qualifier
.IP \(bu 4
Remove sharedperl option on VMS
.IP \(bu 4
VMS now has mkostemp
.IP \(bu 4
\&\f(CW\*(C`Configure\*(C'\fR now properly handles quoted elements outputted by gcc.
[GH #20606 <https://github.com/Perl/perl5/issues/20606>]
.IP \(bu 4
\&\f(CW\*(C`Configure\*(C'\fR probed for the return type of \fBmalloc()\fR and \fBfree()\fR by
testing whether declarations for those functions produced a function
type mismatch with the implementation.  On Solaris, with a C++
compiler, this check always failed, since Solaris instead imports
\&\fBmalloc()\fR and \fBfree()\fR from \f(CW\*(C`std::\*(C'\fR with \f(CW\*(C`using\*(C'\fR for C++ builds.  Since
the return types of \fBmalloc()\fR and \fBfree()\fR are well defined by the C
standard, skip probing for them.  \f(CW\*(C`Configure\*(C'\fR command-line arguments
and hints can still override these type in the unlikely case that is
needed.  [GH #20806 <https://github.com/Perl/perl5/issues/20806>]
.SH Testing
.IX Header "Testing"
Tests were added and changed to reflect the other additions and
changes in this release.  Furthermore, these significant changes were
made:
.IP \(bu 4
Unicode normalization tests have been added.
.IP \(bu 4
t/test.pl: Add ability to cancel an watchdog timer
.SH "Platform Support"
.IX Header "Platform Support"
.SS "Discontinued Platforms"
.IX Subsection "Discontinued Platforms"
.IP Ultrix 4
.IX Item "Ultrix"
Support code for DEC Ultrix has been removed.  Ultrix was the native
Unix-like operating system for various Digital Equipment Corporation
machines.  Its final release was in 1995.
.SS "Platform-Specific Notes"
.IX Subsection "Platform-Specific Notes"
.IP DragonflyBSD 4
.IX Item "DragonflyBSD"
Skip tests to workaround an apparent bug in \f(CWsetproctitle()\fR.
[GH #19894 <https://github.com/Perl/perl5/issues/19894>]
.IP FreeBSD 4
.IX Item "FreeBSD"
FreeBSD no longer uses thread-safe locale operations, to avoid a bug in
FreeBSD <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265950>
.Sp
Replace the first part of archname with \f(CW\*(C`uname \-p\*(C'\fR
[GH #19791 <https://github.com/Perl/perl5/issues/19791>]
.IP Solaris 4
.IX Item "Solaris"
Avoid some compiler and compilation issues on NetBSD/Solaris from regexec.c and regcomp.c.
.IP Synology 4
.IX Item "Synology"
Update Synology Readme for DSM 7.
.IP Windows 4
.IX Item "Windows"
Fix win32 memory alignment needed for gcc\-12 from vmem.h.
.Sp
\&\fButimes()\fR on Win32 would print a message to stderr if it failed to
convert a supplied \f(CW\*(C`time_t\*(C'\fR to to a \f(CW\*(C`FILETIME\*(C'\fR.
[GH #19668 <https://github.com/Perl/perl5/issues/19668>]
.Sp
In some cases, timestamps returned by \fBstat()\fR and
\&\fBlstat()\fR failed to take daylight saving time into account.
[GH #20018 <https://github.com/Perl/perl5/issues/20018>]
[GH #20061 <https://github.com/Perl/perl5/issues/20061>]
.Sp
\&\fBstat()\fR now works on \f(CW\*(C`AF_UNIX\*(C'\fR socket files.
[GH #20204 <https://github.com/Perl/perl5/issues/20204>]
.Sp
\&\fBreadlink()\fR now returns the \f(CW\*(C`PrintName\*(C'\fR from a symbolic link reparse
point instead of the \f(CW\*(C`SubstituteName\*(C'\fR, which should make it better
match the name the link was created with.
[GH #20271 <https://github.com/Perl/perl5/pull/20271>]
.Sp
\&\fBlstat()\fR on Windows now returns the length of the link target as the
size of the file, as it does on POSIX systems.
[GH #20476 <https://github.com/Perl/perl5/issues/20476>]
.Sp
\&\fBsymlink()\fR on Windows now replaces any \f(CW\*(C`/\*(C'\fR in the target with \f(CW\*(C`\e\*(C'\fR,
since Windows does not recognise \f(CW\*(C`/\*(C'\fR in symbolic links.  The reverse
translation is \fBnot\fR done by \fBreadlink()\fR.
[GH #20506 <https://github.com/Perl/perl5/issues/20506>]
.Sp
\&\fBsymlink()\fR where the target was an absolute path to a directory was
incorrectly created as a file symbolic link.
[GH #20533 <https://github.com/Perl/perl5/issues/20533>]
.Sp
\&\f(CW\*(C`POSIX::dup2\*(C'\fR no longer creates broken sockets. [GH
#20920 <https://github.com/Perl/perl5/issues/20920>]
.Sp
Closing a busy pipe could cause Perl to hang. [GH
#19963 <https://github.com/Perl/perl5/issues/19963>]
.SH "Internal Changes"
.IX Header "Internal Changes"
.IP \(bu 4
Removed many deprecated C functions.
.Sp
These have been deprecated for a long time. See
<https://github.com/perl/perl5/commit/7008caa915ad99e650acf2aea40612b5e48b7ba2>
for a full list.
.IP \(bu 4
\&\f(CW\*(C`get_op_descs\*(C'\fR, \f(CW\*(C`get_op_names\*(C'\fR, \f(CW\*(C`get_opargs\*(C'\fR, \f(CW\*(C`get_no_modify\*(C'\fR and
\&\f(CW\*(C`get_ppaddr\*(C'\fR have been marked deprecated.
.IP \(bu 4
\&\f(CW\*(C`hv_free_ent\*(C'\fR has been marked as internal API.
.IP \(bu 4
\&\f(CW\*(C`save_pushptr\*(C'\fR, \f(CW\*(C`save_pushptrptr\*(C'\fR, and \f(CW\*(C`save_pushi32ptr\*(C'\fR have been marked
as internal API.
.IP \(bu 4
New bool related functions and macros have been added to complement the new
bool type introduced in 5.36:
.Sp
The functions are:
.RS 4
.ie n .IP """newSVbool(const bool bool_val)""" 4
.el .IP "\f(CWnewSVbool(const bool bool_val)\fR" 4
.IX Item "newSVbool(const bool bool_val)"
.PD 0
.ie n .IP newSV_true() 4
.el .IP \f(CWnewSV_true()\fR 4
.IX Item "newSV_true()"
.ie n .IP newSV_false() 4
.el .IP \f(CWnewSV_false()\fR 4
.IX Item "newSV_false()"
.ie n .IP """sv_set_true(SV *sv)""" 4
.el .IP "\f(CWsv_set_true(SV *sv)\fR" 4
.IX Item "sv_set_true(SV *sv)"
.ie n .IP """sv_set_false(SV *sv)""" 4
.el .IP "\f(CWsv_set_false(SV *sv)\fR" 4
.IX Item "sv_set_false(SV *sv)"
.ie n .IP """sv_set_bool(SV *sv, const bool bool_val)""" 4
.el .IP "\f(CWsv_set_bool(SV *sv, const bool bool_val)\fR" 4
.IX Item "sv_set_bool(SV *sv, const bool bool_val)"
.RE
.RS 4
.PD
.Sp
The macros are:
.ie n .IP SvIandPOK(sv) 4
.el .IP \f(CWSvIandPOK(sv)\fR 4
.IX Item "SvIandPOK(sv)"
.PD 0
.ie n .IP SvIandPOK_off(sv) 4
.el .IP \f(CWSvIandPOK_off(sv)\fR 4
.IX Item "SvIandPOK_off(sv)"
.ie n .IP """SvIandPOK_on""" 4
.el .IP \f(CWSvIandPOK_on\fR 4
.IX Item "SvIandPOK_on"
.RE
.RS 4
.RE
.IP \(bu 4
.PD
Perl is no longer manipulating the \f(CW\*(C`environ\*(C'\fR array directly. The variable
\&\f(CW\*(C`PL_use_safe_putenv\*(C'\fR has been removed and \f(CW\*(C`PERL_USE_SAFE_PUTENV\*(C'\fR is always
defined. This means XS modules can now call \f(CW\*(C`setenv\*(C'\fR and \f(CW\*(C`putenv\*(C'\fR without
causing segfaults. [perl #19399 <https://github.com/Perl/perl5/issues/19399>]
.IP \(bu 4
Internal C API functions are now hidden with \f(CW\*(C`_\|_attribute_\|_((hidden))\*(C'\fR on the
platforms that support it. This means they are no longer callable from XS
modules on those platforms.
.Sp
It should be noted that those functions have always been hidden on Windows. This
change merely brings that to the other platforms.
[perl #19655 <https://github.com/Perl/perl5/pull/19655>]
.IP \(bu 4
New formatting symbols were added for printing values declared as \f(CW\*(C`U32\*(C'\fR or
\&\f(CW\*(C`I32\*(C'\fR:
.RS 4
.ie n .IP "I32df \-\- Like %d" 4
.el .IP "I32df \-\- Like \f(CW%d\fR" 4
.IX Item "I32df -- Like %d"
.PD 0
.ie n .IP "U32of \-\- Like %o" 4
.el .IP "U32of \-\- Like \f(CW%o\fR" 4
.IX Item "U32of -- Like %o"
.ie n .IP "U32uf \-\- Like %u" 4
.el .IP "U32uf \-\- Like \f(CW%u\fR" 4
.IX Item "U32uf -- Like %u"
.ie n .IP "U32xf \-\- Like %x" 4
.el .IP "U32xf \-\- Like \f(CW%x\fR" 4
.IX Item "U32xf -- Like %x"
.ie n .IP "U32Xf \-\- Like %X" 4
.el .IP "U32Xf \-\- Like \f(CW%X\fR" 4
.IX Item "U32Xf -- Like %X"
.RE
.RS 4
.PD
.Sp
These are used in the same way already existing similar symbols, such as
\&\f(CW\*(C`IVdf\*(C'\fR, are used.  See "I/O Formats" in perlapi.
.RE
.IP \(bu 4
new 'HvHasAUX' macro
.IP \(bu 4
regexec.c: Add some branch predictions reorder conds
.IP \(bu 4
locale: Change macro name to be C conformant
.IP \(bu 4
Rename the \f(CW\*(C`PADNAMEt_*\*(C'\fR constants to \f(CW\*(C`PADNAMEf_*\*(C'\fR
.IP \(bu 4
Changes all the API macros that retrieve a PV into a call to an
inline function so as to evaluate the parameter just once.
.IP \(bu 4
regexec.c: multiple code refactor to make the code more readable
.IP \(bu 4
perl.h: Change macro name to be C conformant
(remove leading _ from NOT_IN_NUMERIC macros)
.IP \(bu 4
regcomp.h: add new \f(CW\*(C`BITMAP_BIT\*(C'\fR macro in addition to the existing \f(CW\*(C`BITMAP_BYTE\*(C'\fR
and \f(CW\*(C`BITMAP_TEST\*(C'\fR ones.
.IP \(bu 4
Create new regnode type ANYOFH.
populate_ANYOF_from_invlist was renamed to populate_bitmap_from_invlist
.IP \(bu 4
regex: Refactor bitmap vs non-bitmap of qr/[]/
.IP \(bu 4
regcomp.c: add new functions to convert from an inversion list to a bitmap (and vice versa)
\&\f(CW\*(C`populate_bitmap_from_invlist\*(C'\fR and \f(CW\*(C`populate_invlist_from_bitmap\*(C'\fR.
.IP \(bu 4
Add \f(CWnewAVav()\fR to create an AV from an existing AV.
Add \f(CWnewAVhv()\fR to create an AV using keys and values from an existing HV.
.IP \(bu 4
Fix definition of \f(CW\*(C`Perl_atof\*(C'\fR.
.IP \(bu 4
Fix undefined behavior with overflow related \f(CW\*(C`OPTIMIZE_INFTY\*(C'\fR and delta
in \fIregcomp.c\fR.
.IP \(bu 4
Fix regnode pointer alignment issue in \fIregcomp.h\fR.
.IP \(bu 4
The \f(CW\*(C`CVf_METHOD\*(C'\fR CV flag and associated \f(CW\*(C`CvMETHOD\*(C'\fR macro has been renamed to
\&\f(CW\*(C`CVf_NOWARN_AMBIGUOUS\*(C'\fR and \f(CW\*(C`CvNOWARN_AMBIGUOUS\*(C'\fR. This closer reflects its
actual behaviour (it suppresses a warning that would otherwise be generated
about ambiguous names), in order to be less confusing with \f(CW\*(C`CvIsMETHOD\*(C'\fR,
which indicates that a CV is a \f(CW\*(C`method\*(C'\fR subroutine relating to the \f(CW\*(C`class\*(C'\fR
feature.
.IP \(bu 4
The \f(CW\*(C`OPf_SPECIAL\*(C'\fR flag is no longer set on the \f(CW\*(C`OP_ENTERSUB\*(C'\fR op
constructed to call the \f(CW\*(C`VERSION\*(C'\fR, \f(CW\*(C`import\*(C'\fR and \f(CW\*(C`unimport\*(C'\fR methods
as part of a \f(CW\*(C`use\*(C'\fR statement and attribute application, nor when
assigning to an \f(CW\*(C`:lvalue\*(C'\fR subroutine.
.IP \(bu 4
A new CV flag \f(CW\*(C`CVf_REFCOUNTED_ANYSV\*(C'\fR has been added, which indicates that the
CV is an XSUB and stores an SV pointer in the \f(CW\*(C`CvXSUBANY.any_sv\*(C'\fR union field.
Perl core operations such as cloning or destroying the CV will maintain the
reference count of the pointed-to SV, destroying it when required.
.IP \(bu 4
A new API function "\f(CW\*(C`Perl_localeconv\*(C'\fR" in perlapi is added.  This is the
same as \f(CW\*(C`POSIX::localeconv\*(C'\fR (returning a hash of
the \f(CWlocaleconv()\fR fields), but directly callable from XS code.
.IP \(bu 4
A new API function, "\f(CW\*(C`Perl_langinfo8\*(C'\fR" in perlapi is added.  This is the
same as plain "\f(CW\*(C`Perl_langinfo\*(C'\fR" in perlapi, but with an extra parameter
that allows the caller to simply and reliably know if the returned
string is UTF\-8.
.IP \(bu 4
We have introduced a limit on the number of nested \f(CW\*(C`eval EXPR\*(C'\fR/\f(CW\*(C`BEGIN\*(C'\fR
blocks and \f(CW\*(C`require\*(C'\fR/\f(CW\*(C`BEGIN\*(C'\fR (and thus \f(CW\*(C`use\*(C'\fR statements as well) to
prevent C stack overflows. This variable can also be used to forbid
\&\f(CW\*(C`BEGIN\*(C'\fR blocks from executing during \f(CW\*(C`eval EXPR\*(C'\fR compilation. The
limit defaults to \f(CW1000\fR but can be overridden by setting the
\&\f(CW\*(C`${^MAX_NESTED_EVAL_BEGIN_BLOCKS}\*(C'\fR variable. The default itself can be
changed at compile time with
.Sp
.Vb 1
\&    \-Accflags=\*(Aq\-DPERL_MAX_NESTED_EVAL_BEGIN_BLOCKS_DEFAULT=12345\*(Aq
.Ve
.Sp
Note that this value relates to the size of your C stack and if you
choose an inappropriately large value Perl may segfault, be conservative
about what you choose.
.IP \(bu 4
A new magic type \f(CW\*(C`PERL_MAGIC_extvalue\*(C'\fR has been added. This is available for
use like \f(CW\*(C`PERL_MAGIC_ext\*(C'\fR, but is a value magic: upon localization the new
value will not be magical.
.IP \(bu 4
The \f(CWSSNEW()\fR, \f(CWSSNEWt()\fR, \f(CWSSNEWa()\fR and \f(CWSSNEWat()\fR APIs now
return a \f(CW\*(C`SSize_t\*(C'\fR value.  The \f(CWSSPTR()\fR and \f(CWSSPTRt()\fR macros now
expect a \f(CW\*(C`SSize_t\*(C'\fR parameter, and enforce that on debugging builds.
[GH #20411 <https://github.com/Perl/perl5/issues/20411>]
.IP \(bu 4
Filenames in cops are now refcounted under threads.
Under threads we were copying the filenames into each opcode. This is because in
theory opcodes created in one thread can be destroyed in another.
The change adds a new struct/type \f(CW\*(C`RCPV\*(C'\fR, which is a refcounted
string using shared memory. This is implemented in such a way that code
that previously used a char * can continue to do so, as the refcounting
data is located a specific offset before the char * pointer itself.
.IP \(bu 4
Added \f(CW\*(C`HvNAMEf\*(C'\fR and \f(CW\*(C`HvNAMEf_QUOTEDPREFIX\*(C'\fR special formats. They take an
\&\f(CW\*(C`HV *\*(C'\fR as an argument and use \f(CWHvNAME()\fR and related macros to determine the
string, its length, and whether it is utf8.
.IP \(bu 4
The underlying \f(CW\*(C`Perl_dowantarray\*(C'\fR function implementing the
long-deprecated \f(CW\*(C`GIMME\*(C'\fR macro has been marked as
deprecated, so that use of the macro emits a compile-time warning.
\&\f(CW\*(C`GIMME\*(C'\fR has been documented as deprecated in favour of
\&\f(CW\*(C`GIMME_V\*(C'\fR since Perl v5.6.0, but had not
previously issued a warning.
.IP \(bu 4
The API function "utf8_length" in perlapi is now more efficient.
.IP \(bu 4
Added \f(CWSAVERCPV()\fR and \f(CWSAVEFREERCPV()\fR for better support for working
with \f(CW\*(C`RCPV\*(C'\fR (reference counted string/pointer value) structures which
currently are used in opcodes to share filename and warning bit data in
a memory efficient manner.
.IP \(bu 4
Added \f(CWMORTALSVFUNC_SV()\fR and \f(CWMORTALDESTRUCTOR_SV()\fR macros, which
make it possible to create a destructor which is fired at the end of
the current statement. This uses the \f(CW\*(C`PERL_MAGIC_destruct\*(C'\fR magic to
use "free" magic to trigger an action when a variable is freed. The
action can be specified as a C function or as a Perl code reference.
.IP \(bu 4
Added the \f(CW\*(C`%{^HOOK}\*(C'\fR api and related \f(CW\*(C`PERL_MAGIC_hook\*(C'\fR and
\&\f(CW\*(C`PERL_MAGIC_hookelem\*(C'\fR for providing ways to hook selected perl functions
which for one reason or another are problematic to wrap with a customized
subroutine.
.IP \(bu 4
Added support for \f(CW\*(C`${^HOOK}{require_\|_before}\*(C'\fR which can be used to
rewrite the filename that \f(CW\*(C`require\*(C'\fR will try to load, and also to block
\&\f(CW\*(C`require\*(C'\fR from loading a specific module, even via fully qualified
filename. The hook can also be used to perform "pre-require" and
"post-require" actions.
.IP \(bu 4
Added support for \f(CW\*(C`${^HOOK}{require_\|_after}\*(C'\fR which can be used to
track what modules have been required after the fact.
.IP \(bu 4
Regular expression opcodes (regops) now use a standardized structure
layout that uses unions to expose data in different format. This means
it should be much easier to extend or modify regops to use more memory.
This has been used to make a number of regops track how many parens
they contain.
.SH "Selected Bug Fixes"
.IX Header "Selected Bug Fixes"
.IP \(bu 4
Avoid recursion and stack overflow parsing 'pack' template
.Sp
[GH #16319 <https://github.com/Perl/perl5/issues/16319>]
.IP \(bu 4
An \fBeval()\fR as the last statement in a regex code block could trigger an
interpreter panic; e.g.
.Sp
.Vb 1
\&    /(?{ ...; eval {....}; })/
.Ve
.Sp
[GH #19680 <https://github.com/Perl/perl5/issues/19680>]
.IP \(bu 4
Disabling the \f(CW\*(C`bareword_filehandles\*(C'\fR feature no longer treats \f(CW\*(C`print
Class\->method\*(C'\fR as an error.  [GH #19704 <https://github.com/Perl/perl5/issues/19704>]
.IP \(bu 4
When a Perl subroutine tail-calls an XS subroutine using \f(CW\*(C`goto &xs_sub\*(C'\fR,
the XS subroutine can now correctly determine its calling context.
Previously it was always reported as scalar.
.Sp
In addition, where the Perl subroutine is freed at the same time:
.Sp
.Vb 1
\&    sub foo { *foo = sub {}; goto &xs_sub }
.Ve
.Sp
this formerly could lead to crashes if the XS subroutine tried to use the
value of \f(CW\*(C`PL_op\*(C'\fR, since this was being set to NULL. This is now fixed.
.Sp
[GH #19936 <https://github.com/Perl/perl5/issues/19936>]
.IP \(bu 4
\&\fBsetsockopt()\fR now uses the mechanism added in 5.36 to better
distinguish between numeric and string values supplied as the
\&\f(CW\*(C`OPTVAL\*(C'\fR parameter.  [GH #18761 <https://github.com/Perl/perl5/issues/18761>]
.IP \(bu 4
4\-argument \f(CWselect()\fR now rejects strings with code points above
255. Additionally, for code points 128\-255, this operator will now always
give the corresponding octet to the OS, regardless of how Perl stores
such code points in memory. (Previously Perl leaked its internal string
storage to the OS.) [GH #19882 <https://github.com/Perl/perl5/issues/19882>]
.IP \(bu 4
Fix panic issue from \f(CW\*(C`val {} inside /(?{...})/\*(C'\fR [GH #19390 <https://github.com/Perl/perl5/issues/19390>]
.IP \(bu 4
Fix multiple compiler warnings from \fIregexp.c\fR, \fIlocale.c\fR
[GH #19915 <https://github.com/Perl/perl5/issues/19915>]
.IP \(bu 4
Fix a bug with querying locales on platforms that don't have \f(CW\*(C`LC_NUMERIC\*(C'\fR
[GH #19890 <https://github.com/Perl/perl5/issues/19890>]
.IP \(bu 4
Prevent undefined behaviour in \f(CWS_maybe_multideref()\fR.
.IP \(bu 4
Avoid signed integer overflow in \f(CW\*(C`use integer\*(C'\fR ops.
.IP \(bu 4
Avoid adding an offset to a NULL pointer in \f(CW\*(C`hv_delete_common\*(C'\fR.
.IP \(bu 4
PerlIO::get_layers will now accept IO references too
.Sp
Previously it would only take glob references or names of globs. Now it will
also accept IO references.
.IP \(bu 4
Fixes to memory handling for \f(CW\*(C`PL_splitstr\*(C'\fR:
.RS 4
.IP \(bu 4
If a thread was created the allocated string would be freed twice.
.IP \(bu 4
If two \f(CW\*(C`\-F\*(C'\fR switches were supplied the memory allocated for the first
switch wouldn't be freed.
.RE
.RS 4
.RE
.IP \(bu 4
Correctly handle \f(CW\*(C`OP_ANONCODE\*(C'\fR ops generated by CPAN modules that
don't include the OPf_REF flag when propagating lvalue context.
[GH #20532 <https://github.com/Perl/perl5/pull/20532>]
.IP \(bu 4
POSIX::strxfrm now uses the \f(CW\*(C`LC_CTYPE\*(C'\fR locale category
to specify its collation, ignoring any differing \f(CW\*(C`LC_COLLATE\*(C'\fR.  It
doesn't make sense for a string to be encoded in one locale (say,
ISO\-8859\-6, Arabic) and to collate it based on another (like ISO\-8859\-7,
Greek).  Perl assumes that the current \f(CW\*(C`LC_CTYPE\*(C'\fR locale correctly
represents the encoding, and collates accordingly.
.Sp
Also, embedded \f(CW\*(C`NUL\*(C'\fR characters are now allowed in the input.
.Sp
If locale collation is not enabled on the platform (\f(CW\*(C`LC_COLLATE\*(C'\fR), the
input is returned unchanged.
.IP \(bu 4
Double FETCH during stringification of tied scalars returning an
overloaded object have been fixed. The FETCH method should only be
called once, but prior to this release was actually called twice.
[GH #20574 <https://github.com/Perl/perl5/pull/20574>]
.IP \(bu 4
Writing to a magic variables associated with the selected output
handle, \f(CW$^\fR, \f(CW$~\fR, \f(CW$=\fR, \f(CW\*(C`$\-\*(C'\fR and \f(CW$%\fR, no longer crashes perl
if the IO object has been cleared from the selected output
handle. [GH #20733 <https://github.com/Perl/perl5/issues/20733>]
.IP \(bu 4
Redefining a \f(CW\*(C`use constant\*(C'\fR list constant with \f(CW\*(C`use constant\*(C'\fR now
properly warns.  This changes the behaviour of \f(CW\*(C`use constant\*(C'\fR but is
a core change, not a change to \fIconstant.pm\fR.  [GH #20742 <https://github.com/Perl/perl5/issues/20742>]
.IP \(bu 4
Redefining a \f(CW\*(C`use constant\*(C'\fR list constant with an empty prototype
constant sub would result in an assertion failure.  [GH #20742 <https://github.com/Perl/perl5/issues/20742>]
.IP \(bu 4
Fixed a regression where the \f(CW\*(C`INC\*(C'\fR method for objects in \f(CW@INC\fR
would not be resolved by \f(CW\*(C`AUTOLOAD\*(C'\fR, while it was in 5.36.  The
\&\f(CW\*(C`INCDIR\*(C'\fR method for objects in \f(CW@INC\fR cannot be resolved by
\&\f(CW\*(C`AUTOLOAD\*(C'\fR as \f(CW\*(C`INC\*(C'\fR would have been resolved first.  [GH #20665 <https://github.com/Perl/perl5/issues/20665>]
.IP \(bu 4
\&\f(CW$SIG{_\|_DIE_\|_}\fR will now be called from eval when the code dies during
compilation regardless of how it dies. This means that code expecting to
be able to upgrade \f(CW$@\fR into an object will be called consistently. In
earlier versions of perl \f(CW$SIG{_\|_DIE_\|_}\fR would not be called for
certain compilation errors, for instance undeclared variables. For other
errors it might be called if there were more than a certain number of
errors, but not if there were less. Now you can expect that it will be
called in every case.
.IP \(bu 4
Compilation of code with errors used to inconsistently stop depending on
the count and type of errors encountered. The intent was that after 10
errors compilation would halt, but bugs in this logic meant that certain
types of error would be counted, but would not trigger the threshold
check to stop compilation. Other errors would. With this release after
at most 10 errors compilation will terminate, regardless of what type of
error they were.
.Sp
Note that you can change the maximum count by defining
\&\f(CW\*(C`PERL_STOP_PARSING_AFTER_N_ERRORS\*(C'\fR to be something else during the
configuration process. For instance
.Sp
.Vb 1
\&    ./Configure ... \-Accflags=\*(Aq\-DPERL_STOP_PARSING_AFTER_N_ERRORS=100\*(Aq
.Ve
.Sp
would allow up to 100 errors.
.IP \(bu 4
The API function "my_snprintf" in perlapi now prints a non-dot decimal
point if the perl code it ultimately is called from is in the scope of
\&\f(CW\*(C`use locale\*(C'\fR and the locale in effect calls for that.
.IP \(bu 4
A number of bugs related to capture groups in quantified groups in regular
expression have been fixed, especially in alternations. For example in
a pattern like:
.Sp
.Vb 1
\&        "foobazfoobar" =~ /((foo)baz|foo(bar))+/
.Ve
.Sp
the regex variable \f(CW$2\fR will not be "foo" as it once was, it will be undef.
.IP \(bu 4
Bugs with regex backreference operators that are inside of a capture
group have been fixed. For instance:
.Sp
.Vb 1
\&    "xa=xaaa" =~ /^(xa|=?\e1a){2}\ez/
.Ve
.Sp
will now correctly not match. [GH #10073 <https://github.com/Perl/perl5/issues/10073>]
.IP \(bu 4
\&\f(CWSSGROW()\fR and \f(CWSSCHECK()\fR have been reworked to ensure that the requested
space is actually allocated. \f(CWSSCHECK()\fR is now an alias for \f(CWSSGROW()\fR.
.SH Acknowledgements
.IX Header "Acknowledgements"
Perl 5.38.0 represents approximately 12 months of development since Perl
5.36.0 and contains approximately 290,000 lines of changes across 1,500
files from 100 authors.
.PP
Excluding auto-generated files, documentation and release tools, there were
approximately 190,000 lines of changes to 970 .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.38.0:
.PP
Alex, Alexander Nikolov, Alex Davies, Andreas König, Andrew Fresh, Andrew
Ruthven, Andy Lester, Aristotle Pagaltzis, Arne Johannessen, A. Sinan Unur,
Bartosz Jarzyna, Bart Van Assche, Benjamin Smith, Bram, Branislav
Zahradník, Brian Greenfield, Bruce Gray, Chad Granum, Chris 'BinGOs'
Williams, chromatic, Clemens Wasser, Craig A. Berry, Dagfinn Ilmari
Mannsåker, Dan Book, danielnachun, Dan Jacobson, Dan Kogai, David Cantrell,
David Golden, David Mitchell, E. Choroba, Ed J, Ed Sabol, Elvin Aslanov,
Eric Herman, Felipe Gasper, Ferenc Erki, Firas Khalil Khana, Florian Weimer,
Graham Knop, Håkon Hægland, Harald Jörg, H.Merijn Brand, Hugo van der
Sanden, James E Keenan, James Raspass, jkahrman, Joe McMahon, Johan Vromans,
Jonathan Stowe, Jon Gentle, Karen Etheridge, Karl Williamson, Kenichi
Ishigaki, Kenneth Ölwing, Kurt Fitzner, Leon Timmermans, Li Linjie, Loren
Merritt, Lukas Mai, Marcel Telka, Mark Jason Dominus, Mark Shelor, Matthew
Horsfall, Matthew O. Persico, Mattia Barbon, Max Maischein, Mohammad S
Anwar, Nathan Mills, Neil Bowers, Nicholas Clark, Nicolas Mendoza, Nicolas
R, Paul Evans, Paul Marquess, Peter John Acklam, Peter Levine, Philippe
Bruhat (BooK), Reini Urban, Renee Baecker, Ricardo Signes, Richard Leach,
Russ Allbery, Scott Baker, Sevan Janiyan, Sidney Markowitz, Sisyphus, Steve
Hay, TAKAI Kousuke, Todd Rinaldo, Tomasz Konojacki, Tom Stellard, Tony Cook,
Tsuyoshi Watanabe, Unicode Consortium, vsfos, Yves Orton, Zakariyya Mughal,
Zefram, 小鸡.
.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 \fIAUTHORS\fR 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.