X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/4f81ab9cc2ddd87f42517e1a5dd991d1990cc795..3ec9b05a393d3ad51dfb8f9d77ad1ee81bd63c4e:/pod/perldelta.pod diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 0ab91dc..41d759c 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -2,264 +2,245 @@ =head1 NAME -[ this is a template for a new perldelta file. Any text flagged as XXX needs -to be processed before release. ] - -perldelta - what is new for perl v5.21.4 +perldelta - what is new for perl v5.21.5 =head1 DESCRIPTION -This document describes differences between the 5.21.3 release and the 5.21.4 +This document describes differences between the 5.21.4 release and the 5.21.5 release. -If you are upgrading from an earlier release such as 5.21.2, first read -L, which describes differences between 5.21.2 and 5.21.3. - -=head1 Notice - -XXX Any important notices here +If you are upgrading from an earlier release such as 5.21.3, first read +L, which describes differences between 5.21.3 and 5.21.4. =head1 Core Enhancements -XXX New core language features go here. Summarize user-visible core language -enhancements. Particularly prominent performance optimisations could go -here, but most should go in the L section. - -[ List each enhancement as a =head2 entry ] - -=head2 Infinity and NaN (not-a-number) handling improved - -Floating point values are able to hold the special values infinity -(also -infinity), and NaN (not-a-number). Now we more robustly recognize -and propagate the value in computations, and on output normalize them -to C and C. - -See also the L enhancements. - -=head1 Security - -XXX Any security-related notices go here. In particular, any security -vulnerabilities closed should be noted here rather than in the -L section. +=head2 New double-diamond operator -[ List each security issue as a =head2 entry ] +C<<< <<>> >>> is like C<< <> >> but uses three-argument C to open +each file in @ARGV. So each element of @ARGV is an actual file name, and +"|foo" won't be treated as a pipe open. -=head1 Incompatible Changes +=head2 Aliasing via reference -XXX For a release on a stable branch, this section aspires to be: +Variables and subroutines can now be aliased by assigning to a reference: - There are no changes intentionally incompatible with 5.XXX.XXX - If any exist, they are bugs, and we request that you submit a - report. See L below. + \$c = \$d; + \&x = \&y; -[ List each incompatible change as a =head2 entry ] +Or by using a backslash before a C iterator variable, which is +perhaps the most useful idiom this feature provides: -=head2 Changes to the C<*> prototype + foreach \%hash (@array_of_hash_refs) { ... } -The C<*> character in a subroutine's prototype used to allow barewords -to take precedence over most, but not all subroutines. It was never -consistent and exhibited buggy behaviour. +This feature is experimental and must be enabled via C. It will warn unless the C +warnings category is disabled. -Now it has been changed, so subroutines always take precedence over -barewords, which brings it into conformity with similarly prototyped -built-in functions: +See L. - sub splat($) { ... } - sub foo { ... } - splat(foo); # now always splat(foo()) - splat(bar); # still splat('bar') as before - close(foo); # close(foo()) - close(bar); # close('bar') +=head2 Perl now supports POSIX 2008 locale currency additions. -=head1 Deprecations +On platforms that are able to handle POSIX.1-2008, the +hash returned by +L|perllocale/The localeconv function> +includes the international currency fields added by that version of the +POSIX standard. These are +C, +C, +C, +C, +C, +and +C. -XXX Any deprecated features, syntax, modules etc. should be listed here. +=head2 Packing infinity or not-a-number into a character is now fatal. -=head2 Module removals +Before, when trying to pack infinity or not-a-number into a +(signed) character, Perl would warn, and assumed you tried to +pack C<< 0xFF >>; if you gave it as an argument to C<< chr >>, +C<< U+FFFD >> was returned. -XXX Remove this section if inapplicable. +But now, all such actions (C<< pack >>, C<< chr >>, and C<< print '%c' >>) +result in a fatal error. -The following modules will be removed from the core distribution in a -future release, and will at that time need to be installed from CPAN. -Distributions on CPAN which require these modules will need to list them as -prerequisites. +=head1 Security -The core versions of these modules will now issue C<"deprecated">-category -warnings to alert you to this fact. To silence these deprecation warnings, -install the modules in question from CPAN. +=head2 Perl is now compiled with -fstack-protector-strong if available -Note that these are (with rare exceptions) fine modules that you are encouraged -to continue to use. Their disinclusion from core primarily hinges on their -necessity to bootstrapping a fully functional, CPAN-capable Perl installation, -not usually on concerns over their design. +Perl has been compiled with the anti-stack-smashing option +C<-fstack-protector> since 5.10.1. Now Perl uses the newer variant +called C<-fstack-protector-strong>, if available. (This was added +already in 5.21.4.) -=over +=head1 Deprecations -=item XXX +=head2 Use of multiple /x regexp modifiers -XXX Note that deprecated modules should be listed here even if they are listed -as an updated module in the L section. +It is now deprecated to say something like any of the following: -=back + qr/foo/xx; + /(?xax:foo)/; + use re qw(/amxx); -[ List each other deprecation as a =head2 entry ] +That is, now C should only occur once in any string of contiguous +regular expression pattern modifiers. We do not believe there are any +occurrences of this in all of CPAN. This is in preparation for a future +Perl release having C mean to allow white-space for readability in +bracketed character classes (those enclosed in square brackets: +C<[...]>). =head1 Performance Enhancements -XXX Changes which enhance performance without changing behaviour go here. -There may well be none in a stable release. +=over 4 -[ List each enhancement as a =item entry ] +=item * -=over 4 +C is up to 20% faster for non-magical/non-tied scalars containing a +string if it is a non-utf8 string or if C is in scope. =item * -Subroutines with an empty prototype and bodies containing just C are -now eligible for inlining. [perl #122728] +Non-magical/non-tied scalars that contain only a floating point value and are +on most Perl builds with 64 bit integers now use 8-32 less bytes of memory +depending on OS. -=back +=item * -=head1 Modules and Pragmata +In C<@array = split>, the assigment can be optimised away with C +writing directly to the array. This optimisation was happening only for +package arrays other than @_ and only +sometimes. Now this optimisation happens +almost all the time. -XXX All changes to installed files in F, F, F and F -go here. If Module::CoreList is updated, generate an initial draft of the -following sections using F. A paragraph summary -for important changes should then be added by hand. In an ideal world, -dual-life modules would have a F file that could be cribbed. +=item * -[ Within each section, list entries as a =item entry ] +C is now subject to constant folding. Moreover, C with a +scalar or constant for the separator and a single-item list to join is +simplified to a stringification. The separator doesn't even get evaluated. -=head2 New Modules and Pragmata +=item * -=over 4 +C is implemented using two ops: a stringify op and a join op. +If the qq contains nothing but a single array, the stringification is +optimised away. =item * -XXX +C and C in void context are no longer evaluated at +run time. Even a whole sequence of C statements will simply be +skipped over. The same applies to C variables. =back +=head1 Modules and Pragmata + =head2 Updated Modules and Pragmata =over 4 =item * -L has been upgraded from version A.xx to B.yy. - -=item * +L has been upgraded from version 0.23 to 0.24. -L has been upgraded from version 0.992 to 0.993. +Avoid reading beyond the end of a buffer. [perl #122629] =item * -L has been upgraded from version 2.126 to 2.128. +L has been upgraded from version 0.993 to 0.994. -=item * +Null ops that are part of the execution chain are now given sequence +numbers. -L has been upgraded from version 0.280216 to 0.280219. -[perl #122675]. +Private flags for nulled ops are now dumped with mnemonics as they would be +for the non-nulled counterparts. -=item * +L has been upgraded from version 1.28 to 1.29. -L has been upgraded from version 1.65 to 1.66. -[perl #122415]. +Parenthesised arrays in lists passed to C<\> are now correctly deparsed +with parentheses (e.g., C<\(@a, (@b), @c)> now retains the parentheses +around @b), this preserving the flattening behaviour of referenced +parenthesised arrays. Formerly, it only worked for one array: C<\(@a)>. -=item * +C is now deparsed correctly, with the C included. -L: Documentation has been added to -F concerning handling of locales when writing -XS code. +C was deparsed without the C (or C). +This has been fixed. -=item * +Core keywords that conflict with lexical subroutines are now deparsed with +the C prefix. -L has been upgraded from version 1.27 to 1.28. +C now deparses correctly with C and +not C. -C and C will now warn if passed inappropriate or -misspelled options. +C now deparses correctly with C in those +cases where the assignment is optimised away. =item * -L has been upgraded from version 1.10 to 1.11. - -=item * +L has been upgraded from version 1.26 to 1.27. -L has been upgraded from version 0.047 to 0.048. +Remove dl_nonlazy global if unused in Dynaloader. [perl #122926] =item * -L has been upgraded from version 5.021003 to 5.021004. +L has been upgraded from version 1.12 to 1.13. + +Add support for the Linux pipe buffer size fcntl() commands. =item * -L has been upgraded from version 1.42 to 1.43. +L has been upgraded from version 1.28 to 1.29. -The C99 math functions and constants (for example acosh, round, -M_E, M_PI) have been added. +Slightly faster module loading time. =item * -L has been upgraded from version 3.23 to 3.24. - -=item * +L has been upgraded from version 5.20140920 to 5.20141020. -Scalar-List-Utils has been upgraded from version 1.40 to 1.41. +Updated to cover the latest releases of Perl. =item * -L has been upgraded from version 1.31 to 1.32. +The PathTools module collection has been upgraded from version 3.50 to 3.51. -It now accepts fully-qualified constant names, allowing constants to be -defined in packages other than the caller. +Slightly faster module loading time. =item * -L has been upgraded from version 1.95 to 1.96. +L has been upgraded from version 1.44 to 1.45. -=back +POSIX::tmpnam() now produces a deprecation warning. [perl #122005] + +=item * -=head2 Removed Modules and Pragmata +L has been upgraded from version 0.17 to 0.18. -=over 4 +Allow XSLoader to load modules from a different namespace. +[perl #122455] =item * -XXX +L has been upgraded from version 5.0150045 to version 5.0150046. +[perl #123008] =back =head1 Documentation -XXX Changes to files in F go here. Consider grouping entries by -file and be sure to link to the appropriate page, e.g. L. - -=head2 New Documentation - -XXX Changes which create B files in F go here. - -=head3 L - -XXX Description of the purpose of the new file here - =head2 Changes to Existing Documentation -XXX Changes which significantly change existing files in F go here. -However, any changes to F should go in the L -section. - -=head3 L +=head3 L =over 4 =item * -XXX Description of the change here - -=item * - -L: An ambiguity in the documentation of the Ellipsis statement has -been corrected. [perl #122661] +Clarifications have been added to L +to the effect that Perl guarantees that C<[A-Z]>, C<[a-z]>, C<[0-9]> and +any subranges thereof in regular expression bracketed character classes +are guaranteed to match exactly what a naive English speaker would +expect them to match, even on platforms (such as EBCDIC) where special +handling is required to accomplish this. =back @@ -269,346 +250,249 @@ 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. -XXX New or changed warnings emitted by the core's C code go here. Also -include any changes in L that reconcile it to the C code. - =head2 New Diagnostics -XXX Newly added diagnostic messages go under here, separated into New Errors -and New Warnings - =head3 New Errors =over 4 =item * -XXX L - -=back - -=head3 New Warnings - -=over 4 - -=item * - -XXX L - -=back - -=head2 Changes to Existing Diagnostics - -XXX Changes (i.e. rewording) of diagnostic messages go here - -=over 4 +L =item * -XXX Describe change here - -=back - -=head2 Diagnostic Removals - -=over 4 +L =item * -"Constant is not a FOO reference" - -Compile-time checking of constant dereferencing (e.g., -C<< my_constant->() >>) has been removed, since it was not taking -overloading into account. [perl #69456] [perl #122607] +L =item * -The warning "Ambiguous use of -foo resolved as -&foo()" has been removed. -There is actually no ambiguity here, and this impedes the use of negated -constants; e.g., C<-Inf>. +L =item * -The little-known C syntax (see L and L) -could get confused in the scope of C if C were a constant -whose value contained Latin-1 characters. +L =back -=head1 Utility Changes - -XXX Changes to installed programs such as F and F go here. -Most of these are built within the directory F. - -[ List utility changes as a =head2 entry for each utility and =item -entries for each change -Use L with program names to get proper documentation linking. ] - -=head2 L +=head2 Changes to Existing Diagnostics =over 4 =item * -XXX +'"my" variable &foo::bar can't be in a package' has been reworded to say +'subroutine' instead of 'variable'. =back -=head1 Configuration and Compilation - -XXX Changes to F, F, F, and analogous tools -go here. Any other changes to the Perl build process should be listed here. -However, any platform-specific changes should be listed in the -L section, instead. - -[ List changes as a =item entry ]. +=head1 Testing =over 4 =item * -XXX +Some regular expression tests are written in such a way that they will +run very slowly if certain optimizations break. These tests have been +moved into new files, F<< t/re/speed.t >> and F<< t/re/speed_thr.t >>, +and are run with a C<< watchdog() >>. =back -=head1 Testing - -XXX Any significant changes to the testing of a freshly built perl should be -listed here. Changes which create B files in F go here as do any -large changes to the testing harness (e.g. when parallel testing was added). -Changes to existing files in F aren't worth summarizing, although the bugs -that they represent may be covered elsewhere. +=head1 Platform Support -[ List each test improvement as a =item entry ] +=head2 Platform-Specific Notes =over 4 -=item * +=item EBCDIC -XXX +Special handling is required on EBCDIC platforms to get C to +match only C<"i"> and C<"j">, since there are 7 characters between the +code points for C<"i"> and C<"j">. This special handling had only been +invoked when both ends of the range are literals. Now it is also +invoked if any of the C<\N{...}> forms for specifying a character by +name or Unicode code point is used instead of a literal. See +L. =back -=head1 Platform Support - -XXX Any changes to platform support should be listed in the sections below. - -[ Within the sections, list each platform as a =item entry with specific -changes as paragraphs below it. ] - -=head2 New Platforms - -XXX List any platforms that this version of perl compiles on, that previous -versions did not. These will either be enabled by new files in the F -directories, or new subdirectories and F files at the top level of the -source tree. +=head1 Internal Changes =over 4 -=item XXX-some-platform - -XXX +=item * -=back +SVs of type SVt_NV are now bodyless when a build configure and platform allow +it, specifically C. The bodyless trick is the same one +as for IVs since 5.9.2, but for NVs, unlike IVs, is not guarenteed on all +platforms and build configurations. -=head2 Discontinued Platforms +=item * -XXX List any platforms that this version of perl no longer compiles on. +The C<$DB::single>, C<$DB::signal> and C<$DB::trace> now have set and +get magic that stores their values as IVs and those IVs are used when +testing their values in C. This prevents perl from +recursing infinity if an overloaded object is assigned to any of those +variables. [perl #122445] -=over 4 +=item * -=item XXX-some-platform +C which is marked as public API but undocumented has been +removed from public API. If you use C macro in your XS code to +preextend the mortal stack, you are unaffected by this change. -XXX +=item * -=back +C, which was introduced in 5.21.4, has been changed incompatibly. +It now has a flags field that allows the caller to specify whether the name +should be fully qualified. See L. -=head2 Platform-Specific Notes +=item * -XXX List any changes for specific platforms. This could include configuration -and compilation changes or changes in portability/compatibility. However, -changes within modules for platforms should generally be listed in the -L section. +Internally Perl no longer uses the C flag. C now +returns a true value for anything not marked PADTMP. C is now +defined as 0. -=over 4 +=item * -=item XXX-some-platform +The macros SETsv and SETsvUN have been removed. They were no longer used +in the core since commit 6f1401dc2a, and have not been found present on +CPAN. -XXX +=item * -=back +The C<< SvFAKE >> bit (unused on HVs) got informally reserved by +David Mitchell for future work on vtables. -=head1 Internal Changes +=item * -XXX Changes which affect the interface available to C code go here. Other -significant internal changes for future core maintainers should be noted as -well. +The C function accepts C and C +flags, which specify whether the appended string is bytes or utf8, +respectively. -[ List each change as a =item entry ] +=item * -=over 4 +A new opcode class, C<< METHOP >> has been introduced, which holds +class/method related info needed at runtime to improve performance +of class/object method calls. -XXX +C<< OP_METHOD >> and C<< OP_METHOD_NAMED >> are moved from being +C<< UNOP/SVOP >> to being C<< METHOD >>. =back =head1 Selected Bug Fixes -XXX Important bug fixes in the core language are summarized here. Bug fixes in -files in F and F are best summarized in L. - -[ List each fix as a =item entry ] - =over 4 =item * -XXX - -=item * - -Constant dereferencing now works correctly for typeglob constants. -Previously the glob was stringified and its name looked up. Now the glob -itself is used. [perl #69456] +Locking and unlocking values via L or C +no longer has any effect on values that are read-only to begin. +Previously, unlocking such values could result in crashes, hangs or +other erratic behaviour. =item * -When parsing a funny character ($ @ % &) followed by braces, the parser no -longer tries to guess whether it is a block or a hash constructor (causing -a syntax error when it guesses the latter), since it can only be a block. +The internal C function (which L provides +access to) began erroneously to return true for "-e1" in 5.21.4, affecting +also C<-'-e1'>. This has been fixed. =item * -C now frees the referent immediately, instead of hanging -on to it until the next statement. [perl #122556] +The flip-flop operator (C<..> in scalar context) would return the same +scalar each time, unless the containing subroutine was called recursively. +Now it always returns a new scalar. [perl #122829] =item * -Various cases where the name of a sub is used (autoload, overloading, error -messages) used to crash for lexical subs, but have been fixed. +Some unterminated C<(?(...)...)> constructs in regular expressions would +either crash or give erroneous error messages. C is one such +example. =item * -Bareword lookup now tries to avoid vivifying packages if it turns out the -bareword is not going to be a subroutine name. +C no longer calls FETCH twice. =item * -Compilation of anonymous constants (e.g., C) no longer -deletes any subroutine named C<__ANON__> in the current package. Not only -was C<*__ANON__{CODE}> cleared, but there was a memory leak, too. This bug -goes back to perl 5.8.0. +List assignments like C<($x, $z) = (1, $y)> now work correctly if $x and $y +have been aliased by C. =item * -Stub declarations like C and C no longer wipe out -constants of the same name declared by C. This bug was -introduced in perl 5.10.0. +Some patterns including code blocks with syntax errors, such as +C, would hang or fail assertions on debugging builds. Now +they produce errors. =item * -Under some conditions a warning raised in compilation of regular -expression patterns could be displayed multiple times. This is now -fixed. +An assertion failure when parsing C with debugging enabled has been +fixed. [perl #122771] =item * -C now works properly in many instances. Some -names known to C<\N{...}> refer to a sequence of multiple characters, -instead of the usual single character. Bracketed character classes -generally only match single characters, but now special handling has -been added so that they can match named sequences, but not if the class -is inverted or the sequence is specified as the beginning or end of a -range. In these cases, the only behavior change from before is a slight -rewording of the fatal error message given when this class is part of a -C construct. When the C<[...]> stands alone, the same -non-fatal warning as before is raised, and only the first character in -the sequence is used, again just as before. +C<*a = *b; @a = split //, $b[1]> could do a bad read and produce junk +results. =item * -Tainted constants evaluated at compile time no longer cause unrelated -statements to become tainted. [perl #122669] +In C<() = @array = split>, the C<() => at the beginning no longer confuses +the optimiser, making it assume a limit of 1. =item * -C, which vivifies a handle with a name like "main::_GEN_0", -was not giving the handle the right reference count, so a double free could -happen. +Fatal warnings no longer prevent the output of syntax errors. +[perl #122966] =item * -When deciding that a bareword was a method name, the parser would get -confused if an "our" sub with the same name existed, and look up the method -in the package of the "our" sub, instead of the package of the invocant. +Fixed a NaN double to long double conversion error on VMS. For quiet NaNs +(and only on Itanium, not Alpha) negative infinity instead of NaN was +produced. =item * -The parser no longer gets confused by C<\U=> within a double-quoted string. -It used to roduce a syntax error, but now compiles it correctly. -[perl #80368] +Fixed the issue that caused C<< make distclean >> to leave files behind +that shouldn't. [perl #122820] =item * -It has always been the intention for the C<-B> and C<-T> file test -operators to treat UTF-8 encoded files as text. -(L has been updated to say this.) -Previously, it was possible for some files to be considered UTF-8 that -actually weren't valid UTF-8. This is now fixed. The operators now -work on EBCDIC platforms as well. +AIX now sets the length in C<< getsockopt >> correctly. [perl #120835], +[rt #91183], [rt #85570]. =item * -Under some conditions warning messages raised during regular expression -pattern compilation were being output more than once. This has now been -fixed. +During the pattern optimization phase, we no longer recurse into +GOSUB/GOSTART when not SCF_DO_SUBSTR. This prevents the optimizer +to run "forever" and exhaust all memory. [perl #122283] =item * -A regression has been fixed that was introduced in v5.20.0 (fixed in -v5.20.1 as well as here) in which a UTF-8 encoded regular expression -pattern that contains a single ASCII lowercase letter does not match its -uppercase counterpart. [perl #122655] - -=back - -=head1 Known Problems - -XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any -tests that had to be Ced for the release would be noted here. Unfixed -platform specific bugs also go here. - -[ List each fix as a =item entry ] - -=over 4 +F<< t/op/crypt.t >> now performs SHA-256 algorithm if the default one +is disabled. [perl #121591] =item * -XXX - -=back - -=head1 Errata From Previous Releases - -=over 4 +Fixed an off-by-one error when setting the size of shared array. +[perl #122950] =item * -XXX Add anything here that we forgot to add, or were mistaken about, in -the perldelta of a previous release. +Fixed a bug that could cause perl to execute an infite loop during +compilation. [perl #122995] =back -=head1 Obituary - -XXX If any significant core contributor has died, we've added a short obituary -here. - =head1 Acknowledgements XXX Generate this with: - perl Porting/acknowledgements.pl v5.21.3..HEAD + perl Porting/acknowledgements.pl v5.21.4..HEAD =head1 Reporting Bugs