=encoding utf8 =head1 NAME perldelta - what is new for perl v5.27.6 =head1 DESCRIPTION This document describes differences between the 5.27.5 release and the 5.27.6 release. If you are upgrading from an earlier release such as 5.27.4, first read L, which describes differences between 5.27.4 and 5.27.5. =head1 Core Enhancements =head2 Initialisation of aggregate state variables A persistent lexical array or hash variable can now be initialized, by an expression such as C. Initialization of a list of persistent lexical variables is still not possible. =head2 Full-size inode numbers On platforms where inode numbers are of a type larger than perl's native integer numerical types, L will preserve the full content of large inode numbers by returning them in the form of strings of decimal digits. Exact comparison of inode numbers can thus be achieved by comparing with C rather than C<==>. Comparison with C<==>, and other numerical operations (which are usually meaningless on inode numbers), work as well as they did before, which is to say they fall back to floating point, and ultimately operate on a fairly useless rounded inode number if the real inode number is too big for the floating point format. =head1 Incompatible Changes =head2 Yada-yada is now strictly a statement By the time of its initial stable release in Perl 5.12, the C<...> (yada-yada) operator was explicitly intended to serve as a statement, not an expression. However, the original implementation was confused on this point, leading to inconsistent parsing. The operator was accidentally accepted in a few situations where it did not serve as a complete statement, such as ... . "foo"; ... if $a < $b; The parsing has now been made consistent, permitting yada-yada only as a statement. Affected code can use C to put a yada-yada into an arbitrary expression context. =head2 Subroutines no longer need typeglobs Perl 5.22.0 introduced an optimization allowing subroutines to be stored in packages as simple sub refs, not requiring a full typeglob (thus potentially saving large amounts of memeory). However, the optimization was flawed: it only applied to the main package. This optimization has now been extended to all packages. This may break compatibility with introspection code that looks inside stashes and expects everything in them to be a typeglob. When this optimization happens, the typeglob still notionally exists, so accessing it will cause the stash entry to be upgraded to a typeglob. The optimization does not apply to XSUBs or exported subroutines, and calling a method will undo it, since method calls cache things in typeglobs. (This change actually happened in perl 5.27.5 but was omitted from its perldelta.) [perl #129916] [perl #132252] =head2 Sort algorithm can no longer be specified Since Perl 5.8, the L pragma has had subpragmata C<_mergesort>, C<_quicksort>, and C<_qsort> that can be used to specify which algorithm perl should use to implement the L builtin. This was always considered a dubious feature that might not last, hence the underscore spellings, and they were documented as not being portable beyond Perl 5.8. These subpragmata have now been deleted, and any attempt to use them is an error. The L pragma otherwise remains, and the algorithm-neutral C subpragma can be used to control sorting behaviour. [perl #119635] =head1 Performance Enhancements =over 4 =item * Many string concatenation expressions are now considerably faster, due to the introduction internally of a C opcode which combines multiple concatenations, and optionally a C<=> or C<.=>, into a single action. For example, apart from retrieving C<$s>, C<$a> and C<$b>, this whole expression is now handled as a single op: $s .= "a=$a b=$b\n" As a special case, if the LHS of an assignment is a lexical variable or C, the op itself handles retrieving the lexical variable, which is faster. In general, the more the expression includes a mix of constant strings and variable expressions, the longer the expression, and the more it mixes together non-utf8 and utf8 strings, the more marked the performance improvement. For example on a C system, this code has been benchmarked running four times faster: my $s; my $a = "ab\x{100}cde"; my $b = "fghij"; my $c = "\x{101}klmn"; for my $i (1..10_000_000) { $s = "\x{100}wxyz"; $s .= "foo=$a bar=$b baz=$c"; } In addition, C expressions which have a constant format containing only C<%s> and C<%%> format elements, and which have a fixed number of arguments, are now also optimised into a C op. =item * Subroutines in packages no longer need to be stored in typeglobs, saving large amounts of memory. See L under L, above. =back =head1 Modules and Pragmata Key highlights in this release across several modules: =head2 Removal of use vars The usage of C has been discouraged since the introduction of C in Perl 5.6.0. Where possible the usage of this pragma has now been removed from the Perl source code. This had a slight effect (for the better) on the output of WARNING_BITS in B::Deparse. =head2 Use of DynaLoader changed to XSLoader in many modules XSLoader is more modern, and most modules already require perl 5.6 or greater, so no functionality is lost by switching. In some cases, we have also made changes to the local implementation that may not be reflected in the version on CPAN due to a desire to maintain more backwards compatibility. =head2 Updated Modules and Pragmata =over 4 =item * L has been upgraded from version 1.00 to 1.01. =item * L has been upgraded from version 0.31 to 0.32. =item * L has been upgraded from version 1.70 to 1.72. =item * L has been upgraded from version 1.002 to 1.003. =item * L has been upgraded from version 1.43 to 1.45. =item * L has been upgraded from version 2.26 to 2.27. =item * L has been upgraded from version 1.06 to 1.07. =item * L has been upgraded from version 1.43 to 1.44. If a package on the call stack contains a constant named C, Carp no longer throws a "Not a GLOB reference" error. =item * L has been upgraded from version 2.074 to 2.075. This addresses a security vulnerability in older versions of the 'zlib' library (which is bundled with Compress-Raw-Zlib). =item * L has been upgraded from version 0.01 to 0.02. =item * L has moved from cpan-first to perl-first maintenance Primary responsibility for the code in Devel::PPPort has moved into core perl. In a practical sense there should be no change except that hopefully it will stay more up to date with changes made to symbols in perl, rather than needing to be updated after the fact. =item * L has been upgraded from version 1.42 to 1.44. =item * L has been upgraded from version 0.016 to 0.017. =item * L has been upgraded from version 0.280228 to 0.280229. =item * L has been upgraded from version 1.34 to 1.35. =item * L has been upgraded from version 1.06 to 1.07. =item * L has been upgraded from version 3.35 to 3.36. =item * L has been upgraded from version 3.35 to 3.36. =item * L has been upgraded from version 1.3 to 1.4. =item * L has been upgraded from version 2.23 to 2.24. =item * L has been upgraded from version 2.32 to 2.33. It will now use Time::HiRes utime where available (perl #132401). =item * L has been upgraded from version 3.68 to 3.70. =item * L has been upgraded from version 1.07 to 1.08. =item * L has been upgraded from version 1.09 to 1.10. =item * L has been upgraded from version 0.94 to 0.95. =item * L has been upgraded from version 1.19 to 1.20. =item * L has been upgraded from version 0.14 to 0.15. =item * L has been upgraded from version 0.42 to 0.43. =item * The libnet distribution has been upgraded from version 3.10 to 3.11. =item * L has been upgraded from version 1.28 to 1.29. =item * L has been upgraded from version 5.20171020 to 5.20171120. =item * L has been upgraded from version 2.55 to 2.62. =item * L has been upgraded from version 1.14 to 1.15. =item * L has been upgraded from version 1.40 to 1.41. =item * L has been upgraded from version 1.2202 to 1.2203. =item * L has been upgraded from version 1.78 to 1.80. =item * L has been upgraded from version 0.35 to 0.36. =item * L has been upgraded from version 1.24 to 1.25. =item * L has been upgraded from version 2.020_03 to 2.020_04. =item * L has been upgraded from version 2.03 to 2.04. =item * L has been upgraded from version 2.64 to 2.65. =item * L has been upgraded from version 1.30 to 1.31. =item * L has been upgraded from version 1.302103 to 1.302111. =item * L has been upgraded from version 2.18 to 2.19. =item * L has been upgraded from version 1.06 to 1.07. =item * L has been upgraded from version 4.4 to 4.5. =item * L has been upgraded from version 1.03 to 1.04. =item * L has been upgraded from version 1.9746 to 1.9747. =item * L has been upgraded from version 1.02 to 1.03. =item * L has been upgraded from version 1.19 to 1.23. =item * L has been upgraded from version 1.25 to 1.26. =item * L has been upgraded from version 1.01 to 1.02. =item * L has been upgraded from version 1.00 to 1.01. =item * L has been upgraded from version 1.08 to 1.09. =item * L has been upgraded from version 2.42 to 2.44. =item * L has been upgraded from version 1.37 to 1.38. =item * L has been upgraded from version 0.15 to 0.16. =item * L has been upgraded from version 0.27 to 0.28. =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, send email to L. Additionally, the following selected changes have been made: =over 4 =item * L This now gives more ideas as to workarounds to the issue that was introduced in Perl 5.18 (but not documented explicitly in its perldelta) for the fact that some Unicode C rules cause a few sequences such as (? This entry has been removed, as the experimental support of this construct was removed in perl 5.24.0. =item * The section on reference counting in L has been heavily revised, to describe references in the way a programmer needs to think about them rather than in terms of the physical data structures. =item * The section "Truth and Falsehood" in L has been removed from that document, where it didn't belong, and merged into the existing paragraph on the same topic in L. =item * The description of the C operator in L has been clarified. [perl #132460] =item * L has been updated to note that C<\p{Word}> now includes code points matching the C<\p{Join_Control}> property. The change to the property was made in Perl 5.18, but not documented until now. There are currently only two code points that match this property U+200C (ZERO WIDTH NON-JOINER) and U+200D (ZERO WIDTH JOINER). =item * The entry for C<$+> in perlvar has been expanded upon to describe handling of multiply-named capturing groups. =item * L has been updated to note that C's whitespace rules differ from that of C's in that only ASCII whitespace is used. =item * L has been updated with some more cautions about using locale-specific functions in threaded applications. =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. =head2 Changes to Existing Diagnostics =over 4 =item * The diagnostic C has changed to C, because list-context initialization of single aggregate state variables is now permitted. =back =head1 Utility Changes =head2 L =over 4 =item * C<--help> and C<--version> options have been added. =back =head1 Configuration and Compilation =over 4 =item C89 requirement Perl has been documented as requiring a C89 compiler to build since October 1998. A variety of simplifications have now been made to Perl's internals to rely on the features specified by the C89 standard. We believe that this internal change hasn't altered the set of platforms that Perl builds on, but please report a bug if Perl now has new problems building on your platform. =item New probes =over 2 =item HAS_BUILTIN_ADD_OVERFLOW =item HAS_BUILTIN_MUL_OVERFLOW =item HAS_BUILTIN_SUB_OVERFLOW =item HAS_THREAD_SAFE_NL_LANGINFO_L =item HAS_LOCALECONV_L =item HAS_MBRLEN =item HAS_MBRTOWC =item HAS_MEMRCHR =item HAS_NANOSLEEP =item HAS_STRNLEN =item HAS_STRTOLD_L =item I_WCHAR =back =back =head1 Packaging For the past few years we have released perl using three different archive formats: bzip (C<.bz2>), LZMA2 (C<.xz>) and gzip (C<.gz>). Since xz compresses better and decompresses faster, and gzip is more compatible and uses less memory, we have dropped the C<.bz2> archive format with this release. (If this poses a problem, do let us know; see L, below.) =head1 Platform Support =head2 Discontinued Platforms =over 4 =item PowerUX / Power MAX OS Compiler hints and other support for these apparently long-defunct platforms has been removed. =back =head2 Platform-Specific Notes =over 4 =item Windows Visual C++ compiler version detection has been improved to work on non-English language systems. =back =head1 Internal Changes =over 4 =item * A new optimisation phase has been added to the compiler, C, which does a top-down scan of a complete optree just before the peephole optimiser is run. This phase is not currently hookable. =item * An C op has been added. At C time, a chain of C and C ops, together optionally with an C and/or C, are combined into a single C op. The op is of type C, and the aux array contains the argument count, plus a pointer to a constant string and a set of segment lengths. For example with my $x = "foo=$foo, bar=$bar\n"; the constant string would be C<"foo=, bar=\n"> and the segment lengths would be (4,6,1). If the string contains characters such as C<\x80>, whose representation changes under utf8, two sets of strings plus lengths are precomputed and stored. =item * Direct access to L|perlapi/PL_keyword_plugin> is not safe in the presence of multithreading. A new L|perlapi/wrap_keyword_plugin> function has been added to allow XS modules to safely define custom keywords even when loaded from a thread, analogous to L|perlapi/PL_check> / L|perlapi/wrap_op_checker>. =back =head1 Selected Bug Fixes =over 4 =item * C, C, and file test operators now fail if given a filename containing a nul character, in the same way that C already fails. =item * C, C, and file test operators now reliably set C<$!> when failing due to being applied to a closed or otherwise invalid file handle. =item * File test operators for Unix permission bits that don't exist on a particular platform, such as C<-k> (sticky bit) on Windows, now check that the file being tested exists before returning the blanket false result, and yield the appropriate errors if the argument doesn't refer to a file. =item * The in-place reverse optimisation now correctly strengthens weak references using the L|perlapi/sv_rvunweaken> API function. =item * Fixed a read before buffer when parsing a range starting with C<\N{}> at the beginning of the character set for the transliteration operator. [perl #132245] =item * Fixed a leaked SV when parsing an empty C<\N{}> at compile-time. [perl #132245] =item * Calling C on a directory or block device now yields a meaningful error code in C<$!>. [perl #125774] =item * Regexp substitution using an overloaded replacement value that provides a tainted stringification now correctly taints the resulting string. [perl #115266] =item * Lexical sub declarations in C blocks such as C could corrupt the stack, erasing items already on the stack in the enclosing statement. This has been fixed. [perl #132442] =back =head1 Errata From Previous Releases =over 4 =item * L under L, above, was made for perl 5.27.5 but was mistakenly omitted from its perldelta. =back =head1 Acknowledgements Perl 5.27.6 represents approximately 4 weeks of development since Perl 5.27.5 and contains approximately 110,000 lines of changes across 1,100 files from 30 authors. Excluding auto-generated files, documentation and release tools, there were approximately 20,000 lines of changes to 430 .pm, .t, .c and .h files. Perl continues to flourish into its third decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.27.6: Aaron Crane, Andrew Fresh, Ask Bjöern Hansen, Chris 'BinGOs' Williams, Craig A. Berry, Dagfinn Ilmari Mannsåker, Daniel Dragan, David Cantrell, David Mitchell, Dominic Hargreaves, Father Chrysostomos, Harald Jörg, H.Merijn Brand, James E Keenan, Jarkko Hietaniemi, J. Nick Koston, John Lightsey, Karen Etheridge, Karl Williamson, Lukas Mai, Matthew Horsfall, Nicolas R., Paul Marquess, Sawyer X, Slaven Rezic, Steve Hay, Todd Rinaldo, Tony Cook, Yves Orton, Zefram. 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 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 . There may also be information at L , the Perl Home Page. If you believe you have an unreported bug, please run the L program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of C, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. If the bug you are reporting has security implications which make it inappropriate to send to a publicly archived mailing list, then see L 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 program: perlthanks This will send an email to the Perl 5 Porters list with your show of thanks. =head1 SEE ALSO The F file for an explanation of how to view exhaustive details on what changed. The F file for how to build Perl. The F file for general stuff. The F and F files for copyright information. =cut