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
|
=encoding utf8
=head1 NAME
perl5400delta - what is new for perl v5.40.0
=head1 DESCRIPTION
This document describes differences between the 5.38.0 release and the 5.40.0
release.
=head1 Core Enhancements
=head2 New C<__CLASS__> Keyword
When using the new C<class> feature, code inside a method, C<ADJUST> block or
field initializer expression is now permitted to use the new C<__CLASS__>
keyword. This yields a class name, similar to C<__PACKAGE__>, but whereas that
gives the compile-time package that the code appears in, the C<__CLASS__>
keyword is aware of the actual run-time class that the object instance is a
member of. This makes it useful for method dispatch on that class, especially
during constructors, where access to C<$self> is not permitted.
For more information, see L<perlfunc/__CLASS__>.
=head2 C<:reader> attribute for field variables
When using the C<class> feature, field variables can now take a C<:reader>
attribute. This requests that an accessor method be automatically created
that simply returns the value of the field variable from the given instance.
field $name :reader;
Is equivalent to
field $name;
method name () { return $name; }
An alternative name can also be provided:
field $name :reader(get_name);
For more detail, see L<perlclass/:reader>.
=head2 Permit a space in C<-M> command-line option
When processing command-line options, perl now allows a space between the
C<-M> switch and the name of the module after it.
$ perl -M Data::Dumper=Dumper -E 'say Dumper [1,2,3]'
This matches the existing behaviour of the C<-I> option.
=head2 Restrictions to C<use VERSION> declarations
In Perl 5.36, a deprecation warning was added when downgrading a
C<use VERSION> declaration from one above version 5.11, to below. This has
now been made a fatal error.
Additionally, it is now a fatal error to issue a subsequent C<use VERSION>
declaration when another is in scope, when either version is 5.39 or above.
This is to avoid complications surrounding imported lexical functions from
L<builtin>. A deprecation warning has also been added for any other
subsequent C<use VERSION> declaration below version 5.39, to warn that it
will no longer be permitted in Perl version 5.44.
=head2 New C<builtin::inf> and C<builtin::nan> functions (experimental)
Two new functions, C<inf> and C<nan>, have been added to the C<builtin>
namespace. These act like constants that yield the floating-point infinity
and Not-a-Number value respectively.
=head2 New C<^^> logical xor operator
Perl has always had three low-precedence logical operators C<and>, C<or> and
C<xor>, as well as three high-precedence bitwise versions C<&>, C<^> and C<|>.
Until this release, while the medium-precedence logical operators of C<&&> and
C<||> were also present, there was no exclusive-or equivalent. This release
of Perl adds the final C<^^> operator, completing the set.
$x ^^ $y and say "One of x or y is true, but not both";
=head2 C<try>/C<catch> feature is no longer experimental
Prior to this release, the C<try>/C<catch> feature for handling errors was
considered experimental. Introduced in Perl version 5.34.0, this is now
considered a stable language feature and its use no longer prints a warning.
It still must be enabled with L<the 'try' feature|feature/The 'try' feature>.
See L<perlsyn/Try Catch Exception Handling>.
=head2 C<for> iterating over multiple values at a time is no longer experimental
Prior to this release, iterating over multiple values at a time with C<for> was
considered experimental. Introduced in Perl version 5.36.0, this is now
considered a stable language feature and its use no longer prints a warning.
See L<perlsyn/Compound Statements>.
=head2 C<builtin> module is no longer experimental
Prior to this release, the L<builtin> module and all of its functions were
considered experimental. Introduced in Perl version 5.36.0, this module is now
considered stable its use no longer prints a warning. However, several of its
functions are still considered experimental.
=head2 The C<:5.40> feature bundle adds C<try>
The latest version feature bundle now contains the recently-stablized feature
C<try>. As this feature bundle is used by the C<-E> commandline switch, these
are immediately available in C<-E> scripts.
=head2 C<use v5.40;> imports builtin functions
In addition to importing a feature bundle, C<use v5.40;> (or later versions)
imports the corresponding L<builtin version bundle|builtin/Version Bundles>.
=head1 Security
=head2 CVE-2023-47038 - Write past buffer end via illegal user-defined Unicode property
This vulnerability was reported directly to the Perl security team by
Nathan Mills C<the.true.nathan.mills@gmail.com>.
A crafted regular expression when compiled by perl 5.30.0 through
5.38.0 can cause a one-byte attacker controlled buffer overflow in a
heap allocated buffer.
=head2 CVE-2023-47039 - Perl for Windows binary hijacking vulnerability
This vulnerability was reported to the Intel Product Security Incident
Response Team (PSIRT) by GitHub user ycdxsb
L<https://github.com/ycdxsb/WindowsPrivilegeEscalation>. PSIRT then
reported it to the Perl security team.
Perl for Windows relies on the system path environment variable to
find the shell (C<cmd.exe>). When running an executable which uses
Windows Perl interpreter, Perl attempts to find and execute C<cmd.exe>
within the operating system. However, due to path search order issues,
Perl initially looks for cmd.exe in the current working directory.
An attacker with limited privileges can exploit this behavior by
placing C<cmd.exe> in locations with weak permissions, such as
C<C:\ProgramData>. By doing so, when an administrator attempts to use
this executable from these compromised locations, arbitrary code can
be executed.
=head1 Incompatible Changes
=head2 reset EXPR now calls set-magic on scalars
Previously C<reset EXPR> did not call set magic when clearing scalar variables.
This meant that changes did not propagate to the underlying internal state
where needed, such as for C<$^W>, and did not result in an exception where the
underlying magic would normally throw an exception, such as for C<$1>.
This means code that had no effect before may now actually have an effect,
including possibly throwing an exception.
C<reset EXPR> already called set magic when modifying arrays and hashes.
This has no effect on plain C<reset> used to reset one-match searches as with
C<m?pattern?>.
[L<GH #20763|https://github.com/Perl/perl5/issues/20763>]
=head2 Calling the import method of an unknown package produces a warning
Historically, it has been possible to call the C<import> or C<unimport> method of
any class, including ones which have not been defined, with an argument and not
experience an error. For instance, this code will not throw an error in Perl
5.38:
Class::That::Does::Not::Exist->import("foo");
However, as of Perl 5.39.1 this is deprecated and will issue a warning. Note
that calling these methods with no arguments continues to silently succeed and
do nothing. For instance,
Class::That::Does::Not::Exist->import();
will continue to not throw an error. This is because every class
implicitly inherits from the class L<UNIVERSAL> which now defines an
C<import> method. In older perls there was no such method defined,
and instead the method calls for C<import> and C<unimport> were special
cased to not throw errors if there was no such method defined.
This change has been added because it makes it easier to detect case typos in
C<use> statements when running on case-insensitive file systems. For instance,
on Windows or other platforms with case-insensitive file systems on older perls
the following code
use STRICT 'refs';
would silently do nothing as the module is actually called F<strict.pm>, not
F<STRICT.pm>, so it would be loaded but its import method would never be called.
It will also detect cases where a user passes an argument when using a package
that does not provide its own import, for instance most "pure" class
definitions do not define an import method.
=head2 C<return> no longer allows an indirect object
The C<return> operator syntax now rejects indirect objects. In most
cases this would compile and even run, but wasn't documented and could
produce confusing results, for example:
# note that sum hasn't been defined
sub sum_positive {
return sum grep $_ > 0, @_;
# unexpectedly parsed as:
# return *sum, grep $_ > 0, @_;
# ... with the bareword acting like an extra (typeglob) argument
}
say for sum_positive(-1, 2, 3)
produced:
*main::sum
2
3
[L<GH #21716|https://github.com/Perl/perl5/issues/21716>]
=head2 Class barewords no longer resolved as file handles in method calls under C<no feature "bareword_filehandles">
Under C<no feature "bareword_filehandles"> bareword file handles
continued to be resolved in method calls:
open FH, "<", $somefile or die;
no feature 'bareword_filehandles';
FH->binmode;
This has been fixed, so the:
FH->binmode;
will attempt to resolve C<FH> as a class, typically resulting in a
runtime error.
The standard file handles such as C<STDOUT> continue to be resolved as
a handle:
no feature 'bareword_filehandles';
STDOUT->flush; # continues to work
Note that once perl resolves a bareword name as a class it will
continue to do so:
package SomeClass {
sub somemethod{}
}
open SomeClass, "<", "somefile" or die;
# SomeClass resolved as a handle
SomeClass->binmode;
{
no feature "bareword_filehandles";
SomeClass->somemethod;
}
# SomeClass resolved as a class
SomeClass->binmode;
[L<GH #19426|https://github.com/Perl/perl5/issues/19426>]
=head1 Deprecations
=over 4
=item *
Using C<goto> to jump from an outer scope into an inner scope is deprecated
and will be removed completely in Perl 5.42. [L<GH #21601|https://github.com/Perl/perl5/issues/21601>]
=back
=head1 Performance Enhancements
=over 4
=item *
The negation OPs have been modified to support the generic C<TARGMY> optimization.
[L<GH #21442|https://github.com/Perl/perl5/issues/21442>]
=back
=head1 Modules and Pragmata
=head2 New Modules and Pragmata
=over 4
=item *
L<Term::Table> 0.018 has been added to the Perl core.
This module is a dependency of L<Test2::Suite>.
=item *
L<Test2::Suite> 0.000162 has been added to the Perl core.
This distribution contains a comprehensive set of test tools for writing unit
tests. It is the successor to L<Test::More> and similar modules. Its
inclusion in the Perl core means that CPAN module tests can be written using
this suite of tools without extra dependencies.
=back
=head2 Updated Modules and Pragmata
=over 4
=item *
L<Archive::Tar> has been upgraded from version 2.40 to 3.02_001.
=item *
L<attributes> has been upgraded from version 0.35 to 0.36.
=item *
L<autodie> has been upgraded from version 2.36 to 2.37.
=item *
L<B> has been upgraded from version 1.88 to 1.89.
=item *
L<B::Deparse> has been upgraded from version 1.74 to 1.76.
=item *
L<Benchmark> has been upgraded from version 1.24 to 1.25.
=item *
L<bignum> has been upgraded from version 0.66 to 0.67.
=item *
L<builtin> has been upgraded from version 0.008 to 0.014.
L<builtin> now accepts a version bundle as an input argument, requesting it to
import all of the functions that are considered a stable part of the module at
the given Perl version. For example:
use builtin ':5.40';
Added the C<load_module()> builtin function as per L<PPC 0006|https://github.com/Perl/PPCs/blob/main/ppcs/ppc0006-load-module.md>.
=item *
L<bytes> has been upgraded from version 1.08 to 1.09.
=item *
L<Compress::Raw::Bzip2> has been upgraded from version 2.204_001 to 2.212.
=item *
L<Compress::Raw::Zlib> has been upgraded from version 2.204_001 to 2.212.
=item *
L<CPAN::Meta::Requirements> has been upgraded from version 2.140 to 2.143.
=item *
L<Data::Dumper> has been upgraded from version 2.188 to 2.189.
=item *
L<DB_File> has been upgraded from version 1.858 to 1.859.
=item *
L<Devel::Peek> has been upgraded from version 1.33 to 1.34.
=item *
L<Devel::PPPort> has been upgraded from version 3.71 to 3.72.
=item *
L<diagnostics> has been upgraded from version 1.39 to 1.40.
=item *
L<DynaLoader> has been upgraded from version 1.54 to 1.56.
=item *
L<Encode> has been upgraded from version 3.19 to 3.21.
=item *
L<Errno> has been upgraded from version 1.37 to 1.38.
The C<osvers> and C<archname> baked into the module to ensure Errno is loaded
by the perl that built it are now more comprehensively escaped.
[L<GH #21135|https://github.com/Perl/perl5/issues/21135>]
=item *
L<experimental> has been upgraded from version 0.031 to 0.032.
=item *
L<Exporter> has been upgraded from version 5.77 to 5.78.
=item *
L<ExtUtils::CBuilder> has been upgraded from version 0.280238 to 0.280240.
=item *
L<ExtUtils::Manifest> has been upgraded from version 1.73 to 1.75.
=item *
L<ExtUtils::Miniperl> has been upgraded from version 1.13 to 1.14.
=item *
L<Fcntl> has been upgraded from version 1.15 to 1.18.
The old module documentation stub has been greatly expanded and revised.
Adds support for the C<O_TMPFILE> flag on Linux.
=item *
L<feature> has been upgraded from version 1.82 to 1.89.
It now documents the C<:all> feature bundle, and suggests a reason why you may
not wish to use it.
=item *
L<fields> has been upgraded from version 2.24 to 2.25.
=item *
L<File::Compare> has been upgraded from version 1.1007 to 1.1008.
=item *
L<File::Find> has been upgraded from version 1.43 to 1.44.
=item *
L<File::Glob> has been upgraded from version 1.40 to 1.42.
=item *
L<File::Spec> has been upgraded from version 3.89 to 3.90.
=item *
L<File::stat> has been upgraded from version 1.13 to 1.14.
=item *
L<FindBin> has been upgraded from version 1.53 to 1.54.
=item *
L<Getopt::Long> has been upgraded from version 2.54 to 2.57.
=item *
L<Getopt::Std> has been upgraded from version 1.13 to 1.14.
Documentation and test improvements only; no change in functionality.
=item *
L<Hash::Util> has been upgraded from version 0.30 to 0.32.
=item *
L<Hash::Util::FieldHash> has been upgraded from version 1.26 to 1.27.
=item *
L<HTTP::Tiny> has been upgraded from version 0.086 to 0.088.
=item *
L<I18N::Langinfo> has been upgraded from version 0.22 to 0.24.
It now handles the additional locale categories that Linux defines
beyond those in the POSIX Standard.
This fixes what is returned for the C<ALT_DIGITS> item, which has never
before worked properly in Perl.
=item *
L<IO> has been upgraded from version 1.52 to 1.55.
Fixed C<IO::Handle/blocking> on Windows, which has been non-functional
since IO 1.32. [L<GH #17455|https://github.com/Perl/perl5/issues/17455>]
=item *
IO-Compress has been upgraded from version 2.204 to 2.212.
=item *
L<IO::Socket::IP> has been upgraded from version 0.41_01 to 0.42.
=item *
L<IO::Zlib> has been upgraded from version 1.14 to 1.15.
=item *
L<locale> has been upgraded from version 1.10 to 1.12.
=item *
L<Math::BigInt> has been upgraded from version 1.999837 to 2.003002.
=item *
L<Math::BigInt::FastCalc> has been upgraded from version 0.5013 to 0.5018.
=item *
L<Module::CoreList> has been upgraded from version 5.20230520 to 5.20240609.
=item *
L<Module::Metadata> has been upgraded from version 1.000037 to 1.000038.
=item *
L<mro> has been upgraded from version 1.28 to 1.29.
=item *
L<NDBM_File> has been upgraded from version 1.16 to 1.17.
=item *
L<Opcode> has been upgraded from version 1.64 to 1.65.
=item *
L<perl5db.pl> has been upgraded from version 1.77 to 1.78.
Made parsing of the C<l> command arguments saner.
[L<GH #21350|https://github.com/Perl/perl5/issues/21350>]
=item *
L<perlfaq> has been upgraded from version 5.20210520 to 5.20240218.
=item *
L<PerlIO::encoding> has been upgraded from version 0.30 to 0.31.
=item *
L<PerlIO::scalar> has been upgraded from version 0.31 to 0.32.
=item *
L<PerlIO::via> has been upgraded from version 0.18 to 0.19.
=item *
L<Pod::Checker> has been upgraded from version 1.75 to 1.77.
=item *
L<Pod::Html> has been upgraded from version 1.34 to 1.35.
=item *
L<Pod::Simple> has been upgraded from version 3.43 to 3.45.
=item *
L<podlators> has been upgraded from version 5.01 to 5.01_02.
=item *
L<POSIX> has been upgraded from version 2.13 to 2.20.
The C<mktime> function now works correctly on 32-bit platforms even if the
platform's C<time_t> type is larger than 32 bits. [L<GH #21551|https://github.com/Perl/perl5/issues/21551>]
The C<T_SIGNO> and C<T_FD> typemap entries have been fixed so they work with
any variable name, rather than just the hardcoded C<sig> and C<fd>.
The mappings for C<Mode_t>, C<pid_t>, C<Uid_t>, C<Gid_t> and C<Time_t> have
been updated to be integer types; previously they were C<NV> floating-point.
Adjusted the signbit() on NaN test to handle the unusual bit pattern
returned for NaN by Oracle Developer Studio's compiler. [L<GH #21533|https://github.com/Perl/perl5/issues/21533>]
=item *
L<re> has been upgraded from version 0.44 to 0.47.
=item *
L<Safe> has been upgraded from version 2.44 to 2.46.
=item *
L<SelfLoader> has been upgraded from version 1.26 to 1.27.
=item *
L<Socket> has been upgraded from version 2.036 to 2.038.
=item *
L<strict> has been upgraded from version 1.12 to 1.13.
=item *
L<Test::Harness> has been upgraded from version 3.44 to 3.48.
=item *
L<Test::Simple> has been upgraded from version 1.302194 to 1.302199.
=item *
L<Text::Tabs> has been upgraded from version 2021.0814 to 2024.001.
=item *
L<Text::Wrap> has been upgraded from version 2021.0814 to 2024.001.
=item *
L<threads> has been upgraded from version 2.36 to 2.40.
An internal error has been made slightly more verbose
(C<Out of memory in perl:threads:ithread_create>).
=item *
L<threads::shared> has been upgraded from version 1.68 to 1.69.
=item *
L<Tie::File> has been upgraded from version 1.07 to 1.09.
Old compatibility code for perl 5.005 that was no longer functional has been
removed.
=item *
L<Time::gmtime> has been upgraded from version 1.04 to 1.05.
=item *
L<Time::HiRes> has been upgraded from version 1.9775 to 1.9777.
=item *
L<Time::Local> has been upgraded from version 1.30 to 1.35.
=item *
L<Time::localtime> has been upgraded from version 1.03 to 1.04.
=item *
L<Time::tm> has been upgraded from version 1.00 to 1.01.
=item *
L<UNIVERSAL> has been upgraded from version 1.15 to 1.17.
=item *
L<User::grent> has been upgraded from version 1.04 to 1.05.
=item *
L<User::pwent> has been upgraded from version 1.02 to 1.03.
=item *
L<version> has been upgraded from version 0.9929 to 0.9930.
=item *
L<warnings> has been upgraded from version 1.65 to 1.69.
=item *
L<XS::APItest> has been upgraded from version 1.32 to 1.36.
=item *
L<XS::Typemap> has been upgraded from version 0.19 to 0.20.
=back
=head1 Documentation
=head2 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 L<https://github.com/Perl/perl5/issues>.
Additionally, the following selected changes have been made:
=head3 L<perlapi>
=over 4
=item *
Corrected the documentation for L<C<Perl_form>|perlapi/form>,
C<form_nocontext>, and C<vform>, which claimed that any later call to one
of them will destroy the previous returns from any. This hasn't been true
since 5.6.0, except it does remain true if these are called during global
destruction. With that caveat, the return of each of these is a fresh
string in a temporary that will automatically be freed by a call to
L<perlapi/C<FREETMPS>> or at places such as statement boundaries.
=item *
Several internal functions now have documentation - the various C<newSUB>
functions, C<newANONLIST()>, C<newANONHASH()>, C<newSVREF()> and similar.
=back
=head3 L<perlclass>
=over 4
=item *
Added a list of known bugs in the experimental C<class> feature.
=back
=head3 L<perlfunc>
=over 4
=item *
The documentation for L<C<local>|perlfunc/local EXPR>,
L<C<my>|perlfunc/my VARLIST>, L<C<our>|perlfunc/our VARLIST>, and
L<C<state>|perlfunc/state VARLIST>, has been updated to include examples
and descriptions of their effects within a statement.
=back
=head3 L<perlguts>
=over 4
=item *
A new section has been added which describes the experimental
reference-counted argument stack build option (C<PERL_RC_STACK>).
=back
=head3 L<perlclib>
=over 4
=item *
Extensive guidance has been added for interfacing with the standard C
library, including many more functions to avoid, and how to cope with
locales and threads.
=back
=head3 L<perlhacktips>
=over 4
=item *
Document we can't use compound literals or array designators due to C++
compatibility. [L<GH #21073|https://github.com/Perl/perl5/issues/21073>]
=item *
Document new functions C<sv_mark_arenas()> and C<sv_sweep_arenas()>
(which only exist on C<DEBUGGING> builds)
=item *
Added brief documentation for some tools useful when developing perl
itself on Windows or Cygwin.
=back
=head3 L<perllol>
=over 4
=item *
Removed indirect object syntax in C<Dumpvalue> example
=back
=head3 L<perlre>
=over 4
=item *
Removed statement suggesting C</p> is a no-op.
=back
=head3 L<perlref>
=over 4
=item *
Documented ref assignment in list context (as part of the C<refaliasing> feature)
=back
=head3 L<perlop>
=over 4
=item *
The section on the empty pattern C<//> has been amended to mention that the current dynamic scope is
used to find the last successful match.
=back
=head3 L<perlport>
=over 4
=item *
The C<-S> file test has been meaningful on Win32 since 5.37.6
=item *
The C<-l> file test is now meaningful on Win32
=item *
Some strange behaviour with C<.> at the end of names under Windows has been documented
=back
=head3 L<perlvar>
=over 4
=item *
Added documentation for an alternative to C<${^CAPTURE}>
=back
=head1 Diagnostics
The following additions or changes have been made to diagnostic output,
including warnings and fatal error messages. For the complete list of
diagnostic messages, see L<perldiag>.
=head2 New Diagnostics
=head3 New Errors
=over 4
=item *
L<Cannot use __CLASS__ outside of a method or field initializer expression|perldiag/"Cannot use __CLASS__ outside of a method or field initializer expression">
(F) A C<__CLASS__> expression yields the class name of the object instance
executing the current method, and therefore it can only be placed inside an
actual method (or method-like expression, such as a field initializer
expression).
=item *
L<get_layers: unknown argument '%s'|perldiag/"get_layers: unknown argument '%s'">
(F) You called PerlIO::get_layers() with an unknown argument. Legal
arguments are provided in key/value pairs, with the keys being one
of C<input>, C<output> or C<detail>, followed by a boolean.
=item
L<UNIVERSAL does not export anything|perldiag/"UNIVERSAL does not export anything">
(F) You asked UNIVERSAL to export something, but UNIVERSAL is the
base class for all classes and contains no exportable symbols.
=item *
L<Builtin version bundle "%s" is not supported by Perl|perldiag/Builtin version bundle "%s" is not supported by Perl>
(F) You attempted to C<use builtin :ver> for a version number that is either
older than 5.39 (when the ability was added), or newer than the current perl
version.
=item *
L<Invalid version bundle "%s"|perldiag/Invalid version bundle "%s">
(F) A version number that is used to specify an import bundle during a
C<use builtin ...> statement must be formatted as C<:MAJOR.MINOR> with an
optional third component, which is ignored. Each component must be a number
of 1 to 3 digits. No other characters are permitted. The value that was
specified does not conform to these rules.
=item *
L<Missing comma after first argument to return|perldiag/"Missing comma after first argument to return">
(F) While certain operators allow you to specify a filehandle or an
"indirect object" before the argument list, C<return> isn't one of
them.
=item *
L<Out of memory during vec in lvalue context|perldiag/"Out of memory during vec in lvalue context">
(F) An attempt was made to extend a string beyond the largest possible memory
allocation by assigning to C<vec()> called with a large second argument.
(This case used to throw a generic C<Out of memory!> error.)
=item *
L<Cannot create an object of incomplete class "%s"|perldiag/"Cannot create an object of incomplete class "%s"">
(F) An attempt was made to create an object of a class where the start
of the class definition has been seen, but the class has not been
completed.
This can happen for a failed eval, or if you attempt to create an
object at compile time before the class is complete:
eval "class Foo {"; Foo->new; # error
class Bar { BEGIN { Bar->new } }; # error
Previously perl would assert or crash. [L<GH #22159|https://github.com/Perl/perl5/issues/22159>]
=back
=head3 New Warnings
=over 4
=item *
L<< Forked open '%s' not meaningful in <>|perldiag/"Forked open '%s' not meaningful in <>" >>
(S inplace) You had C<|-> or C<-|> in C<@ARGV> and tried to use C<< <>
>> to read from it.
Previously this would fork and produce a confusing error message. [L<GH #21176|https://github.com/Perl/perl5/issues/21176>]
=item *
L<Attempt to call undefined %s method with arguments ("%s"%s) via package "%s" (Perhaps you forgot to load the package?)|perldiag/Attempt to call undefined %s method with arguments ("%s"%s) via package "%s" (Perhaps you forgot to load the package?)>
(D deprecated::missing_import_called_with_args) You called the
C<import()> or C<unimport()> method of a class that has no import method
defined in its inheritance graph, and passed an argument to the method.
This is very often the sign of a misspelled package name in a use or
require statement that has silently succeeded due to a case insensitive
file system.
Another common reason this may happen is when mistakenly attempting to
import or unimport a symbol from a class definition or package which
does not use C<Exporter> or otherwise define its own C<import> or
C<unimport> method.
=back
=head2 Changes to Existing Diagnostics
=over 4
=item *
L<Name "%s::%s" used only once: possible typo|perldiag/"Name "%s::%s" used only once: possible typo">
This warning now honors being marked as fatal. [L<GH #13814|https://github.com/Perl/perl5/issues/13814>]
=item *
L<Out of memory in perl:%s|perldiag/"Out of memory in perl:%s">
There used to be several places in the perl core that would print a generic
C<Out of memory!> message and abort when memory allocation failed, giving no
indication which program it was that ran out of memory. These have been
modified to include the word C<perl> and the general area of the allocation
failure, e.g. C<Out of memory in perl:util:safesysrealloc>. [L<GH #21672|https://github.com/Perl/perl5/issues/21672>]
=item *
L<Possible precedence issue with control flow operator (%s)|perldiag/"Possible precedence issue with control flow operator (%s)">
This warning now mentions the name of the control flow operator that triggered
the diagnostic (e.g. C<return>, C<exit>, C<die>, etc).
It also covers more cases: Previously, the warning was only triggered if a
low-precedence logical operator (like C<and>, C<or>, C<xor>) was involved. Now
it is also shown for misleading code like this:
exit $x ? 0 : 1; # actually parses as: exit($x) ? 0 : 1;
exit $x == 0; # actually parses as: exit($x) == 0;
=item *
L<Use of uninitialized value%s|perldiag/"Use of uninitialized value%s">
This warning is now slightly more accurate in cases involving C<length>,
C<pop>, C<shift>, or C<splice>:
my $x;
length($x) == 0
# Before:
# Use of uninitialized value $x in numeric eq (==) at ...
# Now:
# Use of uninitialized value length($x) in numeric eq (==) at ...
That is, the warning no longer implies that C<$x> was used directly as an
operand of C<==>, which it wasn't.
Similarly:
my @xs;
shift @xs == 0
# Before:
# Use of uninitialized value within @xs in numeric eq (==) at ...
# Now:
# Use of uninitialized value shift(@xs) in numeric eq (==) at ...
This is more accurate because there never was an C<undef> within C<@xs> as the
warning implied. (The warning for C<pop> works analogously.)
Finally:
my @xs = (1, 2, 3);
splice(@xs, 0, 0) == 0
# Before:
# Use of uninitialized value within @xs in numeric eq (==) at ...
# Now:
# Use of uninitialized value in numeric eq (==) at ...
That is, in cases where C<splice> returns C<undef>, it no longer
unconditionally blames its first argument. This was misleading because
C<splice> can return C<undef> even if none of its arguments contain C<undef>.
[L<GH #21930|https://github.com/Perl/perl5/issues/21930>]
=item *
L<Old package separator "'" deprecated|perldiag/"Old package separator "'" deprecated">
Prevent this warning appearing spuriously when checking the heuristic for the
L<You need to quote "%s"|perldiag/"You need to quote "%s""> warning.
[L<GH #22145|https://github.com/Perl/perl5/issues/22145>]
=back
=head1 Configuration and Compilation
=over 4
=item *
C<microperl>, long broken and of unclear present purpose, has been removed
as promised in L<Perl 5.18|perl5180delta/Future Deprecations>.
=item *
Fix here-doc used for code to probe C<LC_ALL> syntax for disparate
locales introduced in 5.39.2. [L<GH #21451|https://github.com/Perl/perl5/issues/21451>]
=item *
You can now separately enable high water mark checks for non-DEBUGGING
or disable them for DEBUGGING builds with C<-Accflags=-DPERL_USE_HWM>
or C<-Accflags=-DPERL_NO_HWM> respectively. The default remains the
same. [L<GH #16607|https://github.com/Perl/perl5/issues/16607>]
=back
=head1 Testing
Tests were added and changed to reflect the other additions and
changes in this release. Furthermore, these significant changes were
made:
=over 4
=item *
Update F<nm> output parsing for Darwin in F<t/porting/libperl.t> to handle
changes in the output of nm on Darwin.
[L<GH #21117|https://github.com/Perl/perl5/issues/21117>]
=item *
F<t/op/magic.t> would fail when C<ps> was the BusyBox implementation,
since that doesn't support the C<-p> flag and otherwise ignores a
process id on the command-line. This caused F<TEST> failures on
BusyBox systems such as Alpine Linux. [L<GH #17542|https://github.com/Perl/perl5/issues/17542>]
=item *
F<porting/globvar.t> now uses the more portable C<nm -P ...> to fetch
the names defined in an object file. The parsing of the names found
in the object is now separated from processing them to handle the
duplication between local and global definitions on AIX. [L<GH #21637|https://github.com/Perl/perl5/issues/21637>]
=item *
A test was added to F<lib/locale_threads.t> that extensively stress
tests locale handling. It turns out that the libc implementations on
various platforms have bugs in this regard, including Linux, Windows,
*BSD derivatives including Darwin, and others. Experimental versions of
this test have been used in the past few years to find bugs in the Perl
implementation and in those platforms, as well as to develop workarounds
in the Perl implementation, where feasible, for the platform bugs.
Multiple bug report tickets have been filed against platforms, and some
have been fixed. The test checks that platforms that purport to support
thread-safe locale handling actually do so (and that perl works properly
on those that do; The read-only variable C<${^SAFE_LOCALES}> is set to
1 if perl thinks the platform can handle this, whatever the platform's
documentation says).
Also tested for is if the various locale categories can indeed be set
independently to disparate locales. (An example of where you might want
to do this is if you are a Western Canadian living and working in
Holland. You likely will want to have the C<LC_MONETARY> locale be
set to where you are living, but have the other parts of your locale
retain your native English values. Later, as you get a bit more
comfortable with Dutch, and in order to communicate better with your
colleagues, you might want to change C<LC_TIME> and C<LC_NUMERIC> to
Dutch, while leaving C<LC_CTYPE> and C<LC_COLLATE> set to English
indefinitely.)
=item *
The test F<t/porting/libperl.t> will no longer run in maint releases.
This test is sensitive to changes in the output of F<nm> on various
platforms, and tarballs aren't updated as we update this test in
blead. [L<GH #21677|https://github.com/Perl/perl5/issues/21677>]
=back
=head1 Platform Support
=head2 New Platforms
=over 4
=item Serenity OS
Out of the box support for Serenity OS was added.
=back
=head2 Platform-Specific Notes
=over 4
=item Windows
Eliminated several header build warnings under MSVC with C</W4> to reduce noise
for embedders. [L<GH #21031|https://github.com/Perl/perl5/issues/21031>]
Work around a bug in most 32-bit Mingw builds, where the generated
code, including the code in the gcc support library, assumes 16-byte
stack alignment, which 32-bit Windows does not preserve. [L<GH #21313|https://github.com/Perl/perl5/issues/21313>]
Enable C<copysign>, C<signbit>, C<acosh>, C<asinh>, C<atanh>, C<exp2>,
C<tgamma> in the bundled configuration used for MSVC. [L<GH #21610|https://github.com/Perl/perl5/issues/21610>]
The build process no longer supports Visual Studio 2013. This was
failing to build at a very basic level and there have been no reports
of such failures. [L<GH #21624|https://github.com/Perl/perl5/issues/21624>]
=item Linux
The hints file has been updated to handle the Intel oneAPI DPC++/C++ compiler.
=item MacOS/Darwin
Don't set C<MACOSX_DEPLOYMENT_TARGET> when building on OS X 10.5. [L<GH
#21367|https://github.com/Perl/perl5/issues/21367>]
=item VMS
Fixed the configure "installation prefix" prompt to accept a string rather than
yes/no.
Fixed compilation by defining proper value for
C<perl_lc_all_category_positions_init>.
Increased buffer size when reading F<config_H.SH> to fix compilation under
clang.
=item Oracle Developer Studio (Solaris, Oracle Linux)
Due to an apparent code generation bug, the default optimization level
for the Oracle Developer Studio (formerly Sun Workshop) compiler is
now C<-xO1>. [L<GH #21535|https://github.com/Perl/perl5/issues/21535>]
=back
=head1 Internal Changes
=over 4
=item *
C<PERL_RC_STACK> build option added.
This new build option is highly experimental and is not enabled by
default. Perl can be built with it by using the F<Configure> option
C<-Accflags='-DPERL_RC_STACK'>.
It makes the argument stack bump the reference count of SVs pushed onto
it. It is mostly functional, but currently slow and incomplete.
It is intended in the long term that this build option will become
the default option, and then finally the only option; but this will be
many releases away.
In particular, there is currently no support within XS code for using
these new features. So under this build option, all XS functions are
called via a backwards-compatibility wrapper which slows down such calls.
In future releases, better support for XS code is intended to be added.
It is expected that straightforward XS code will eventually be able to
make use of a reference-counted stack without modification, with any heavy
lifting being handled by the XS compiler (C<xsubpp>) and the macros which
it outputs. But code which implements PP() functions will eventually have
to be modified to use a new PP API: rpp_foo() rather than PUSHs() etc. But
this new API is not yet stable, nor has it yet been back-ported via
C<Devel::PPPort>.
See L<perlguts|perlguts/"Reference-counted argument stack"> for more
details.
=item *
A new API function has been added that simplifies C (or XS) code that creates
C<LISTOP> optree fragments. C<newLISTOPn()> is a variadic function that takes
a C<NULL>-terminated list of child op pointers, and constructs a new checked
C<LISTOP> to contain them all. This is simpler than creating a new plain
C<OP_LIST>, adding each child individually, and finally calling
C<op_convert_list()> in most code fragments.
=item *
The C<eval_sv()> API now accepts the C<G_USEHINTS> flag, which uses
the hints such as strict and features from C<PL_curcop> instead of the
default, which is to use default hints, e.g. no C<use vX.XX;>, no
strict, default features.
Beware if you use this flag in XS code: your evaluated code will need
to support whatever strictness or features are in effect at the point
your XS function is called.
[L<GH #21415|https://github.com/Perl/perl5/issues/21415>]
=item *
C<PERL_VERSION_LE> has been fixed to properly check for "less than or equal"
rather than "less than".
=item *
C<dAX>, C<dITEMS> and hence C<dXSARGS> now declare C<AX> and C<items>
as C<Stack_off_t> rather than C<SSize_t>. This reverts back to
compatibility with pre-64-bit stack support for default builds of perl
where C<Stack_off_t> is C<I32>. [L<GH #21782|https://github.com/Perl/perl5/issues/21782>]
=item *
A new function is now available to C<XS> code, L<perlapi/sv_langinfo>.
This provides the same information as the existing
L<perlapi/Perl_langinfo8>, but returns an SV instead of a S<C<char *>>,
so that programmers don't have to concern themselves with the UTF-8ness
of the result. This new function is now the preferred interface for
C<XS> code to the L<nl_langinfo(3)> C<libc> function. From Perl space,
this information continues to be provided by the L<I18N::Langinfo>
module.
=item *
glibc has an undocumented equivalent function to querylocale(), which
our experience indicates is reliable. When this is function is used,
it removes the need for perl to keep its own records, hence is more
efficient and guaranteed to be accurate. Use of this function can be
disabled by defining the C<NO_NL_LOCALE_NAME> build option
=back
=head1 Selected Bug Fixes
=over 4
=item *
The delimiter C<SYRIAC COLON SKEWED LEFT/RIGHT> pair has been removed
from the ones recognized by the C<extra_paired_delimiters> feature.
(See L<perlop/Quote and Quote-like Operators>.) This is because those
characters are normally written right-to-left, and this could be
visually confusing [L<GH #22228|https://github.com/Perl/perl5/issues/22228>].
The change was actually to forbid any right-to-left delimiters, but this
pair is the only current instance that meets this criterion. By policy,
this change means that the C<extra_paired_delimiters> feature cannot be
considered to have been stable long enough for its experimental status to
be removed.
=item *
C<use 5.36;> or later didn't enable the post parse reporting of L<Name
"%s::%s" used only once: possible typo|perldiag/"Name "%s::%s" used
only once: possible typo"> warnings when enabling warnings.
[L<GH #21271|https://github.com/Perl/perl5/issues/21271>]
=item *
Fix a crash or assertion when cleaning up a closure that refers to an
outside C<our> sub. [L<GH #21067|https://github.com/Perl/perl5/issues/21067>]
=item *
Fixed a number of issues where C<I32> was used as a string offset or
size rather than C<SSize_t> or C<STRLEN>/C<size_t> [L<GH #21012|https://github.com/Perl/perl5/issues/21012>]
=item *
C<~$str> when C<$str> was more than 2GB in size would do nothing or
produce an incomplete result.
=item *
String repeat, C<$str x $count>, didn't handle C<$str> over 2GB in
size, throwing an error. Now such strings are repeated.
=item *
Complex substitution after the 2GB point in a string could access
incorrect or invalid offsets in the string.
=item *
sv_utf8_decode() would truncate the SVs pos() value. This wasn't
visible via utf8::decode().
=item *
When compiling a constant folded hash key, the length was truncated
when creating the shared SV. Since hash keys over 2GB are not
supported, throw a compilation error instead.
=item *
msgrcv() incorrectly called get magic on the buffer SV and failed to
call set magic on completion.
[L<GH #21012|https://github.com/Perl/perl5/issues/21012>]
=item *
msgrcv() used the size parameter to resize the buffer before
validating it. [L<GH #21012|https://github.com/Perl/perl5/issues/21012>]
=item *
Inheriting from a class that was hierarchically an ancestor of the new
class, eg. C< class A::B :isa(A) { ... } >, would not attempt to load
the parent class. [L<GH #21332|https://github.com/Perl/perl5/issues/21332>]
=item *
Declared references can now be used with C<state> variables.
[L<GH #21351|https://github.com/Perl/perl5/issues/21351>]
=item *
Trailing elements in an C<unshift>ed and resized array will now always be
initialized. [L<GH #21265|https://github.com/Perl/perl5/issues/21265>]
=item *
Make C<use 5.036> respect the -X flag
perl's -X flag disables all warnings globally, but «use 5.036» didn't
respect that until now. [L<GH #21431|https://github.com/Perl/perl5/issues/21431>]
=item *
Fixed an OP leak when an error was produced for initializer for a class
field. [L<GH #20812|https://github.com/Perl/perl5/issues/20812>]
=item *
Fixed a leak of the return value when smartmatching against a code reference.
=item *
Fixed a slowdown in repeated substitution replacements using special
variables, such as C<s/....x$1/g>. It actually makes all string
concatenations involving such "magic" variables less slow, but the
slowdown was more noticeable on repeated substitutions due to extra memory
usage that was only freed after the last iteration. The slowdown started
in perl 5.28.0 - which generally sped up string concatenation but slowed
down when using special variables.
[L<GH #21360|https://github.com/Perl/perl5/issues/21360>]
=item *
Lexical names from the enclosing scope in a lexical sub or closure
weren't visible to code executed by calling C<eval EXPR;> from the
C<DB> package. This was introduced in 5.18 in an attempt to prevent
subs from retaining a reference to their outer scope, but this broke
the special behaviour of C<eval EXPR;> in package DB.
This incidentally fixed a TODO test for C<B::Deparse>.
[L<GH #19370|https://github.com/Perl/perl5/pull/19370>]
=item *
Optionally support an argument stack over 2**32 entries on 64-bit
platforms. This requires 32GB of memory just for the argument stack
pointers itself, so you will require a significantly more memory to
take advantage of this.
To enable this add C<-Accflags=-DPERL_STACK_OFFSET_SSIZET> or
equivalent to the C<Configure> command-line.
[L<GH #20917|https://github.com/Perl/perl5/issues/20917>]
[L<GH #21523|https://github.com/Perl/perl5/issues/21523>]
=item *
Fixed various problems with join() where modifications to the
separator could be handled inconsistently, or could access released
memory. Changes to the separator from magic or overloading for values
in the C<LIST> no longer have an effect on the resulting joined
string.
[L<GH #21458|https://github.com/Perl/perl5/issues/21458>]
=item *
Don't clear the integer flag C<IOK> from lines in the C<<
@{"_<$sourcefile"} >> array when a C<dbstate> op is removed for that
line. This was broken when fixing
[L<GH #19198|https://github.com/Perl/perl5/issues/19198>].
[L<GH #21564|https://github.com/Perl/perl5/issues/21564>]
=item *
Many bug fixes have been made for using locales under threads and in
embedded perls. And workarounds for libc bugs have been added. As a
result thread-safe locale handling is now the default under OpenBSD, and
MingW when compiled with UCRT.
However, testing has shown that Darwin's implementation of thread-safe
locale handling has bugs. So now Perl doesn't attempt to use the
thread-safe operations when compiled on Darwin.
As before, you can check to see if your program is running with
thread-safe locales by checking if the value of C<${^SAFE_LOCALES}> is
1.
=item *
Various bugs have been fixed when perl is configured with
C<-Accflags=-DNO_LOCALE_NUMERIC> or any other locale category (or
categories).
=item *
Not all locale categories need be set to the same locale. Perl now
works around bugs in the libc implementations of locale handling on some
platforms that previously could result in mojibake.
=item *
C<LC_ALL> is represented in one of two ways when not all locale
categories are set to the same locale. On some platforms, such as Linux
and Windows, the representation is of the form of a series of
C<'category=locale-name'> pairs. On other platforms, such as *BSD, the
representation is positional like S<C<I<name1> / I<name2> / ... >>.
I<name1> is always for a particular category as defined by the platform,
as are the other names. The sequence that separates the names
(the S<C< / >> above) also varies by platform. Previously, perl had
problems with platforms that used the positional notation. This is now
fixed.
=item *
A bug has been fixed in the regexp engine with an optimisation that applies
to the C<+> quantifier where it was followed by a C<(*SKIP)> pattern.
[L<GH #21534|https://github.com/Perl/perl5/issues/21534>]
=item *
The tmps (mortal) stack now grows exponentially. Previously it grew
linearly, so if it was growing incrementally, such as through many
calls to sv_2mortal(), on a system where realloc() is O(size), the
performance would be O(n*n). With exponential grows this changes to
amortized O(n). [L<GH #21654|https://github.com/Perl/perl5/issues/21654>]
=item *
Lexical subs now have a new stub in the pad for each recursive call
into the containing function. This fixes two problems:
=over
=item *
If the lexical sub called the containing function, a "Can't undef
active subroutine" error would be thrown. For example:
use v5.36.0;
sub outer($oc) {
my sub inner ($c) {
outer($c-1) if $c; # Can't undef active subroutine
}
inner($oc);
}
outer(2);
[L<GH #18606|https://github.com/Perl/perl5/issues/18606>]
=item *
If the lexical sub was called from a recursive call into the
containing function, this would overwrite the bindings to the closed
over variables in the lexical sub, so calls into the lexical sub from
the outer recursive call would have access to the variables from the
inner recursive call:
use v5.36.0;
sub outer ($x) {
my sub inner ($label) {
say "$label $x";
}
inner("first");
outer("inner") if $x eq "outer";
# this call to inner() sees the wrong $x
inner("second");
}
outer("outer");
[L<GH #21987|https://github.com/Perl/perl5/issues/21987>]
=back
=item *
prepare_export_lexical() was separately saving C<PL_comppad> and
C<PL_curpad>, this could result in C<PL_curpad> being restored to a no
longer valid value, resulting in a panic when importing lexicals in
some cases. [L<GH #21981|https://github.com/Perl/perl5/issues/21981>]
=item *
A string eval() operation in the scope of a C<use VERSION> declaration would
sometimes emit spurious "Downgrading a use VERSION declaration" warnings due
to an inconsistency in the way the version number was stored. This is now
fixed.
[L<GH #22121|https://github.com/Perl/perl5/issues/22121>]
=back
=head1 Known Problems
=over 4
=item * perlivp is missing streamzip on Windows
The C<streamzip> utility does not get installed on Windows but should
get installed.
=back
=head1 Errata From Previous Releases
=over 4
=item *
L<perl5300delta> has been updated to include the removal of the C<arybase> module that happened at
the same time as the removal of C<$[>.
=back
=head1 Acknowledgements
Perl 5.40.0 represents approximately 11 months of development since Perl
5.38.0 and contains approximately 160,000 lines of changes across 1,500
files from 75 authors.
Excluding auto-generated files, documentation and release tools, there were
approximately 110,000 lines of changes to 1,200 .pm, .t, .c and .h files.
Perl continues to flourish into its fourth decade thanks to a vibrant
community of users and developers. The following people are known to have
contributed the improvements that became Perl 5.40.0:
Abe Timmerman, Alexander Kanavin, Amory Meltzer, Aristotle Pagaltzis, Arne
Johannessen, Beckett Normington, Bernard Quatermass, Bernd, Bruno Meneguele,
Chad Granum, Chris 'BinGOs' Williams, Christoph Lamprecht, Craig A. Berry,
Dagfinn Ilmari Mannsåker, Dan Book, Dan Church, Daniel Böhmer, Dan
Jacobson, Dan Kogai, David Golden, David Mitchell, E. Choroba, Elvin
Aslanov, Erik Huelsmann, Eugen Konkov, Gianni Ceccarelli, Graham Knop, Greg
Kennedy, guoguangwu, Hauke D, H.Merijn Brand, Hugo van der Sanden, iabyn,
Jake Hamby, Jakub Wilk, James E Keenan, James Raspass, Joe McMahon, Johan
Vromans, John Karr, Karen Etheridge, Karl Williamson, Leon Timmermans, Lukas
Mai, Marco Fontani, Marek Rouchal, Martijn Lievaart, Mathias Kende, Matthew
Horsfall, Max Maischein, Nicolas Mendoza, Nicolas R, OpossumPetya, Paul
Evans, Paul Marquess, Peter John Acklam, Philippe Bruhat (BooK), Raul E
Rangel, Renee Baecker, Ricardo Signes, Richard Leach, Scott Baker, Sevan
Janiyan, Sisyphus, Steve Hay, TAKAI Kousuke, Todd Rinaldo, Tomasz Konojacki,
Tom Hughes, Tony Cook, William Lyu, x-yuri, Yves Orton, Zakariyya Mughal,
Дилян Палаузов.
The list above is almost certainly incomplete as it is automatically
generated from version control history. In particular, it does not include
the names of the (very much appreciated) contributors who reported issues to
the Perl bug tracker.
Many of the changes included in this version originated in the CPAN modules
included in Perl's core. We're grateful to the entire CPAN community for
helping Perl to flourish.
For a more complete list of all of Perl's historical contributors, please
see the F<AUTHORS> file in the Perl source distribution.
=head1 Reporting Bugs
If you find what you think is a bug, you might check the perl bug database
at L<https://github.com/Perl/perl5/issues>. There may also be information at
L<https://www.perl.org/>, the Perl Home Page.
If you believe you have an unreported bug, please open an issue at
L<https://github.com/Perl/perl5/issues>. Be sure to trim your bug down to a
tiny but sufficient test case.
If the bug you are reporting has security implications which make it
inappropriate to send to a public issue tracker, then see
L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION>
for details of how to report the issue.
=head1 Give Thanks
If you wish to thank the Perl 5 Porters for the work we had done in Perl 5,
you can do so by running the C<perlthanks> program:
perlthanks
This will send an email to the Perl 5 Porters list with your show of thanks.
=head1 SEE ALSO
The F<Changes> file for an explanation of how to view exhaustive details on
what changed.
The F<INSTALL> file for how to build Perl.
The F<README> file for general stuff.
The F<Artistic> and F<Copying> files for copyright information.
=cut
|