X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/9afd62035da781127f09672a85cd363e6aecc44f..476161f6df66100c5d0786092b0320bded84031b:/pod/perldelta.pod diff --git a/pod/perldelta.pod b/pod/perldelta.pod index e698041..5d32b79 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -5,15 +5,15 @@ [ 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.17.4 +perldelta - what is new for perl v5.17.7 =head1 DESCRIPTION -This document describes differences between the 5.17.3 release and the 5.17.4 +This document describes differences between the 5.17.6 release and the 5.17.7 release. -If you are upgrading from an earlier release such as 5.17.2, first read -L, which describes differences between 5.17.2 and 5.17.3. +If you are upgrading from an earlier release such as 5.17.5, first read +L, which describes differences between 5.17.5 and 5.17.6. =head1 Notice @@ -27,91 +27,6 @@ here, but most should go in the L section. [ List each enhancement as a =head2 entry ] -=head2 Latest Unicode 6.2 beta is included - -This is supposed to be the final data for 6.2, unless glitches are -found. The earlier experimental 6.2 beta data has been reverted, and -this used instead. Not all the changes that were proposed for 6.2 and -that were in the earlier beta versions are actually going into 6.2. In -particular, there are no changes from 6.1 in the General_Category of any -characters. 6.2 does revise the C<\X> handling for the REGIONAL -INDICATOR characters that were added in Unicode 6.0. Perl now for the -first time fully handles this revision. - -=head2 New DTrace probes - -The following new DTrace probes have been added: - -=over 4 - -=item C - -=item C - -=item C - -=back - -=head2 C<${^LAST_FH}> - -This new variable provides access to the filehandle that was last read. -This is the handle used by C<$.> and by C and C without -arguments. - -=head2 Looser here-doc parsing - -Here-doc terminators no longer require a terminating newline character when -they occur at the end of a file. This was already the case at the end of a -string eval [perl #65838]. - -=head2 New mechanism for experimental features - -Newly-added experimental features will now require this incantation: - - no warnings "experimental:feature_name"; - use feature "feature_name"; # would warn without the prev line - -There is a new warnings category, called "experimental", containing -warnings that the L pragma emits when enabling experimental -features. - -Newly-added experimental features will also be given special warning IDs, -which consist of "experimental:" followed by the name of the feature. (The -plan is to extend this mechanism eventually to all warnings, to allow them -to be enabled or disabled individually, and not just by category.) - -By saying - - no warnings "experimental:feature_name"; - -you are taking responsibility for any breakage that future changes to, or -removal of, the feature may cause. - -=head2 Lexical subroutines - -This new feature is still considered experimental. To enable it, use the -mechanism described above: - - use 5.018; - no warnings "experimental:lexical_subs"; - use feature "lexical_subs"; - -You can now declare subroutines with C, C, and -C. (C requires that the "state" feature be -enabled, unless you write it as C.) - -C creates a subroutine visible within the lexical scope in which -it is declared. The subroutine is shared between calls to the outer sub. - -C declares a lexical subroutine that is created each time the -enclosing block is entered. C is generally slightly faster than -C. - -C declares a lexical alias to the package subroutine of the same -name. - -See L. - =head1 Security XXX Any security-related notices go here. In particular, any security @@ -122,6 +37,17 @@ L section. =head1 Incompatible Changes +=head2 readline() with C<$/ = \N> now reads N characters, not N bytes + +Previously, when reading from a stream with I/O layers such as +C, the readline() function, otherwise known as the C<< <> >> +operator, would read I bytes from the top-most layer. [perl #79960] + +Now, I characters are read instead. + +There is no change in behaviour when reading from streams with no +extra layers, since bytes map exactly to characters. + XXX For a release on a stable branch, this section aspires to be: There are no changes intentionally incompatible with 5.XXX.XXX @@ -130,59 +56,6 @@ XXX For a release on a stable branch, this section aspires to be: [ List each incompatible change as a =head2 entry ] -=head2 Here-doc parsing - -The body of a here-document inside a quote-like operator now always begins -on the line after the "< like -this: - - %_=(_,"Just another "); - $_="Perl hacker,\n"; - s//_}->{_/e;print - -=head2 Interaction of lexical and default warnings - -Turning on any lexical warnings used first to disable all default warnings -if lexical warnings were not already enabled: - - $*; # deprecation warning - use warnings "void"; - $#; # void warning; no deprecation warning - -Now, the debugging, deprecated, glob, inplace and malloc warnings -categories are left on when turning on lexical warnings (unless they are -turned off by C, of course). - -This may cause deprecation warnings to occur in code that used to be free -of warnings. - -Those are the only categories consisting only of default warnings. Default -warnings in other categories are still disabled by C, as we do not yet have the infrastructure for controlling -individual warnings. - -=head2 C and C - -Due to an accident of history, C and C were equivalent -to a plain C, so one could even create an anonymous sub with -C. These are now disallowed outside of the "lexical_subs" -feature. Under the "lexical_subs" feature they have new meanings described -in L. - -=head2 C and SUPER - -The various C XS functions used to treat a package whose -named ended with ::SUPER specially. A method lookup on the Foo::SUPER -package would be treated as a SUPER method lookup on the Foo package. This -is no longer the case. To do a SUPER lookup, pass the Foo stash and the -GV_SUPER flag. - =head1 Deprecations XXX Any deprecated features, syntax, modules etc. should be listed here. In @@ -191,6 +64,41 @@ an updated module in the L section. [ List each deprecation as a =head2 entry ] +=head2 Various XS-callable functions are now deprecated + +The following functions will be removed from a future version of Perl, +and should not be used. With participating C compilers (e.g., gcc), +compiling any file that uses any of these will generate a warning. +These were not intended for public use; there are equivalent, faster, +macros for most of them. See L: +C, +C, +C, +C, +C, +C, +C, +C, +C, +C, +C, +C, +C, +C, +C, +C, +C, +C, +C, +C, +C. +C, +C, +C, +C, +and +C. + =head1 Performance Enhancements XXX Changes which enhance performance without changing behaviour go here. @@ -202,62 +110,7 @@ There may well be none in a stable release. =item * -Speed up in regular expression matching against Unicode properties. The -largest gain is for C<\X>, the Unicode "extended grapheme cluster". The -gain for it is about 35% - 40%. Bracketed character classes, e.g., -C<[0-9\x{100}]> containing code points above 255 are also now faster. - -=item * - -On platforms supporting it, several former macros are now implemented as static -inline functions. This should speed things up slightly on non-GCC platforms. - -=item * - -Apply the optimisation of hashes in boolean context, such as in C or C, -to constructs in non-void context. - -=item * - -Extend the optimisation of hashes in boolean context to C, -C<%hash ? ... : ...>, and C. - -=item * - -When making a copy of the string being matched against (so that $1, $& et al -continue to show the correct value even if the original string is subsequently -modified), only copy that substring of the original string needed for the -capture variables, rather than copying the whole string. - -This is a big win for code like - - $&; - $_ = 'x' x 1_000_000; - 1 while /(.)/; - -Also, when pessimizing if the code contains C<$`>, C<$&> or C<$'>, record the -presence of each variable separately, so that the determination of the substring -range is based on each variable separately. So performance-wise, - - $&; /x/ - -is now roughly equivalent to - - /(x)/ - -whereas previously it was like - - /^(.*)(x)(.*)$/ - -and - - $&; $'; /x/ - -is now roughly equivalent to - - /(x)(.*)$/ - -etc. +XXX =back @@ -289,102 +142,13 @@ XXX =item * -L has been upgraded from version 1.88 to 1.90. This adds -documentation fixes. - -=item * - -L has been upgraded from version 1.37 to 1.38. This makes the module work -with the new pad API. - -=item * - -L has been upgraded from version 0.92 to 0.93. This adds support -for the new C and C flags. - -=item * - -L has been upgraded from version 1.16 to 1.17. This suppresses -trailing semicolons in formats. - -=item * - -L has been upgraded from version 1.826 to 1.827. The main Perl module -no longer uses the C<"@_"> construct. - -=item * - -L has been upgraded from version 1.09 to 1.10. This fixes -compilation with C++ compilers and makes the module work with the new pad API. - -=item * - -L has been upgraded from version 1.15 to 1.16. This fixes warnings -about using C sections without an C section. - -=item * - -L has been upgraded from version 3.17 to 3.18. This avoids a -bogus warning for initialised XSUB non-parameters [perl #112776]. - -=item * - -L has been upgraded from version 2.23 to 2.24. C no longer -zeros files when copying into the same directory, and also now fails (as it has -long been documented to do) when attempting to copy a file over itself. - -=item * - -L has been upgraded from version 1.21 to 1.22. This fixes -inconsistent unixy path handling on VMS. - -=item * - -L has been upgraded from version 1.12 to 1.13. The C -function no longer uses C to close file descriptors since that -breaks the ref-counting of file descriptors done by PerlIO in cases where the -file descriptors are shared by PerlIO streams, leading to attempts to close the -file descriptors a second time when any such PerlIO streams are closed later on. - -=item * - -L has been upgraded from version 3.22 to 3.23. It includes some -new codes. - -=item * - -L has been upgraded from version 2.71 to 2.73. This restores -compatibility with older versions of perl and cleans up the corelist data for -various modules. - -=item * - -L has been upgraded from version 1.23 to 1.24 to reflect the removal of -the boolkeys opcode and the addition of the clonecv, introcv and padcv -opcodes. - -=item * - -L has been upgraded from version 2.004 to 2.006. -C and C now return just the IP -address in scalar context, and C now guards against incorrect -length scalars being passed in. - -=item * - -L has been upgraded from version 2.38 to 2.39. This contains Various -bugfixes, including compatibility fixes for older versions of Perl and vstring -handling. - -=item * - -L has been upgraded from version 1.40 to 1.41. This adds the -option to warn about or ignore attempts to clone structures that can't be -cloned, as opposed to just unconditionally dying in that case. - -=item * - -L has been upgraded from version 0.15 to 0.16. +L has been upgraded from version 1.14 to 1.15. The undocumented +optional fifth parameter to C has been removed. This was intended +to provide control of the callback used by C functions in case of +fatal errors (such as filesystem problems), but did not work (and could +never have worked). No code on CPAN even attempted to use it. The callback +is now always the previous default, C. Problems on some platforms with +how the C C function is called have also been resolved. =back @@ -417,13 +181,16 @@ 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 +There are quite a few macros callable from XS modules that classify +characters into things like alphabetic, punctuation, etc. More of these +are now documented, including ones which work on characters whose code +points are outside the Latin-1 range. =back @@ -457,68 +224,7 @@ XXX L =item * -L - -(F) To use lexical subs, you must first enable them: - - no warnings 'experimental:lexical_subs'; - use feature 'lexical_subs'; - my sub foo { ... } - -=item * - -L - -(W closure) During compilation, an inner named subroutine or eval is -attempting to capture an outer lexical subroutine that is not currently -available. This can happen for one of two reasons. First, the lexical -subroutine may be declared in an outer anonymous subroutine that has not -yet been created. (Remember that named subs are created at compile time, -while anonymous subs are created at run-time.) For example, - - sub { my sub a {...} sub f { \&a } } - -At the time that f is created, it can't capture the current the "a" sub, -since the anonymous subroutine hasn't been created yet. Conversely, the -following won't give a warning since the anonymous subroutine has by now -been created and is live: - - sub { my sub a {...} eval 'sub f { \&a }' }->(); - -The second situation is caused by an eval accessing a variable that has -gone out of scope, for example, - - sub f { - my sub a {...} - sub { eval '\&a' } - } - f()->(); - -Here, when the '\&a' in the eval is being compiled, f() is not currently -being executed, so its &a is not available for capture. - -=item * - -L<"%s" subroutine &%s masks earlier declaration in same %s|perldiag/"%s" subroutine &%s masks earlier declaration in same %s> - -(W misc) A "my" or "state" subroutine has been redeclared in the -current scope or statement, effectively eliminating all access to -the previous instance. This is almost always a typographical error. -Note that the earlier subroutine will still exist until the end of -the scope or until all closure references to it are destroyed. - -=item * - -L - -(S experimental) This warning is emitted if you enable an experimental -feature via C. Simply suppress the warning if you want -to use the feature, but know that in doing so you are taking the risk -of using an experimental feature which may change or be removed in a -future Perl version: - - no warnings "experimental:lexical_subs"; - use feature "lexical_subs"; +XXX L =back @@ -530,11 +236,7 @@ XXX Changes (i.e. rewording) of diagnostic messages go here =item * -L - -This warning was not suppressable, even with C. Now it is -suppressible, and has been moved from the "internal" category to the -"printf" category. +XXX Describe change here =back @@ -570,8 +272,7 @@ L section, instead. =item * -F will now correctly detect C when compiling with a C++ -compiler. +XXX =back @@ -617,14 +318,13 @@ XXX =head2 Discontinued Platforms +XXX List any platforms that this version of perl no longer compiles on. + =over 4 -=item VM/ESA +=item XXX-some-platform -Support for VM/ESA has been removed. The port was tested on 2.3.0, which -IBM ended service on in March 2002. 2.4.0 ended service in June 2003, and -was superseded by Z/VM. The current version of Z/VM is V6.2.0, and scheduled -for end of service on 2015/04/30. +XXX =back @@ -637,27 +337,9 @@ L section. =over 4 -=item Win32 - -Fixed a problem where perl could crash while cleaning up threads (including the -main thread) in threaded debugging builds on Win32 and possibly other platforms -[perl #114496]. - -A rare race condition that would lead to L taking more -time than requested, and possibly even hanging, has been fixed [perl #33096]. - -=item Solaris - -In Configure, avoid running sed commands with flags not supported on Solaris. - -=item Darwin - -Stop hardcoding an alignment on 8 byte boundaries to fix builds using --Dusemorebits. - -=item VMS +=item XXX-some-platform -Fix linking on builds configured with -Dusemymalloc=y. +XXX =back @@ -673,28 +355,7 @@ well. =item * -The APIs for accessing lexical pads have changed considerably. - -Cs are now longer Cs, but their own type instead. Cs now -contain a C and a C of Cs, rather than Cs for the -pad and the list of pad names. Cs, Cs, and Cs are to -be accessed as such though the newly added pad API instead of the plain C -and C APIs. See L for details. - -=item * - -In the regex API, the numbered capture callbacks are passed an index -indicating what match variable is being accessed. There are special -index values for the C<$`, $&, $&> variables. Previously the same three -values were used to retrieve C<${^PREMATCH}, ${^MATCH}, ${^POSTMATCH}> -too, but these have now been assigned three separate values. See -L. - -=item * - -C was previously a boolean indicating that any of -C<$`, $&, $&> had been seen; it now contains three one-bit flags -indicating the presence of each of the variables individually. +XXX =back @@ -703,134 +364,13 @@ indicating the presence of each of the variables individually. XXX Important bug fixes in the core language are summarized here. Bug fixes in files in F and F are best summarized in L. -=over 4 - -=item * - -The error "Can't localize through a reference" had disappeared in 5.16.0 -when C appeared on the last line of an lvalue subroutine. -This error disappeared for C<\local %$ref> in perl 5.8.1. It has now -been restored. - -=item * - -The parsing of here-docs has been improved significantly, fixing several -parsing bugs and crashes and one memory leak, and correcting wrong -subsequent line numbers under certain conditions. - -=item * - -Inside an eval, the error message for an unterminated here-doc no longer -has a newline in the middle of it [perl #70836]. - -=item * - -A substitution inside a substitution pattern (C) no longer -confuses the parser. - -=item * - -It may be an odd place to allow comments, but C has -always worked, I there happens to be a null character before the -first #. Now it works even in the presence of nulls. - -=item * - -An invalid range in C or C no longer results in a memory leak. - -=item * - -String eval no longer treats a semicolon-delimited quote-like operator at -the very end (C) as a syntax error. - -=item * - -C<< warn {$_ => 1} + 1 >> is no longer a syntax error. The parser used to -get confused with certain list operators followed by an anonymous hash and -then an infix operator that shares its form with a unary operator. - -=item * - -C<(caller $n)[6]> (which gives the text of the eval) used to return the -actual parser buffer. Modifying it could result in crashes. Now it always -returns a copy. The string returned no longer has "\n;" tacked on to the -end. The returned text also includes here-doc bodies, which used to be -omitted. - -=item * - -Reset the utf8 position cache when accessing magical variables to avoid the -string buffer and the utf8 position cache to get out of sync -[perl #114410]. - -=item * - -Various cases of get magic being called twice for magical utf8 strings have been -fixed. - -=item * - -This code (when not in the presence of C<$&> etc) - - $_ = 'x' x 1_000_000; - 1 while /(.)/; - -used to skip the buffer copy for performance reasons, but suffered from C<$1> -etc changing if the original string changed. That's now been fixed. - -=item * - -Perl doesn't use PerlIO anymore to report out of memory messages, as PerlIO -might attempt to allocate more memory. - -=item * - -In a regular expression, if something is quantified with C<{n,m}> -where C m>>, it can't possibly match. Previously this was a fatal error, -but now is merely a warning (and that something won't match). [perl #82954]. - -=item * - -It used to be possible for formats defined in subroutines that have -subquently been undefined and redefined to close over variables in the -wrong pad (the newly-defined enclosing sub), resulting in crashes or -"Bizarre copy" errors. - -=item * - -Redefinition of XSUBs at run time could produce warnings with the wrong -line number. - -=item * - -The %vd sprintf format does not support version objects for alpha versions. -It used to output the format itself (%vd) when passed an alpha version, and -also emit an "Invalid conversion in printf" warning. It no longer does, -but produces the empty string in the output. It also no longer leaks -memory in this case. - -=item * - -A bug fix in an earlier 5.17.x release caused C (a syntax error) -to result in a bad read or assertion failure, because an op was being freed -twice. - -=item * - -C<< $obj->SUPER::method >> calls in the main package could fail if the -SUPER package had already been accessed by other means. - -=item * +[ List each fix as a =item entry ] -Stash aliasing (C<*foo:: = *bar::>) no longer causes SUPER calls to ignore -changes to methods or @ISA or use the wrong package. +=over 4 =item * -Method calls on packages whose names end in ::SUPER are no longer treated -as SUPER method calls, resulting in failure to find the method. -Furthermore, defining subroutines in such packages no longer causes them to -be found by SUPER method calls on the containing package [perl #114924]. +XXX =back @@ -846,10 +386,7 @@ platform specific bugs also go here. =item * -Changes in the lexical pad API break several CPAN modules. - -To avoid having to patch those modules again later if we change pads from AVs -into their own types, APIs for accessing the contents of pads have been added. +XXX =back @@ -862,7 +399,7 @@ here. XXX Generate this with: - perl Porting/acknowledgements.pl v5.17.3..HEAD + perl Porting/acknowledgements.pl v5.17.6..HEAD =head1 Reporting Bugs