1=encoding utf8 2 3=head1 NAME 4 5perl5240delta - what is new for perl v5.24.0 6 7=head1 DESCRIPTION 8 9This document describes the differences between the 5.22.0 release and the 105.24.0 release. 11 12=head1 Core Enhancements 13 14=head2 Postfix dereferencing is no longer experimental 15 16Using the C<postderef> and C<postderef_qq> features no longer emits a 17warning. Existing code that disables the C<experimental::postderef> warning 18category that they previously used will continue to work. The C<postderef> 19feature has no effect; all Perl code can use postfix dereferencing, 20regardless of what feature declarations are in scope. The C<5.24> feature 21bundle now includes the C<postderef_qq> feature. 22 23=head2 Unicode 8.0 is now supported 24 25For details on what is in this release, see 26L<http://www.unicode.org/versions/Unicode8.0.0/>. 27 28=head2 perl will now croak when closing an in-place output file fails 29 30Until now, failure to close the output file for an in-place edit was not 31detected, meaning that the input file could be clobbered without the edit being 32successfully completed. Now, when the output file cannot be closed 33successfully, an exception is raised. 34 35=head2 New C<\b{lb}> boundary in regular expressions 36 37C<lb> stands for Line Break. It is a Unicode property 38that determines where a line of text is suitable to break (typically so 39that it can be output without overflowing the available horizontal 40space). This capability has long been furnished by the 41L<Unicode::LineBreak> module, but now a light-weight, non-customizable 42version that is suitable for many purposes is in core Perl. 43 44=head2 C<qr/(?[ ])/> now works in UTF-8 locales 45 46L<Extended Bracketed Character Classes|perlrecharclass/Extended Bracketed Character Classes> 47now will successfully compile when S<C<use locale>> is in effect. The compiled 48pattern will use standard Unicode rules. If the runtime locale is not a 49UTF-8 one, a warning is raised and standard Unicode rules are used 50anyway. No tainting is done since the outcome does not actually depend 51on the locale. 52 53=head2 Integer shift (C<< << >> and C<< >> >>) now more explicitly defined 54 55Negative shifts are reverse shifts: left shift becomes right shift, 56and right shift becomes left shift. 57 58Shifting by the number of bits in a native integer (or more) is zero, 59except when the "overshift" is right shifting a negative value under 60C<use integer>, in which case the result is -1 (arithmetic shift). 61 62Until now negative shifting and overshifting have been undefined 63because they have relied on whatever the C implementation happens 64to do. For example, for the overshift a common C behavior is 65"modulo shift": 66 67 1 >> 64 == 1 >> (64 % 64) == 1 >> 0 == 1 # Common C behavior. 68 69 # And the same for <<, while Perl now produces 0 for both. 70 71Now these behaviors are well-defined under Perl, regardless of what 72the underlying C implementation does. Note, however, that you are still 73constrained by the native integer width: you need to know how far left you 74can go. You can use for example: 75 76 use Config; 77 my $wordbits = $Config{uvsize} * 8; # Or $Config{uvsize} << 3. 78 79If you need a more bits on the left shift, you can use for example 80the C<bigint> pragma, or the C<Bit::Vector> module from CPAN. 81 82=head2 printf and sprintf now allow reordered precision arguments 83 84That is, C<< sprintf '|%.*2$d|', 2, 3 >> now returns C<|002|>. This extends 85the existing reordering mechanism (which allows reordering for arguments 86that are used as format fields, widths, and vector separators). 87 88=head2 More fields provided to C<sigaction> callback with C<SA_SIGINFO> 89 90When passing the C<SA_SIGINFO> flag to L<sigaction|POSIX/sigaction>, the 91C<errno>, C<status>, C<uid>, C<pid>, C<addr> and C<band> fields are now 92included in the hash passed to the handler, if supported by the 93platform. 94 95=head2 Hashbang redirection to Perl 6 96 97Previously perl would redirect to another interpreter if it found a 98hashbang path unless the path contains "perl" (see L<perlrun>). To improve 99compatibility with Perl 6 this behavior has been extended to also redirect 100if "perl" is followed by "6". 101 102=head1 Security 103 104=head2 Set proper umask before calling C<mkstemp(3)> 105 106In 5.22 perl started setting umask to 0600 before calling C<mkstemp(3)> 107and restoring it afterwards. This wrongfully tells C<open(2)> to strip 108the owner read and write bits from the given mode before applying it, 109rather than the intended negation of leaving only those bits in place. 110 111Systems that use mode 0666 in C<mkstemp(3)> (like old versions of 112glibc) create a file with permissions 0066, leaving world read and 113write permissions regardless of current umask. 114 115This has been fixed by using umask 0177 instead. [perl #127322] 116 117=head2 Fix out of boundary access in Win32 path handling 118 119This is CVE-2015-8608. For more information see 120L<[GH #15067]|https://github.com/Perl/perl5/issues/15067> 121 122=head2 Fix loss of taint in canonpath 123 124This is CVE-2015-8607. For more information see 125L<[GH #15084]|https://github.com/Perl/perl5/issues/15084> 126 127=head2 Avoid accessing uninitialized memory in win32 C<crypt()> 128 129Added validation that will detect both a short salt and invalid characters 130in the salt. 131L<[GH #15091]|https://github.com/Perl/perl5/issues/15091> 132 133=head2 Remove duplicate environment variables from C<environ> 134 135Previously, if an environment variable appeared more than once in 136C<environ[]>, C<%ENV> would contain the last entry for that name, 137while a typical C<getenv()> would return the first entry. We now 138make sure C<%ENV> contains the same as what C<getenv> returns. 139 140Second, we remove duplicates from C<environ[]>, so if a setting 141with that name is set in C<%ENV>, we won't pass an unsafe value 142to a child process. 143 144[CVE-2016-2381] 145 146=head1 Incompatible Changes 147 148=head2 The C<autoderef> feature has been removed 149 150The experimental C<autoderef> feature (which allowed calling C<push>, 151C<pop>, C<shift>, C<unshift>, C<splice>, C<keys>, C<values>, and C<each> on 152a scalar argument) has been deemed unsuccessful. It has now been removed; 153trying to use the feature (or to disable the C<experimental::autoderef> 154warning it previously triggered) now yields an exception. 155 156=head2 Lexical $_ has been removed 157 158C<my $_> was introduced in Perl 5.10, and subsequently caused much confusion 159with no obvious solution. In Perl 5.18.0, it was made experimental on the 160theory that it would either be removed or redesigned in a less confusing (but 161backward-incompatible) way. Over the following years, no alternatives were 162proposed. The feature has now been removed and will fail to compile. 163 164=head2 C<qr/\b{wb}/> is now tailored to Perl expectations 165 166This is now more suited to be a drop-in replacement for plain C<\b>, but 167giving better results for parsing natural language. Previously it 168strictly followed the current Unicode rules which calls for it to match 169between each white space character. Now it doesn't generally match 170within spans of white space, behaving like C<\b> does. See 171L<perlrebackslash/\b{wb}> 172 173=head2 Regular expression compilation errors 174 175Some regular expression patterns that had runtime errors now 176don't compile at all. 177 178Almost all Unicode properties using the C<\p{}> and C<\P{}> regular 179expression pattern constructs are now checked for validity at pattern 180compilation time, and invalid ones will cause the program to not 181compile. In earlier releases, this check was often deferred until run 182time. Whenever an error check is moved from run- to compile time, 183erroneous code is caught 100% of the time, whereas before it would only 184get caught if and when the offending portion actually gets executed, 185which for unreachable code might be never. 186 187=head2 C<qr/\N{}/> now disallowed under C<use re "strict"> 188 189An empty C<\N{}> makes no sense, but for backwards compatibility is 190accepted as doing nothing, though a deprecation warning is raised by 191default. But now this is a fatal error under the experimental feature 192L<re/'strict' mode>. 193 194=head2 Nested declarations are now disallowed 195 196A C<my>, C<our>, or C<state> declaration is no longer allowed inside 197of another C<my>, C<our>, or C<state> declaration. 198 199For example, these are now fatal: 200 201 my ($x, my($y)); 202 our (my $x); 203 204L<[GH #14799]|https://github.com/Perl/perl5/issues/14799> 205 206L<[GH #13548]|https://github.com/Perl/perl5/issues/13548> 207 208=head2 The C</\C/> character class has been removed. 209 210This regular expression character class was deprecated in v5.20.0 and has 211produced a deprecation warning since v5.22.0. It is now a compile-time 212error. If you need to examine the individual bytes that make up a 213UTF8-encoded character, then use C<utf8::encode()> on the string (or a 214copy) first. 215 216=head2 C<chdir('')> no longer chdirs home 217 218Using C<chdir('')> or C<chdir(undef)> to chdir home has been deprecated since 219perl v5.8, and will now fail. Use C<chdir()> instead. 220 221=head2 ASCII characters in variable names must now be all visible 222 223It was legal until now on ASCII platforms for variable names to contain 224non-graphical ASCII control characters (ordinals 0 through 31, and 127, 225which are the C0 controls and C<DELETE>). This usage has been 226deprecated since v5.20, and as of now causes a syntax error. The 227variables these names referred to are special, reserved by Perl for 228whatever use it may choose, now, or in the future. Each such variable 229has an alternative way of spelling it. Instead of the single 230non-graphic control character, a two character sequence beginning with a 231caret is used, like C<$^]> and C<${^GLOBAL_PHASE}>. Details are at 232L<perlvar>. It remains legal, though unwise and deprecated (raising a 233deprecation warning), to use certain non-graphic non-ASCII characters in 234variables names when not under S<C<use utf8>>. No code should do this, 235as all such variables are reserved by Perl, and Perl doesn't currently 236define any of them (but could at any time, without notice). 237 238=head2 An off by one issue in C<$Carp::MaxArgNums> has been fixed 239 240C<$Carp::MaxArgNums> is supposed to be the number of arguments to display. 241Prior to this version, it was instead showing C<$Carp::MaxArgNums> + 1 arguments, 242contrary to the documentation. 243 244=head2 Only blanks and tabs are now allowed within C<[...]> within C<(?[...])>. 245 246The experimental Extended Bracketed Character Classes can contain regular 247bracketed character classes within them. These differ from regular ones in 248that white space is generally ignored, unless escaped by preceding it with a 249backslash. The white space that is ignored is now limited to just tab C<\t> 250and SPACE characters. Previously, it was any white space. See 251L<perlrecharclass/Extended Bracketed Character Classes>. 252 253=head1 Deprecations 254 255=head2 Using code points above the platform's C<IV_MAX> is now deprecated 256 257Unicode defines code points in the range C<0..0x10FFFF>. Some standards 258at one time defined them up to 2**31 - 1, but Perl has allowed them to 259be as high as anything that will fit in a word on the platform being 260used. However, use of those above the platform's C<IV_MAX> is broken in 261some constructs, notably C<tr///>, regular expression patterns involving 262quantifiers, and in some arithmetic and comparison operations, such as 263being the upper limit of a loop. Now the use of such code points raises 264a deprecation warning, unless that warning category is turned off. 265C<IV_MAX> is typically 2**31 -1 on 32-bit platforms, and 2**63-1 on 26664-bit ones. 267 268=head2 Doing bitwise operations on strings containing code points above 2690xFF is deprecated 270 271The string bitwise operators treat their operands as strings of bytes, 272and values beyond 0xFF are nonsensical in this context. To operate on 273encoded bytes, first encode the strings. To operate on code points' 274numeric values, use C<split> and C<map ord>. In the future, this 275warning will be replaced by an exception. 276 277=head2 C<sysread()>, C<syswrite()>, C<recv()> and C<send()> are deprecated on 278:utf8 handles 279 280The C<sysread()>, C<recv()>, C<syswrite()> and C<send()> operators 281are deprecated on handles that have the C<:utf8> layer, either 282explicitly, or implicitly, eg., with the C<:encoding(UTF-16LE)> layer. 283 284Both C<sysread()> and C<recv()> currently use only the C<:utf8> flag for the 285stream, ignoring the actual layers. Since C<sysread()> and C<recv()> do no 286UTF-8 validation they can end up creating invalidly encoded scalars. 287 288Similarly, C<syswrite()> and C<send()> use only the C<:utf8> flag, otherwise 289ignoring any layers. If the flag is set, both write the value UTF-8 290encoded, even if the layer is some different encoding, such as the 291example above. 292 293Ideally, all of these operators would completely ignore the C<:utf8> 294state, working only with bytes, but this would result in silently 295breaking existing code. To avoid this a future version of perl will 296throw an exception when any of C<sysread()>, C<recv()>, C<syswrite()> or C<send()> 297are called on handle with the C<:utf8> layer. 298 299=head1 Performance Enhancements 300 301=over 4 302 303=item * 304 305The overhead of scope entry and exit has been considerably reduced, so 306for example subroutine calls, loops and basic blocks are all faster now. 307This empty function call now takes about a third less time to execute: 308 309 sub f{} f(); 310 311=item * 312 313Many languages, such as Chinese, are caseless. Perl now knows about 314most common ones, and skips much of the work when 315a program tries to change case in them (like C<ucfirst()>) or match 316caselessly (C<qr//i>). This will speed up a program, such as a web 317server, that can operate on multiple languages, while it is operating on a 318caseless one. 319 320=item * 321 322C</fixed-substr/> has been made much faster. 323 324On platforms with a libc C<memchr()> implementation which makes good use of 325underlying hardware support, patterns which include fixed substrings will now 326often be much faster; for example with glibc on a recent x86_64 CPU, this: 327 328 $s = "a" x 1000 . "wxyz"; 329 $s =~ /wxyz/ for 1..30000 330 331is now about 7 times faster. On systems with slow C<memchr()>, e.g. 32-bit ARM 332Raspberry Pi, there will be a small or little speedup. Conversely, some 333pathological cases, such as C<"ab" x 1000 =~ /aa/> will be slower now; up to 3 334times slower on the rPi, 1.5x slower on x86_64. 335 336=item * 337 338Faster addition, subtraction and multiplication. 339 340Since 5.8.0, arithmetic became slower due to the need to support 34164-bit integers. To deal with 64-bit integers, a lot more corner 342cases need to be checked, which adds time. We now detect common 343cases where there is no need to check for those corner cases, 344and special-case them. 345 346=item * 347 348Preincrement, predecrement, postincrement, and postdecrement have been 349made faster by internally splitting the functions which handled multiple 350cases into different functions. 351 352=item * 353 354Creating Perl debugger data structures (see L<perldebguts/"Debugger Internals">) 355for XSUBs and const subs has been removed. This removed one glob/scalar combo 356for each unique C<.c> file that XSUBs and const subs came from. On startup 357(C<perl -e"0">) about half a dozen glob/scalar debugger combos were created. 358Loading XS modules created more glob/scalar combos. These things were 359being created regardless of whether the perl debugger was being used, 360and despite the fact that it can't debug C code anyway 361 362=item * 363 364On Win32, C<stat>ing or C<-X>ing a path, if the file or directory does not 365exist, is now 3.5x faster than before. 366 367=item * 368 369Single arguments in list assign are now slightly faster: 370 371 ($x) = (...); 372 (...) = ($x); 373 374=item * 375 376Less peak memory is now used when compiling regular expression patterns. 377 378=back 379 380=head1 Modules and Pragmata 381 382=head2 Updated Modules and Pragmata 383 384=over 385 386=item * 387 388L<arybase> has been upgraded from version 0.10 to 0.11. 389 390=item * 391 392L<Attribute::Handlers> has been upgraded from version 0.97 to 0.99. 393 394=item * 395 396L<autodie> has been upgraded from version 2.26 to 2.29. 397 398=item * 399 400L<autouse> has been upgraded from version 1.08 to 1.11. 401 402=item * 403 404L<B> has been upgraded from version 1.58 to 1.62. 405 406=item * 407 408L<B::Deparse> has been upgraded from version 1.35 to 1.37. 409 410=item * 411 412L<base> has been upgraded from version 2.22 to 2.23. 413 414=item * 415 416L<Benchmark> has been upgraded from version 1.2 to 1.22. 417 418=item * 419 420L<bignum> has been upgraded from version 0.39 to 0.42. 421 422=item * 423 424L<bytes> has been upgraded from version 1.04 to 1.05. 425 426=item * 427 428L<Carp> has been upgraded from version 1.36 to 1.40. 429 430=item * 431 432L<Compress::Raw::Bzip2> has been upgraded from version 2.068 to 2.069. 433 434=item * 435 436L<Compress::Raw::Zlib> has been upgraded from version 2.068 to 2.069. 437 438=item * 439 440L<Config::Perl::V> has been upgraded from version 0.24 to 0.25. 441 442=item * 443 444L<CPAN::Meta> has been upgraded from version 2.150001 to 2.150005. 445 446=item * 447 448L<CPAN::Meta::Requirements> has been upgraded from version 2.132 to 2.140. 449 450=item * 451 452L<CPAN::Meta::YAML> has been upgraded from version 0.012 to 0.018. 453 454=item * 455 456L<Data::Dumper> has been upgraded from version 2.158 to 2.160. 457 458=item * 459 460L<Devel::Peek> has been upgraded from version 1.22 to 1.23. 461 462=item * 463 464L<Devel::PPPort> has been upgraded from version 3.31 to 3.32. 465 466=item * 467 468L<Dumpvalue> has been upgraded from version 1.17 to 1.18. 469 470=item * 471 472L<DynaLoader> has been upgraded from version 1.32 to 1.38. 473 474=item * 475 476L<Encode> has been upgraded from version 2.72 to 2.80. 477 478=item * 479 480L<encoding> has been upgraded from version 2.14 to 2.17. 481 482=item * 483 484L<encoding::warnings> has been upgraded from version 0.11 to 0.12. 485 486=item * 487 488L<English> has been upgraded from version 1.09 to 1.10. 489 490=item * 491 492L<Errno> has been upgraded from version 1.23 to 1.25. 493 494=item * 495 496L<experimental> has been upgraded from version 0.013 to 0.016. 497 498=item * 499 500L<ExtUtils::CBuilder> has been upgraded from version 0.280221 to 0.280225. 501 502=item * 503 504L<ExtUtils::Embed> has been upgraded from version 1.32 to 1.33. 505 506=item * 507 508L<ExtUtils::MakeMaker> has been upgraded from version 7.04_01 to 7.10_01. 509 510=item * 511 512L<ExtUtils::ParseXS> has been upgraded from version 3.28 to 3.31. 513 514=item * 515 516L<ExtUtils::Typemaps> has been upgraded from version 3.28 to 3.31. 517 518=item * 519 520L<feature> has been upgraded from version 1.40 to 1.42. 521 522=item * 523 524L<fields> has been upgraded from version 2.17 to 2.23. 525 526=item * 527 528L<File::Find> has been upgraded from version 1.29 to 1.34. 529 530=item * 531 532L<File::Glob> has been upgraded from version 1.24 to 1.26. 533 534=item * 535 536L<File::Path> has been upgraded from version 2.09 to 2.12_01. 537 538=item * 539 540L<File::Spec> has been upgraded from version 3.56 to 3.63. 541 542=item * 543 544L<Filter::Util::Call> has been upgraded from version 1.54 to 1.55. 545 546=item * 547 548L<Getopt::Long> has been upgraded from version 2.45 to 2.48. 549 550=item * 551 552L<Hash::Util> has been upgraded from version 0.18 to 0.19. 553 554=item * 555 556L<Hash::Util::FieldHash> has been upgraded from version 1.15 to 1.19. 557 558=item * 559 560L<HTTP::Tiny> has been upgraded from version 0.054 to 0.056. 561 562=item * 563 564L<I18N::Langinfo> has been upgraded from version 0.12 to 0.13. 565 566=item * 567 568L<if> has been upgraded from version 0.0604 to 0.0606. 569 570=item * 571 572L<IO> has been upgraded from version 1.35 to 1.36. 573 574=item * 575 576IO-Compress has been upgraded from version 2.068 to 2.069. 577 578=item * 579 580L<IPC::Open3> has been upgraded from version 1.18 to 1.20. 581 582=item * 583 584L<IPC::SysV> has been upgraded from version 2.04 to 2.06_01. 585 586=item * 587 588L<List::Util> has been upgraded from version 1.41 to 1.42_02. 589 590=item * 591 592L<locale> has been upgraded from version 1.06 to 1.08. 593 594=item * 595 596L<Locale::Codes> has been upgraded from version 3.34 to 3.37. 597 598=item * 599 600L<Math::BigInt> has been upgraded from version 1.9997 to 1.999715. 601 602=item * 603 604L<Math::BigInt::FastCalc> has been upgraded from version 0.31 to 0.40. 605 606=item * 607 608L<Math::BigRat> has been upgraded from version 0.2608 to 0.260802. 609 610=item * 611 612L<Module::CoreList> has been upgraded from version 5.20150520 to 5.20160320. 613 614=item * 615 616L<Module::Metadata> has been upgraded from version 1.000026 to 1.000031. 617 618=item * 619 620L<mro> has been upgraded from version 1.17 to 1.18. 621 622=item * 623 624L<ODBM_File> has been upgraded from version 1.12 to 1.14. 625 626=item * 627 628L<Opcode> has been upgraded from version 1.32 to 1.34. 629 630=item * 631 632L<parent> has been upgraded from version 0.232 to 0.234. 633 634=item * 635 636L<Parse::CPAN::Meta> has been upgraded from version 1.4414 to 1.4417. 637 638=item * 639 640L<Perl::OSType> has been upgraded from version 1.008 to 1.009. 641 642=item * 643 644L<perlfaq> has been upgraded from version 5.021009 to 5.021010. 645 646=item * 647 648L<PerlIO::encoding> has been upgraded from version 0.21 to 0.24. 649 650=item * 651 652L<PerlIO::mmap> has been upgraded from version 0.014 to 0.016. 653 654=item * 655 656L<PerlIO::scalar> has been upgraded from version 0.22 to 0.24. 657 658=item * 659 660L<PerlIO::via> has been upgraded from version 0.15 to 0.16. 661 662=item * 663 664L<Pod::Functions> has been upgraded from version 1.09 to 1.10. 665 666=item * 667 668L<Pod::Perldoc> has been upgraded from version 3.25 to 3.25_02. 669 670=item * 671 672L<Pod::Simple> has been upgraded from version 3.29 to 3.32. 673 674=item * 675 676L<Pod::Usage> has been upgraded from version 1.64 to 1.68. 677 678=item * 679 680L<POSIX> has been upgraded from version 1.53 to 1.65. 681 682=item * 683 684L<Scalar::Util> has been upgraded from version 1.41 to 1.42_02. 685 686=item * 687 688L<SDBM_File> has been upgraded from version 1.13 to 1.14. 689 690=item * 691 692L<SelfLoader> has been upgraded from version 1.22 to 1.23. 693 694=item * 695 696L<Socket> has been upgraded from version 2.018 to 2.020_03. 697 698=item * 699 700L<Storable> has been upgraded from version 2.53 to 2.56. 701 702=item * 703 704L<strict> has been upgraded from version 1.09 to 1.11. 705 706=item * 707 708L<Term::ANSIColor> has been upgraded from version 4.03 to 4.04. 709 710=item * 711 712L<Term::Cap> has been upgraded from version 1.15 to 1.17. 713 714=item * 715 716L<Test> has been upgraded from version 1.26 to 1.28. 717 718=item * 719 720L<Test::Harness> has been upgraded from version 3.35 to 3.36. 721 722=item * 723 724L<Thread::Queue> has been upgraded from version 3.05 to 3.08. 725 726=item * 727 728L<threads> has been upgraded from version 2.01 to 2.06. 729 730=item * 731 732L<threads::shared> has been upgraded from version 1.48 to 1.50. 733 734=item * 735 736L<Tie::File> has been upgraded from version 1.01 to 1.02. 737 738=item * 739 740L<Tie::Scalar> has been upgraded from version 1.03 to 1.04. 741 742=item * 743 744L<Time::HiRes> has been upgraded from version 1.9726 to 1.9732. 745 746=item * 747 748L<Time::Piece> has been upgraded from version 1.29 to 1.31. 749 750=item * 751 752L<Unicode::Collate> has been upgraded from version 1.12 to 1.14. 753 754=item * 755 756L<Unicode::Normalize> has been upgraded from version 1.18 to 1.25. 757 758=item * 759 760L<Unicode::UCD> has been upgraded from version 0.61 to 0.64. 761 762=item * 763 764L<UNIVERSAL> has been upgraded from version 1.12 to 1.13. 765 766=item * 767 768L<utf8> has been upgraded from version 1.17 to 1.19. 769 770=item * 771 772L<version> has been upgraded from version 0.9909 to 0.9916. 773 774=item * 775 776L<warnings> has been upgraded from version 1.32 to 1.36. 777 778=item * 779 780L<Win32> has been upgraded from version 0.51 to 0.52. 781 782=item * 783 784L<Win32API::File> has been upgraded from version 0.1202 to 0.1203. 785 786=item * 787 788L<XS::Typemap> has been upgraded from version 0.13 to 0.14. 789 790=item * 791 792L<XSLoader> has been upgraded from version 0.20 to 0.21. 793 794=back 795 796=head1 Documentation 797 798=head2 Changes to Existing Documentation 799 800=head3 L<perlapi> 801 802=over 4 803 804=item * 805 806The process of using undocumented globals has been documented, namely, that one 807should send email to L<perl5-porters@perl.org|mailto:perl5-porters@perl.org> 808first to get the go-ahead for documenting and using an undocumented function or 809global variable. 810 811=back 812 813=head3 L<perlcall> 814 815=over 4 816 817=item * 818 819A number of cleanups have been made to perlcall, including: 820 821=over 4 822 823=item * 824 825use C<EXTEND(SP, n)> and C<PUSHs()> instead of C<XPUSHs()> where applicable 826and update prose to match 827 828=item * 829 830add POPu, POPul and POPpbytex to the "complete list of POP macros" 831and clarify the documentation for some of the existing entries, and 832a note about side-effects 833 834=item * 835 836add API documentation for POPu and POPul 837 838=item * 839 840use ERRSV more efficiently 841 842=item * 843 844approaches to thread-safety storage of SVs. 845 846=back 847 848=back 849 850=head3 L<perlfunc> 851 852=over 4 853 854=item * 855 856The documentation of C<hex> has been revised to clarify valid inputs. 857 858=item * 859 860Better explain meaning of negative PIDs in C<waitpid>. 861L<[GH #15108]|https://github.com/Perl/perl5/issues/15108> 862 863=item * 864 865General cleanup: there's more consistency now (in POD usage, grammar, code 866examples), better practices in code examples (use of C<my>, removal of bareword 867filehandles, dropped usage of C<&> when calling subroutines, ...), etc. 868 869=back 870 871=head3 L<perlguts> 872 873=over 4 874 875=item * 876 877A new section has been added, L<perlguts/"Dynamic Scope and the Context 878Stack">, which explains how the perl context stack works. 879 880=back 881 882=head3 L<perllocale> 883 884=over 4 885 886=item * 887 888A stronger caution about using locales in threaded applications is 889given. Locales are not thread-safe, and you can get wrong results or 890even segfaults if you use them there. 891 892=back 893 894=head3 L<perlmodlib> 895 896=over 4 897 898=item * 899 900We now recommend contacting the module-authors list or PAUSE in seeking 901guidance on the naming of modules. 902 903=back 904 905=head3 L<perlop> 906 907=over 4 908 909=item * 910 911The documentation of C<qx//> now describes how C<$?> is affected. 912 913=back 914 915=head3 L<perlpolicy> 916 917=over 4 918 919=item * 920 921This note has been added to perlpolicy: 922 923 While civility is required, kindness is encouraged; if you have any 924 doubt about whether you are being civil, simply ask yourself, "Am I 925 being kind?" and aspire to that. 926 927=back 928 929=head3 L<perlreftut> 930 931=over 4 932 933=item * 934 935Fix some examples to be L<strict> clean. 936 937=back 938 939=head3 L<perlrebackslash> 940 941=over 4 942 943=item * 944 945Clarify that in languages like Japanese and Thai, dictionary lookup 946is required to determine word boundaries. 947 948=back 949 950=head3 L<perlsub> 951 952=over 4 953 954=item * 955 956Updated to note that anonymous subroutines can have signatures. 957 958=back 959 960=head3 L<perlsyn> 961 962=over 4 963 964=item * 965 966Fixed a broken example where C<=> was used instead of 967C<==> in conditional in do/while example. 968 969=back 970 971=head3 L<perltie> 972 973=over 4 974 975=item * 976 977The usage of C<FIRSTKEY> and C<NEXTKEY> has been clarified. 978 979=back 980 981=head3 L<perlunicode> 982 983=over 4 984 985=item * 986 987Discourage use of 'In' as a prefix signifying the Unicode Block property. 988 989=back 990 991=head3 L<perlvar> 992 993=over 4 994 995=item * 996 997The documentation of C<$@> was reworded to clarify that it is not just for 998syntax errors in C<eval>. 999L<[GH #14572]|https://github.com/Perl/perl5/issues/14572> 1000 1001=item * 1002 1003The specific true value of C<$!{E...}> is now documented, noting that it is 1004subject to change and not guaranteed. 1005 1006=item * 1007 1008Use of C<$OLD_PERL_VERSION> is now discouraged. 1009 1010=back 1011 1012=head3 L<perlxs> 1013 1014=over 4 1015 1016=item * 1017 1018The documentation of C<PROTOTYPES> has been corrected; they are I<disabled> 1019by default, not I<enabled>. 1020 1021=back 1022 1023=head1 Diagnostics 1024 1025The following additions or changes have been made to diagnostic output, 1026including warnings and fatal error messages. For the complete list of 1027diagnostic messages, see L<perldiag>. 1028 1029=head2 New Diagnostics 1030 1031=head3 New Errors 1032 1033=over 4 1034 1035=item * 1036 1037L<%s must not be a named sequence in transliteration operator|perldiag/"%s must not be a named sequence in transliteration operator"> 1038 1039=item * 1040 1041L<Can't find Unicode property definition "%s" in regex;|perldiag/"Can't find Unicode property definition "%s" in regex; marked by <-- HERE in m/%s/"> 1042 1043=item * 1044 1045L<Can't redeclare "%s" in "%s"|perldiag/"Can't redeclare "%s" in "%s""> 1046 1047=item * 1048 1049L<Character following \p must be '{' or a single-character Unicode property name in regex;|perldiag/"Character following \%c must be '{' or a single-character Unicode property name in regex; marked by <-- HERE in m/%s/"> 1050 1051=item * 1052 1053L<Empty \%c in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol> 1054|perldiag/"Empty \%c in regex; marked by <-- HERE in mE<sol>%sE<sol>"> 1055 1056=item * 1057 1058L<Illegal user-defined property name|perldiag/"Illegal user-defined property name"> 1059 1060=item * 1061 1062L<Invalid number '%s' for -C option.|perldiag/"Invalid number '%s' for -C option."> 1063 1064=item * 1065 1066L<<< Sequence (?... not terminated in regex; marked by S<<-- HERE> in mE<sol>%sE<sol>|perldiag/"Sequence (?... not terminated in regex; marked by <-- HERE in mE<sol>%sE<sol>" >>> 1067 1068=item * 1069 1070L<<< Sequence (?PE<lt>... not terminated in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol> 1071|perldiag/"Sequence (?PE<lt>... not terminated in regex; marked by <-- HERE in mE<sol>%sE<sol>" >>> 1072 1073=item * 1074 1075L<Sequence (?PE<gt>... not terminated in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol> 1076|perldiag/"Sequence (?PE<gt>... not terminated in regex; marked by <-- HERE in mE<sol>%sE<sol>"> 1077 1078=back 1079 1080=head3 New Warnings 1081 1082=over 4 1083 1084=item * 1085 1086L<Assuming NOT a POSIX class since %s in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol>| 1087perldiag/Assuming NOT a POSIX class since %s in regex; marked by <-- HERE in mE<sol>%sE<sol>> 1088 1089=item * 1090 1091L<%s() is deprecated on :utf8 handles|perldiag/"%s() is deprecated on :utf8 handles"> 1092 1093=back 1094 1095=head2 Changes to Existing Diagnostics 1096 1097=over 4 1098 1099=item * 1100 1101Accessing the C<IO> part of a glob as C<FILEHANDLE> instead of C<IO> is no 1102longer deprecated. It is discouraged to encourage uniformity (so that, for 1103example, one can grep more easily) but it will not be removed. 1104L<[GH #15105]|https://github.com/Perl/perl5/issues/15105> 1105 1106=item * 1107 1108The diagnostic C<< Hexadecimal float: internal error >> has been changed to 1109C<< Hexadecimal float: internal error (%s) >> to include more information. 1110 1111=item * 1112 1113L<Can't modify non-lvalue subroutine call of &%s|perldiag/"Can't modify non-lvalue subroutine call of &%s"> 1114 1115This error now reports the name of the non-lvalue subroutine you attempted to 1116use as an lvalue. 1117 1118=item * 1119 1120When running out of memory during an attempt the increase the stack 1121size, previously, perl would die using the cryptic message 1122C<< panic: av_extend_guts() negative count (-9223372036854775681) >>. 1123This has been fixed to show the prettier message: 1124L<< Out of memory during stack extend|perldiag/"Out of memory during %s extend" >> 1125 1126=back 1127 1128=head1 Configuration and Compilation 1129 1130=over 4 1131 1132=item * 1133 1134C<Configure> now acts as if the C<-O> option is always passed, allowing command 1135line options to override saved configuration. This should eliminate confusion 1136when command line options are ignored for no obvious reason. C<-O> is now 1137permitted, but ignored. 1138 1139=item * 1140 1141Bison 3.0 is now supported. 1142 1143=item * 1144 1145F<Configure> no longer probes for F<libnm> by default. Originally 1146this was the "New Math" library, but the name has been re-used by the 1147GNOME NetworkManager. 1148L<[GH #15115]|https://github.com/Perl/perl5/issues/15115> 1149 1150=item * 1151 1152Added F<Configure> probes for C<newlocale>, C<freelocale>, and C<uselocale>. 1153 1154=item * 1155 1156C<< PPPort.so/PPPort.dll >> no longer get installed, as they are 1157not used by C<< PPPort.pm >>, only by its test files. 1158 1159=item * 1160 1161It is now possible to specify which compilation date to show on 1162C<< perl -V >> output, by setting the macro C<< PERL_BUILD_DATE >>. 1163 1164=item * 1165 1166Using the C<NO_HASH_SEED> define in combination with the default hash algorithm 1167C<PERL_HASH_FUNC_ONE_AT_A_TIME_HARD> resulted in a fatal error while compiling 1168the interpreter, since Perl 5.17.10. This has been fixed. 1169 1170=item * 1171 1172F<Configure> should handle spaces in paths a little better. 1173 1174=item * 1175 1176No longer generate EBCDIC POSIX-BC tables. We don't believe anyone is 1177using Perl and POSIX-BC at this time, and by not generating these tables 1178it saves time during development, and makes the resulting tar ball smaller. 1179 1180=item * 1181 1182The GNU Make makefile for Win32 now supports parallel builds. [perl #126632] 1183 1184=item * 1185 1186You can now build perl with MSVC++ on Win32 using GNU Make. [perl #126632] 1187 1188=item * 1189 1190The Win32 miniperl now has a real C<getcwd> which increases build performance 1191resulting in C<getcwd()> being 605x faster in Win32 miniperl. 1192 1193=item * 1194 1195Configure now takes C<-Dusequadmath> into account when calculating the 1196C<alignbytes> configuration variable. Previously the mis-calculated 1197C<alignbytes> could cause alignment errors on debugging builds. [perl 1198#127894] 1199 1200=back 1201 1202=head1 Testing 1203 1204=over 4 1205 1206=item * 1207 1208A new test (F<t/op/aassign.t>) has been added to test the list assignment operator 1209C<OP_AASSIGN>. 1210 1211=item * 1212 1213Parallel building has been added to the dmake C<makefile.mk> makefile. All 1214Win32 compilers are supported. 1215 1216=back 1217 1218=head1 Platform Support 1219 1220=head2 Platform-Specific Notes 1221 1222=over 4 1223 1224=item AmigaOS 1225 1226=over 4 1227 1228=item * 1229 1230The AmigaOS port has been reintegrated into the main tree, based off of 1231Perl 5.22.1. 1232 1233=back 1234 1235=item Cygwin 1236 1237=over 4 1238 1239=item * 1240 1241Tests are more robust against unusual cygdrive prefixes. 1242L<[GH #15076]|https://github.com/Perl/perl5/issues/15076> 1243 1244=back 1245 1246=item EBCDIC 1247 1248=over 4 1249 1250=item UTF-EBCDIC extended 1251 1252UTF-EBCDIC is like UTF-8, but for EBCDIC platforms. It now has been 1253extended so that it can represent code points up to 2 ** 64 - 1 on 1254platforms with 64-bit words. This brings it into parity with UTF-8. 1255This enhancement requires an incompatible change to the representation 1256of code points in the range 2 ** 30 to 2 ** 31 -1 (the latter was the 1257previous maximum representable code point). This means that a file that 1258contains one of these code points, written out with previous versions of 1259perl cannot be read in, without conversion, by a perl containing this 1260change. We do not believe any such files are in existence, but if you 1261do have one, submit a ticket at L<perlbug@perl.org|mailto:perlbug@perl.org>, 1262and we will write a conversion script for you. 1263 1264=item EBCDIC C<cmp()> and C<sort()> fixed for UTF-EBCDIC strings 1265 1266Comparing two strings that were both encoded in UTF-8 (or more 1267precisely, UTF-EBCDIC) did not work properly until now. Since C<sort()> 1268uses C<cmp()>, this fixes that as well. 1269 1270=item EBCDIC C<tr///> and C<y///> fixed for C<\N{}>, and C<S<use utf8>> ranges 1271 1272Perl v5.22 introduced the concept of portable ranges to regular 1273expression patterns. A portable range matches the same set of 1274characters no matter what platform is being run on. This concept is now 1275extended to C<tr///>. See 1276C<L<trE<sol>E<sol>E<sol>|perlop/trE<sol>SEARCHLISTE<sol>REPLACEMENTLISTE<sol>cdsr>>. 1277 1278There were also some problems with these operations under S<C<use 1279utf8>>, which are now fixed 1280 1281=back 1282 1283=item FreeBSD 1284 1285=over 4 1286 1287=item * 1288 1289Use the C<fdclose()> function from FreeBSD if it is available. 1290L<[GH #15082]|https://github.com/Perl/perl5/issues/15082> 1291 1292=back 1293 1294=item IRIX 1295 1296=over 4 1297 1298=item * 1299 1300Under some circumstances IRIX stdio C<fgetc()> and C<fread()> set the errno to 1301C<ENOENT>, which made no sense according to either IRIX or POSIX docs. Errno 1302is now cleared in such cases. 1303L<[GH #14557]|https://github.com/Perl/perl5/issues/14557> 1304 1305=item * 1306 1307Problems when multiplying long doubles by infinity have been fixed. 1308L<[GH #14993]|https://github.com/Perl/perl5/issues/14993> 1309 1310=back 1311 1312=item MacOS X 1313 1314=over 4 1315 1316=item * 1317 1318Until now OS X builds of perl have specified a link target of 10.3 (Panther, 13192003) but have not specified a compiler target. From now on, builds of perl on 1320OS X 10.6 or later (Snow Leopard, 2008) by default capture the current OS X 1321version and specify that as the explicit build target in both compiler and 1322linker flags, thus preserving binary compatibility for extensions built later 1323regardless of changes in OS X, SDK, or compiler and linker versions. To 1324override the default value used in the build and preserved in the flags, 1325specify C<export MACOSX_DEPLOYMENT_TARGET=10.N> before configuring and building 1326perl, where 10.N is the version of OS X you wish to target. In OS X 10.5 or 1327earlier there is no change to the behavior present when those systems were 1328current; the link target is still OS X 10.3 and there is no explicit compiler 1329target. 1330 1331=item * 1332 1333Builds with both -DDEBUGGING and threading enabled would fail with a 1334"panic: free from wrong pool" error when built or tested from Terminal 1335on OS X. This was caused by perl's internal management of the 1336environment conflicting with an atfork handler using the libc 1337C<setenv()> function to update the environment. 1338 1339Perl now uses C<setenv()>/C<unsetenv()> to update the environment on OS X. 1340L<[GH #14955]|https://github.com/Perl/perl5/issues/14955> 1341 1342=back 1343 1344=item Solaris 1345 1346=over 4 1347 1348=item * 1349 1350All Solaris variants now build a shared libperl 1351 1352Solaris and variants like OpenIndiana now always build with the shared 1353Perl library (Configure -Duseshrplib). This was required for the 1354OpenIndiana builds, but this has also been the setting for Oracle/Sun 1355Perl builds for several years. 1356 1357=back 1358 1359=item Tru64 1360 1361=over 4 1362 1363=item * 1364 1365Workaround where Tru64 balks when prototypes are listed as 1366C<< PERL_STATIC_INLINE >>, but where the test is build with 1367C<< -DPERL_NO_INLINE_FUNCTIONS >>. 1368 1369=back 1370 1371=item VMS 1372 1373=over 4 1374 1375=item * 1376 1377On VMS, the math function prototypes in C<math.h> are now visible under C++. 1378Now building the POSIX extension with C++ will no longer crash. 1379 1380=item * 1381 1382VMS has had C<setenv>/C<unsetenv> since v7.0 (released in 1996), 1383C<Perl_vmssetenv> now always uses C<setenv>/C<unsetenv>. 1384 1385=item * 1386 1387Perl now implements its own C<killpg> by scanning for processes in the 1388specified process group, which may not mean exactly the same thing as a Unix 1389process group, but allows us to send a signal to a parent (or master) process 1390and all of its sub-processes. At the perl level, this means we can now send a 1391negative pid like so: 1392 1393 kill SIGKILL, -$pid; 1394 1395to signal all processes in the same group as C<$pid>. 1396 1397=item * 1398 1399For those C<%ENV> elements based on the CRTL environ array, we've always 1400preserved case when setting them but did look-ups only after upcasing the 1401key first, which made lower- or mixed-case entries go missing. This problem 1402has been corrected by making C<%ENV> elements derived from the environ array 1403case-sensitive on look-up as well as case-preserving on store. 1404 1405=item * 1406 1407Environment look-ups for C<PERL5LIB> and C<PERLLIB> previously only 1408considered logical names, but now consider all sources of C<%ENV> as 1409determined by C<PERL_ENV_TABLES> and as documented in L<perlvms/%ENV>. 1410 1411=item * 1412 1413The minimum supported version of VMS is now v7.3-2, released in 2003. As a 1414side effect of this change, VAX is no longer supported as the terminal 1415release of OpenVMS VAX was v7.3 in 2001. 1416 1417=back 1418 1419=item Win32 1420 1421=over 4 1422 1423=item * 1424 1425A new build option C<USE_NO_REGISTRY> has been added to the makefiles. This 1426option is off by default, meaning the default is to do Windows registry 1427lookups. This option stops Perl from looking inside the registry for anything. 1428For what values are looked up in the registry see L<perlwin32>. Internally, in 1429C, the name of this option is C<WIN32_NO_REGISTRY>. 1430 1431=item * 1432 1433The behavior of Perl using C<HKEY_CURRENT_USER\Software\Perl> and 1434C<HKEY_LOCAL_MACHINE\Software\Perl> to lookup certain values, including C<%ENV> 1435vars starting with C<PERL> has changed. Previously, the 2 keys were checked 1436for entries at all times through the perl process's life time even if 1437they did not 1438exist. For performance reasons, now, if the root key (i.e. 1439C<HKEY_CURRENT_USER\Software\Perl> or C<HKEY_LOCAL_MACHINE\Software\Perl>) does 1440not exist at process start time, it will not be checked again for C<%ENV> 1441override entries for the remainder of the perl process's life. This more 1442closely matches Unix behavior in that the environment is copied or inherited 1443on startup and changing the variable in the parent process or another process 1444or editing F<.bashrc> will not change the environmental variable in other 1445existing, running, processes. 1446 1447=item * 1448 1449One glob fetch was removed for each C<-X> or C<stat> call whether done from 1450Perl code or internally from Perl's C code. The glob being looked up was 1451C<${^WIN32_SLOPPY_STAT}> which is a special variable. This makes C<-X> and 1452C<stat> slightly faster. 1453 1454=item * 1455 1456During miniperl's process startup, during the build process, 4 to 8 IO calls 1457related to the process starting F<.pl> and the F<buildcustomize.pl> file were 1458removed from the code opening and executing the first 1 or 2 F<.pl> files. 1459 1460=item * 1461 1462Builds using Microsoft Visual C++ 2003 and earlier no longer produce 1463an "INTERNAL COMPILER ERROR" message. [perl #126045] 1464 1465=item * 1466 1467Visual C++ 2013 builds will now execute on XP and higher. Previously they would 1468only execute on Vista and higher. 1469 1470=item * 1471 1472You can now build perl with GNU Make and GCC. [perl #123440] 1473 1474=item * 1475 1476C<truncate($filename, $size)> now works for files over 4GB in size. 1477[perl #125347] 1478 1479=item * 1480 1481Parallel building has been added to the dmake C<makefile.mk> makefile. All 1482Win32 compilers are supported. 1483 1484=item * 1485 1486Building a 64-bit perl with a 64-bit GCC but a 32-bit gmake would 1487result in an invalid C<$Config{archname}> for the resulting perl. 1488[perl #127584] 1489 1490=item * 1491 1492Errors set by Winsock functions are now put directly into C<$^E>, and the 1493relevant C<WSAE*> error codes are now exported from the L<Errno> and L<POSIX> 1494modules for testing this against. 1495 1496The previous behavior of putting the errors (converted to POSIX-style C<E*> 1497error codes since Perl 5.20.0) into C<$!> was buggy due to the non-equivalence 1498of like-named Winsock and POSIX error constants, a relationship between which 1499has unfortunately been established in one way or another since Perl 5.8.0. 1500 1501The new behavior provides a much more robust solution for checking Winsock 1502errors in portable software without accidentally matching POSIX tests that were 1503intended for other OSes and may have different meanings for Winsock. 1504 1505The old behavior is currently retained, warts and all, for backwards 1506compatibility, but users are encouraged to change any code that tests C<$!> 1507against C<E*> constants for Winsock errors to instead test C<$^E> against 1508C<WSAE*> constants. After a suitable deprecation period, the old behavior may 1509be removed, leaving C<$!> unchanged after Winsock function calls, to avoid any 1510possible confusion over which error variable to check. 1511 1512=back 1513 1514=item ppc64el 1515 1516=over 4 1517 1518=item floating point 1519 1520The floating point format of ppc64el (Debian naming for little-endian 1521PowerPC) is now detected correctly. 1522 1523=back 1524 1525=back 1526 1527=head1 Internal Changes 1528 1529=over 4 1530 1531=item * 1532 1533The implementation of perl's context stack system, and its internal API, 1534have been heavily reworked. Note that no significant changes have been 1535made to any external APIs, but XS code which relies on such internal 1536details may need to be fixed. The main changes are: 1537 1538=over 4 1539 1540=item * 1541 1542The C<PUSHBLOCK()>, C<POPSUB()> etc. macros have been replaced with static 1543inline functions such as C<cx_pushblock()>, C<cx_popsub()> etc. These use 1544function args rather than implicitly relying on local vars such as 1545C<gimme> and C<newsp> being available. Also their functionality has 1546changed: in particular, C<cx_popblock()> no longer decrements 1547C<cxstack_ix>. The ordering of the steps in the C<pp_leave*> functions 1548involving C<cx_popblock()>, C<cx_popsub()> etc. has changed. See the new 1549documentation, L<perlguts/"Dynamic Scope and the Context Stack">, for 1550details on how to use them. 1551 1552=item * 1553 1554Various macros, which now consistently have a CX_ prefix, have been added: 1555 1556 CX_CUR(), CX_LEAVE_SCOPE(), CX_POP() 1557 1558or renamed: 1559 1560 CX_POP_SAVEARRAY(), CX_DEBUG(), CX_PUSHSUBST(), CX_POPSUBST() 1561 1562=item * 1563 1564C<cx_pushblock()> now saves C<PL_savestack_ix> and C<PL_tmps_floor>, so 1565C<pp_enter*> and C<pp_leave*> no longer do 1566 1567 ENTER; SAVETMPS; ....; LEAVE 1568 1569=item * 1570 1571C<cx_popblock()> now also restores C<PL_curpm>. 1572 1573=item * 1574 1575In C<dounwind()> for every context type, the current savestack frame is 1576now processed before each context is popped; formerly this was only done 1577for sub-like context frames. This action has been removed from 1578C<cx_popsub()> and placed into its own macro, C<CX_LEAVE_SCOPE(cx)>, which 1579must be called before C<cx_popsub()> etc. 1580 1581C<dounwind()> now also does a C<cx_popblock()> on the last popped frame 1582(formerly it only did the C<cx_popsub()> etc. actions on each frame). 1583 1584=item * 1585 1586The temps stack is now freed on scope exit; previously, temps created 1587during the last statement of a block wouldn't be freed until the next 1588C<nextstate> following the block (apart from an existing hack that did 1589this for recursive subs in scalar context); and in something like 1590C<f(g())>, the temps created by the last statement in C<g()> would 1591formerly not be freed until the statement following the return from 1592C<f()>. 1593 1594=item * 1595 1596Most values that were saved on the savestack on scope entry are now 1597saved in suitable new fields in the context struct, and saved and 1598restored directly by C<cx_pushfoo()> and C<cx_popfoo()>, which is much 1599faster. 1600 1601=item * 1602 1603Various context struct fields have been added, removed or modified. 1604 1605=item * 1606 1607The handling of C<@_> in C<cx_pushsub()> and C<cx_popsub()> has been 1608considerably tidied up, including removing the C<argarray> field from the 1609context struct, and extracting out some common (but rarely used) code into 1610a separate function, C<clear_defarray()>. Also, useful subsets of 1611C<cx_popsub()> which had been unrolled in places like C<pp_goto> have been 1612gathered into the new functions C<cx_popsub_args()> and 1613C<cx_popsub_common()>. 1614 1615=item * 1616 1617C<pp_leavesub> and C<pp_leavesublv> now use the same function as the rest 1618of the C<pp_leave*>'s to process return args. 1619 1620=item * 1621 1622C<CXp_FOR_PAD> and C<CXp_FOR_GV> flags have been added, and 1623C<CXt_LOOP_FOR> has been split into C<CXt_LOOP_LIST>, C<CXt_LOOP_ARY>. 1624 1625=item * 1626 1627Some variables formerly declared by C<dMULTICALL> (but not documented) have 1628been removed. 1629 1630=back 1631 1632=item * 1633 1634The obscure C<PL_timesbuf> variable, effectively a vestige of Perl 1, has 1635been removed. It was documented as deprecated in Perl 5.20, with a statement 1636that it would be removed early in the 5.21.x series; that has now finally 1637happened. 1638L<[GH #13632]|https://github.com/Perl/perl5/issues/13632> 1639 1640=item * 1641 1642An unwarranted assertion in C<Perl_newATTRSUB_x()> has been removed. If 1643a stub subroutine 1644definition with a prototype has been seen, then any subsequent stub (or 1645definition) of the same subroutine with an attribute was causing an assertion 1646failure because of a null pointer. 1647L<[GH #15081]|https://github.com/Perl/perl5/issues/15081> 1648 1649=item * 1650 1651C<::> has been replaced by C<__> in C<ExtUtils::ParseXS>, like it's done for 1652parameters/return values. This is more consistent, and simplifies writing XS 1653code wrapping C++ classes into a nested Perl namespace (it requires only 1654a typedef for C<Foo__Bar> rather than two, one for C<Foo_Bar> and the other 1655for C<Foo::Bar>). 1656 1657=item * 1658 1659The C<to_utf8_case()> function is now deprecated. Instead use 1660C<toUPPER_utf8>, C<toTITLE_utf8>, C<toLOWER_utf8>, and C<toFOLD_utf8>. 1661(See L<http://nntp.perl.org/group/perl.perl5.porters/233287>.) 1662 1663=item * 1664 1665Perl core code and the threads extension have been annotated so that, 1666if Perl is configured to use threads, then during compile-time clang (3.6 1667or later) will warn about suspicious uses of mutexes. 1668See L<http://clang.llvm.org/docs/ThreadSafetyAnalysis.html> for more 1669information. 1670 1671=item * 1672 1673The C<signbit()> emulation has been enhanced. This will help older 1674and/or more exotic platforms or configurations. 1675 1676 1677=item * 1678 1679Most EBCDIC-specific code in the core has been unified with non-EBCDIC 1680code, to avoid repetition and make maintenance easier. 1681 1682=item * 1683 1684MSWin32 code for C<$^X> has been moved out of the F<win32> directory to 1685F<caretx.c>, where other operating systems set that variable. 1686 1687=item * 1688 1689C<< sv_ref() >> is now part of the API. 1690 1691=item * 1692 1693L<perlapi/sv_backoff> had its return type changed from C<int> to C<void>. It 1694previously has always returned C<0> since Perl 5.000 stable but that was 1695undocumented. Although C<sv_backoff> is marked as public API, XS code is not 1696expected to be impacted since the proper API call would be through public API 1697C<sv_setsv(sv, &PL_sv_undef)>, or quasi-public C<SvOOK_off>, or non-public 1698C<SvOK_off> calls, and the return value of C<sv_backoff> was previously a 1699meaningless constant that can be rewritten as C<(sv_backoff(sv),0)>. 1700 1701=item * 1702 1703The C<EXTEND> and C<MEXTEND> macros have been improved to avoid various issues 1704with integer truncation and wrapping. In particular, some casts formerly used 1705within the macros have been removed. This means for example that passing an 1706unsigned C<nitems> argument is likely to raise a compiler warning now 1707(it's always been documented to require a signed value; formerly int, 1708lately SSize_t). 1709 1710=item * 1711 1712C<PL_sawalias> and C<GPf_ALIASED_SV> have been removed. 1713 1714=item * 1715 1716C<GvASSIGN_GENERATION> and C<GvASSIGN_GENERATION_set> have been removed. 1717 1718=back 1719 1720=head1 Selected Bug Fixes 1721 1722=over 4 1723 1724=item * 1725 1726It now works properly to specify a user-defined property, such as 1727 1728 qr/\p{mypkg1::IsMyProperty}/i 1729 1730with C</i> caseless matching, an explicit package name, and 1731I<IsMyProperty> not defined at the time of the pattern compilation. 1732 1733=item * 1734 1735Perl's C<memcpy()>, C<memmove()>, C<memset()> and C<memcmp()> fallbacks are now 1736more compatible with the originals. [perl #127619] 1737 1738=item * 1739 1740Fixed the issue where a C<< s///r >>) with B<< -DPERL_NO_COW >> attempts 1741to modify the source SV, resulting in the program dying. [perl #127635] 1742 1743=item * 1744 1745Fixed an EBCDIC-platform-only case where a pattern could fail to match. This 1746occurred when matching characters from the set of C1 controls when the 1747target matched string was in UTF-8. 1748 1749=item * 1750 1751Narrow the filename check in F<strict.pm> and F<warnings.pm>. Previously, 1752it assumed that if the filename (without the F<.pmc?> extension) differed 1753from the package name, if was a misspelled use statement (i.e. C<use Strict> 1754instead of C<use strict>). We now check whether there's really a 1755miscapitalization happening, and not some other issue. 1756 1757=item * 1758 1759Turn an assertion into a more user friendly failure when parsing 1760regexes. [perl #127599] 1761 1762=item * 1763 1764Correctly raise an error when trying to compile patterns with 1765unterminated character classes while there are trailing backslashes. 1766[perl #126141]. 1767 1768=item * 1769 1770Line numbers larger than 2**31-1 but less than 2**32 are no longer 1771returned by C<caller()> as negative numbers. [perl #126991] 1772 1773=item * 1774 1775C<< unless ( I<assignment> ) >> now properly warns when syntax 1776warnings are enabled. [perl #127122] 1777 1778=item * 1779 1780Setting an C<ISA> glob to an array reference now properly adds 1781C<isaelem> magic to any existing elements. Previously modifying such 1782an element would not update the ISA cache, so method calls would call 1783the wrong function. Perl would also crash if the C<ISA> glob was 1784destroyed, since new code added in 5.23.7 would try to release the 1785C<isaelem> magic from the elements. [perl #127351] 1786 1787=item * 1788 1789If a here-doc was found while parsing another operator, the parser had 1790already read end of file, and the here-doc was not terminated, perl 1791could produce an assertion or a segmentation fault. This now reliably 1792complains about the unterminated here-doc. [perl #125540] 1793 1794=item * 1795 1796C<untie()> would sometimes return the last value returned by the C<UNTIE()> 1797handler as well as its normal value, messing up the stack. [perl 1798#126621] 1799 1800=item * 1801 1802Fixed an operator precedence problem when C< castflags & 2> is true. 1803[perl #127474] 1804 1805=item * 1806 1807Caching of DESTROY methods could result in a non-pointer or a 1808non-STASH stored in the C<SvSTASH()> slot of a stash, breaking the B 1809C<STASH()> method. The DESTROY method is now cached in the MRO metadata 1810for the stash. [perl #126410] 1811 1812=item * 1813 1814The AUTOLOAD method is now called when searching for a DESTROY method, 1815and correctly sets C<$AUTOLOAD> too. [perl #124387] [perl #127494] 1816 1817=item * 1818 1819Avoid parsing beyond the end of the buffer when processing a C<#line> 1820directive with no filename. [perl #127334] 1821 1822=item * 1823 1824Perl now raises a warning when a regular expression pattern looks like 1825it was supposed to contain a POSIX class, like C<qr/[[:alpha:]]/>, but 1826there was some slight defect in its specification which causes it to 1827instead be treated as a regular bracketed character class. An example 1828would be missing the second colon in the above like this: 1829C<qr/[[:alpha]]/>. This compiles to match a sequence of two characters. 1830The second is C<"]">, and the first is any of: C<"[">, C<":">, C<"a">, 1831C<"h">, C<"l">, or C<"p">. This is unlikely to be the intended 1832meaning, and now a warning is raised. No warning is raised unless the 1833specification is very close to one of the 14 legal POSIX classes. (See 1834L<perlrecharclass/POSIX Character Classes>.) 1835[perl #8904] 1836 1837=item * 1838 1839Certain regex patterns involving a complemented POSIX class in an 1840inverted bracketed character class, and matching something else 1841optionally would improperly fail to match. An example of one that could 1842fail is C<qr/_?[^\Wbar]\x{100}/>. This has been fixed. 1843[perl #127537] 1844 1845=item * 1846 1847Perl 5.22 added support to the C99 hexadecimal floating point notation, 1848but sometimes misparses hex floats. This has been fixed. 1849[perl #127183] 1850 1851=item * 1852 1853A regression that allowed undeclared barewords in hash keys to work despite 1854strictures has been fixed. 1855L<[GH #15099]|https://github.com/Perl/perl5/issues/15099> 1856 1857=item * 1858 1859Calls to the placeholder C<&PL_sv_yes> used internally when an C<import()> 1860or C<unimport()> method isn't found now correctly handle scalar context. 1861L<[GH #14902]|https://github.com/Perl/perl5/issues/14902> 1862 1863=item * 1864 1865Report more context when we see an array where we expect to see an 1866operator and avoid an assertion failure. 1867L<[GH #14472]|https://github.com/Perl/perl5/issues/14472> 1868 1869=item * 1870 1871Modifying an array that was previously a package C<@ISA> no longer 1872causes assertion failures or crashes. 1873L<[GH #14492]|https://github.com/Perl/perl5/issues/14492> 1874 1875=item * 1876 1877Retain binary compatibility across plain and DEBUGGING perl builds. 1878L<[GH #15122]|https://github.com/Perl/perl5/issues/15122> 1879 1880=item * 1881 1882Avoid leaking memory when setting C<$ENV{foo}> on darwin. 1883L<[GH #14955]|https://github.com/Perl/perl5/issues/14955> 1884 1885=item * 1886 1887C</...\G/> no longer crashes on utf8 strings. When C<\G> is a fixed number 1888of characters from the start of the regex, perl needs to count back that 1889many characters from the current C<pos()> position and start matching from 1890there. However, it was counting back bytes rather than characters, which 1891could lead to panics on utf8 strings. 1892 1893=item * 1894 1895In some cases operators that return integers would return negative 1896integers as large positive integers. 1897L<[GH #15049]|https://github.com/Perl/perl5/issues/15049> 1898 1899=item * 1900 1901The C<pipe()> operator would assert for DEBUGGING builds instead of 1902producing the correct error message. The condition asserted on is 1903detected and reported on correctly without the assertions, so the 1904assertions were removed. 1905L<[GH #15015]|https://github.com/Perl/perl5/issues/15015> 1906 1907=item * 1908 1909In some cases, failing to parse a here-doc would attempt to use freed 1910memory. This was caused by a pointer not being restored correctly. 1911L<[GH #15009]|https://github.com/Perl/perl5/issues/15009> 1912 1913=item * 1914 1915C<< @x = sort { *a = 0; $a <=> $b } 0 .. 1 >> no longer frees the GP 1916for *a before restoring its SV slot. 1917L<[GH #14595]|https://github.com/Perl/perl5/issues/14595> 1918 1919=item * 1920 1921Multiple problems with the new hexadecimal floating point printf 1922format C<%a> were fixed: 1923L<[GH #15032]|https://github.com/Perl/perl5/issues/15032>, 1924L<[GH #15033]|https://github.com/Perl/perl5/issues/15033>, 1925L<[GH #15074]|https://github.com/Perl/perl5/issues/15074> 1926 1927=item * 1928 1929Calling C<mg_set()> in C<leave_scope()> no longer leaks. 1930 1931=item * 1932 1933A regression from Perl v5.20 was fixed in which debugging output of regular 1934expression compilation was wrong. (The pattern was correctly compiled, but 1935what got displayed for it was wrong.) 1936 1937=item * 1938 1939C<\b{sb}> works much better. In Perl v5.22.0, this new construct didn't 1940seem to give the expected results, yet passed all the tests in the 1941extensive suite furnished by Unicode. It turns out that it was because 1942these were short input strings, and the failures had to do with longer 1943inputs. 1944 1945=item * 1946 1947Certain syntax errors in 1948L<perlrecharclass/Extended Bracketed Character Classes> caused panics 1949instead of the proper error message. This has now been fixed. [perl 1950#126481] 1951 1952=item * 1953 1954Perl 5.20 added a message when a quantifier in a regular 1955expression was useless, but then caused the parser to skip it; 1956this caused the surplus quantifier to be silently ignored, instead 1957of throwing an error. This is now fixed. [perl #126253] 1958 1959=item * 1960 1961The switch to building non-XS modules last in win32/makefile.mk (introduced 1962by design as part of the changes to enable parallel building) caused the 1963build of POSIX to break due to problems with the version module. This 1964is now fixed. 1965 1966=item * 1967 1968Improved parsing of hex float constants. 1969 1970=item * 1971 1972Fixed an issue with C<< pack >> where C<< pack "H" >> (and C<< pack "h" >>) 1973could read past the source when given a non-utf8 source, and a utf8 target. 1974[perl #126325] 1975 1976=item * 1977 1978Fixed several cases where perl would abort due to a segmentation fault, 1979or a C-level assert. [perl #126615], [perl #126602], [perl #126193]. 1980 1981=item * 1982 1983There were places in regular expression patterns where comments (C<(?#...)>) 1984weren't allowed, but should have been. This is now fixed. 1985L<[GH #12755]|https://github.com/Perl/perl5/issues/12755> 1986 1987=item * 1988 1989Some regressions from Perl 5.20 have been fixed, in which some syntax errors in 1990L<C<(?[...])>|perlrecharclass/Extended Bracketed Character Classes> constructs 1991within regular expression patterns could cause a segfault instead of a proper 1992error message. 1993L<[GH #14933]|https://github.com/Perl/perl5/issues/14933> 1994L<[GH #14996]|https://github.com/Perl/perl5/issues/14996> 1995 1996=item * 1997 1998Another problem with 1999L<C<(?[...])>|perlrecharclass/Extended Bracketed Character Classes> 2000constructs has been fixed wherein things like C<\c]> could cause panics. 2001L<[GH #14934]|https://github.com/Perl/perl5/issues/14934> 2002 2003=item * 2004 2005Some problems with attempting to extend the perl stack to around 2G or 4G 2006entries have been fixed. This was particularly an issue on 32-bit perls built 2007to use 64-bit integers, and was easily noticeable with the list repetition 2008operator, e.g. 2009 2010 @a = (1) x $big_number 2011 2012Formerly perl may have crashed, depending on the exact value of C<$big_number>; 2013now it will typically raise an exception. 2014L<[GH #14880]|https://github.com/Perl/perl5/issues/14880> 2015 2016=item * 2017 2018In a regex conditional expression C<(?(condition)yes-pattern|no-pattern)>, if 2019the condition is C<(?!)> then perl failed the match outright instead of 2020matching the no-pattern. This has been fixed. 2021L<[GH #14947]|https://github.com/Perl/perl5/issues/14947> 2022 2023=item * 2024 2025The special backtracking control verbs C<(*VERB:ARG)> now all allow an optional 2026argument and set C<REGERROR>/C<REGMARK> appropriately as well. 2027L<[GH #14937]|https://github.com/Perl/perl5/issues/14937> 2028 2029=item * 2030 2031Several bugs, including a segmentation fault, have been fixed with the boundary 2032checking constructs (introduced in Perl 5.22) C<\b{gcb}>, C<\b{sb}>, C<\b{wb}>, 2033C<\B{gcb}>, C<\B{sb}>, and C<\B{wb}>. All the C<\B{}> ones now match an empty 2034string; none of the C<\b{}> ones do. 2035L<[GH #14976]|https://github.com/Perl/perl5/issues/14976> 2036 2037=item * 2038 2039Duplicating a closed file handle for write no longer creates a 2040filename of the form F<GLOB(0xXXXXXXXX)>. [perl #125115] 2041 2042=item * 2043 2044Warning fatality is now ignored when rewinding the stack. This 2045prevents infinite recursion when the now fatal error also causes 2046rewinding of the stack. [perl #123398] 2047 2048=item * 2049 2050In perl v5.22.0, the logic changed when parsing a numeric parameter to the -C 2051option, such that the successfully parsed number was not saved as the option 2052value if it parsed to the end of the argument. [perl #125381] 2053 2054=item * 2055 2056The PadlistNAMES macro is an lvalue again. 2057 2058=item * 2059 2060Zero -DPERL_TRACE_OPS memory for sub-threads. 2061 2062C<perl_clone_using()> was missing Zero init of PL_op_exec_cnt[]. This 2063caused sub-threads in threaded -DPERL_TRACE_OPS builds to spew exceedingly 2064large op-counts at destruct. These counts would print %x as "ABABABAB", 2065clearly a mem-poison value. 2066 2067=item * 2068 2069A leak in the XS typemap caused one scalar to be leaked each time a C<FILE *> 2070or a C<PerlIO *> was C<OUTPUT:>ed or imported to Perl, since perl 5.000. These 2071particular typemap entries are thought to be extremely rarely used by XS 2072modules. [perl #124181] 2073 2074=item * 2075 2076C<alarm()> and C<sleep()> will now warn if the argument is a negative number 2077and return undef. Previously they would pass the negative value to the 2078underlying C function which may have set up a timer with a surprising value. 2079 2080=item * 2081 2082Perl can again be compiled with any Unicode version. This used to 2083(mostly) work, but was lost in v5.18 through v5.20. The property 2084C<Name_Alias> did not exist prior to Unicode 5.0. L<Unicode::UCD> 2085incorrectly said it did. This has been fixed. 2086 2087=item * 2088 2089Very large code-points (beyond Unicode) in regular expressions no 2090longer cause a buffer overflow in some cases when converted to UTF-8. 2091L<[GH #14858]|https://github.com/Perl/perl5/issues/14858> 2092 2093=item * 2094 2095The integer overflow check for the range operator (...) in list 2096context now correctly handles the case where the size of the range is 2097larger than the address space. This could happen on 32-bits with 2098-Duse64bitint. 2099L<[GH #14843]|https://github.com/Perl/perl5/issues/14843> 2100 2101=item * 2102 2103A crash with C<< %::=(); J->${\"::"} >> has been fixed. 2104L<[GH #14790]|https://github.com/Perl/perl5/issues/14790> 2105 2106=item * 2107 2108C<qr/(?[ () ])/> no longer segfaults, giving a syntax error message instead. 2109[perl #125805] 2110 2111=item * 2112 2113Regular expression possessive quantifier v5.20 regression now fixed. 2114C<qr/>I<PAT>C<{>I<min>,I<max>C<}+>C</> is supposed to behave identically 2115to C<qr/(?E<gt>>I<PAT>C<{>I<min>,I<max>C<})/>. Since v5.20, this didn't 2116work if I<min> and I<max> were equal. [perl #125825] 2117 2118=item * 2119 2120C<< BEGIN <> >> no longer segfaults and properly produces an error 2121message. [perl #125341] 2122 2123=item * 2124 2125In C<tr///> an illegal backwards range like C<tr/\x{101}-\x{100}//> was 2126not always detected, giving incorrect results. This is now fixed. 2127 2128=back 2129 2130=head1 Acknowledgements 2131 2132Perl 5.24.0 represents approximately 11 months of development since Perl 5.24.0 2133and contains approximately 360,000 lines of changes across 1,800 files from 75 2134authors. 2135 2136Excluding auto-generated files, documentation and release tools, there were 2137approximately 250,000 lines of changes to 1,200 .pm, .t, .c and .h files. 2138 2139Perl continues to flourish into its third decade thanks to a vibrant community 2140of users and developers. The following people are known to have contributed the 2141improvements that became Perl 5.24.0: 2142 2143Aaron Crane, Aaron Priven, Abigail, Achim Gratz, Alexander D'Archangel, Alex 2144Vandiver, Andreas König, Andy Broad, Andy Dougherty, Aristotle Pagaltzis, 2145Chase Whitener, Chas. Owens, Chris 'BinGOs' Williams, Craig A. Berry, Dagfinn 2146Ilmari Mannsåker, Dan Collins, Daniel Dragan, David Golden, David Mitchell, 2147Doug Bell, Dr.Ruud, Ed Avis, Ed J, Father Chrysostomos, Herbert Breunung, 2148H.Merijn Brand, Hugo van der Sanden, Ivan Pozdeev, James E Keenan, Jan Dubois, 2149Jarkko Hietaniemi, Jerry D. Hedden, Jim Cromie, John Peacock, John SJ Anderson, 2150Karen Etheridge, Karl Williamson, kmx, Leon Timmermans, Ludovic E. R. 2151Tolhurst-Cleaver, Lukas Mai, Martijn Lievaart, Matthew Horsfall, Mattia Barbon, 2152Max Maischein, Mohammed El-Afifi, Nicholas Clark, Nicolas R., Niko Tyni, Peter 2153John Acklam, Peter Martini, Peter Rabbitson, Pip Cet, Rafael Garcia-Suarez, 2154Reini Urban, Ricardo Signes, Sawyer X, Shlomi Fish, Sisyphus, Stanislaw Pusep, 2155Steffen Müller, Stevan Little, Steve Hay, Sullivan Beck, Thomas Sibley, Todd 2156Rinaldo, Tom Hukins, Tony Cook, Unicode Consortium, Victor Adam, Vincent Pit, 2157Vladimir Timofeev, Yves Orton, Zachary Storer, Zefram. 2158 2159The list above is almost certainly incomplete as it is automatically generated 2160from version control history. In particular, it does not include the names of 2161the (very much appreciated) contributors who reported issues to the Perl bug 2162tracker. 2163 2164Many of the changes included in this version originated in the CPAN modules 2165included in Perl's core. We're grateful to the entire CPAN community for 2166helping Perl to flourish. 2167 2168For a more complete list of all of Perl's historical contributors, please see 2169the F<AUTHORS> file in the Perl source distribution. 2170 2171=head1 Reporting Bugs 2172 2173If you find what you think is a bug, you might check the articles recently 2174posted to the comp.lang.perl.misc newsgroup and the perl bug database at 2175https://rt.perl.org/ . There may also be information at 2176http://www.perl.org/ , the Perl Home Page. 2177 2178If you believe you have an unreported bug, please run the L<perlbug> program 2179included with your release. Be sure to trim your bug down to a tiny but 2180sufficient test case. Your bug report, along with the output of C<perl -V>, 2181will be sent off to perlbug@perl.org to be analysed by the Perl porting team. 2182 2183If the bug you are reporting has security implications which make it 2184inappropriate to send to a publicly archived mailing list, then see 2185L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION> 2186for details of how to report the issue. 2187 2188=head1 SEE ALSO 2189 2190The F<Changes> file for an explanation of how to view exhaustive details on 2191what changed. 2192 2193The F<INSTALL> file for how to build Perl. 2194 2195The F<README> file for general stuff. 2196 2197The F<Artistic> and F<Copying> files for copyright information. 2198 2199=cut 2200