From 2fed6d9cd873b7995d8e7617e8e969539d3165bf Mon Sep 17 00:00:00 2001 From: Ricardo Signes Date: Fri, 11 Apr 2014 19:10:54 -0400 Subject: [PATCH] first pass editing up through "Configuration and Compilation" --- Porting/perl5200delta.pod | 401 ++++++++++++++++++---------------------------- 1 file changed, 152 insertions(+), 249 deletions(-) diff --git a/Porting/perl5200delta.pod b/Porting/perl5200delta.pod index ead0766..6c7212e 100644 --- a/Porting/perl5200delta.pod +++ b/Porting/perl5200delta.pod @@ -119,16 +119,6 @@ The functions PerlIO_get_bufsiz, PerlIO_get_cnt, PerlIO_set_cnt and PerlIO_set_ptrcnt now have SSize_t, rather than int, return values and parameters. -=head2 PERL_DEBUG_READONLY_COW - -On some operating systems Perl can be compiled in such a way that any -attempt to modify string buffers shared by multiple SVs will crash. This -way XS authors can test that their modules handle copy-on-write scalars -correctly. See L for detail. - -This feature was actually added in 5.19.8, but was unintentionally omitted -from its delta document. - =head2 C> now compiles on systems without locale ability Previously doing this caused the program to not compile. Within its @@ -376,26 +366,26 @@ 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. -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. +Note that the planned removal of these modules from core does not reflect a +judgement about the quality of the code and should not be taken as a suggestion +that their use be halted. Their disinclusion from core primarily hinges on +their necessity to bootstrapping a fully functional, CPAN-capable Perl +installation, not on concerns over their design. =over -=item L +=item L and its associated CGI:: packages + +=item L =item L +=item L and its associated Module::Build:: packages + =back =head1 Performance Enhancements -XXX Changes which enhance performance without changing behaviour go here. -There may well be none in a stable release. - -[ List each enhancement as a =item entry ] - =over 4 =item * @@ -416,9 +406,10 @@ It can be disabled (for now) in a perl build with: -Accflags=PERL_NO_COW -=item * - -Precomputed hash values are now used in more places during method lookup. +On some operating systems Perl can be compiled in such a way that any +attempt to modify string buffers shared by multiple SVs will crash. This +way XS authors can test that their modules handle copy-on-write scalars +correctly. See L for detail. =item * @@ -428,6 +419,15 @@ now better handles code points that are above the Latin1 range. =item * +Executing a regex that contains the C<^> anchor (or its variant under the +C flag) has been made much faster in several situations. + +=item * + +Precomputed hash values are now used in more places during method lookup. + +=item * + Constant hash key lookups (C<$hash{key}> as opposed to C<$hash{$key}>) have long had the internal hash value computed at compile time, to speed up lookup. This optimisation has only now been applied to hash slices as @@ -478,19 +478,8 @@ becomes: =item * -When doing a global regex match on a string that came from the C -or CE> operator, the data is no longer copied unnecessarily. -[perl #121259] - -=item * - -Executing a regex that contains the C<^> anchor (or its variant under the -C flag) has been made much faster in several situations. - -=item * - -It is now faster to create certain sorts of lists, including array and hash -slices. +The creation of certain sorts of lists, including array and hash slices, is now +faster. =item * @@ -501,12 +490,6 @@ speed up Perl code using expressions like C<$x[-1]>, at the expense of =item * -Dereferencing (as in C<$obj-E[0]> or C<$obj-E{k}>) is now faster -when C<$obj> is an instance of a class that has overloaded methods, but -doesn't overload any of the dereferencing methods C<@{}>, C<%{}>, and so on. - -=item * - The first iteration over a large hash (using C or C) is now faster. This is achieved by preallocating the hash's internal iterator state, rather than lazily creating it when the hash is first iterated. (For @@ -518,6 +501,18 @@ space for the hash itself.) =item * +When doing a global regex match on a string that came from the C +or CE> operator, the data is no longer copied unnecessarily. +[perl #121259] + +=item * + +Dereferencing (as in C<$obj-E[0]> or C<$obj-E{k}>) is now faster +when C<$obj> is an instance of a class that has overloaded methods, but +doesn't overload any of the dereferencing methods C<@{}>, C<%{}>, and so on. + +=item * + Perl's optimiser no longer skips optimising code that follows certain C expressions (including those with an apparent infinite loop). @@ -530,11 +525,6 @@ deletion is now applied in some situations that weren't previously handled. =item * -A few micro-optimisations have been applied to performance-sensitive parts -of the implementation, including subroutine invocation and scope exit. - -=item * - Perl now does less disk I/O when dealing with Unicode properties that cover up to three ranges of consecutive code points. @@ -542,87 +532,21 @@ up to three ranges of consecutive code points. =head1 Modules and Pragmata -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. - -[ Within each section, list entries as a =item entry ] - -=head2 New Modules and Pragmata - -=over 4 - -=item * - -XXX - -=back - -=head2 Updated Modules and Pragmata - -=over 4 - -=item * - -L has been upgraded from version A.xx to B.yy. - -=back - -=head2 Removed Modules and Pragmata - -The distributions below have been removed from the core, but are still -available on the CPAN. In many cases, the named distribution includes -multiple modules, which are not listed individually. For a -comprehensive list of removals, consult: - - $ corelist --dif 5.18.0 5.20.0 | grep absent - -=over - -=item Archive-Extract - -=item B-Lint - -=item CPANPLUS - -=item File-CheckTree - -=item Log-Message - -=item Module-Pluggable - -=item Object-Accessor - -=item Pod-LaTeX - -=item Term-UI - -=item Text-Soundex - -=back + XXX TO BE AUTOGENERATED =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 =head3 L This document was removed (actually, renamed L and given a major -overhaul) in Perl 5.13.10, causing Perl documentation websites to show the now -out of date version in Perl 5.12 as the latest version. It has now been +overhaul) in Perl v5.14, causing Perl documentation websites to show the now +out of date version in Perl v5.12 as the latest version. It has now been restored in stub form, directing readers to current information. =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 =over 4 @@ -655,11 +579,11 @@ C<\s> matching C<\cK> is marked experimental =item * -ithreads were accepted in 5.8.0 +ithreads were accepted in v5.8.0 (but are discouraged as of v5.20.0) =item * -Long doubles are not experimental +Long doubles are not considered experimental. =item * @@ -675,26 +599,26 @@ also affects L and L.) =item * -C is now documented to handle an expression that evalutes to a -code reference as if it was C. This behavior is at least ten -years old. +C and C now note that they can reset the hash iterator. =item * -C now has caveats about expanding floating point numbers in some -locales +C's handling of arguments is now more clearly documented. =item * -Noted that C and C can reset the hash iterator +C now has caveats about expanding floating point numbers in some +locales =item * -Improved C example +C is now documented to handle an expression that evalutes to a +code reference as if it was C. This behavior is at least ten +years old. =item * -Since Perl v5.10, it has been possible for subroutines in @INC to return +Since Perl v5.10, it has been possible for subroutines in C<@INC> to return a reference to a scalar holding initial source code to prepend to the file. This is now documented. @@ -704,11 +628,6 @@ The documentation of C has been updated to recommend the use of C, C and C when dealing with references to blessed objects. -=item * - -L's handling of arguments is now more clearly -documented. - =back =head3 L @@ -723,8 +642,7 @@ internals in this release. =item * New sections on L and -L have been added. They were -actually added in 5.19.8 but accidentally omitted from its delta document. +L have been added. =back @@ -734,7 +652,7 @@ actually added in 5.19.8 but accidentally omitted from its delta document. =item * -The L section has +The L section has been updated. =back @@ -770,7 +688,7 @@ lexical warnings in a single place. =item * -Update to mention fc(), \F +The documentation now mentions F and C<\F>. =back @@ -882,7 +800,8 @@ workarounds and changes in different versions of Perl, has been added. =item * Three L variable names which have long been documented but do not -actually exist have been removed from the documentation. +actually exist have been removed from the documentation. These were +C<$OLD_PERL_VERSION>, C<$OFMT>, and C<$ARRAY_BASE>. =back @@ -902,14 +821,8 @@ 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 @@ -949,117 +862,94 @@ Added L to a %s reference is forbidden|perldiag/"Setting $E =item * -L - -(W syscalls) Embedded \0 characters in pathnames or other system call arguments -produce a warning as of 5.20. The parts after the \0 were formerly ignored by -system calls. - -=item * - -L +L<%s on a reference is experimental|perldiag/"%s on a reference is experimental">: -(W syntax) There is a possible problem with the mixing of a control flow -operator (e.g. C) and a low-precedence operator like C. Consider: +The "auto-deref" feature is experimental. - sub { return $a or $b; } +Starting in v5.14.0, it was possible to use push, pop, keys, and other +built-in functions not only on aggregate types, but on references to +them. The feature was not deployed to its original intended +specification, and now may become redundant to postfix dereferencing. +It has always been categorized as an experimental feature, and in +v5.20.0 is carries a warning as such. -This is parsed as: +Warnings will now be issued at compile time when these operations are +detected. - sub { (return $a) or $b; } + no if $] >= 5.01908, warnings => "experimental::autoderef"; -Which is effectively just: +Consider, though, replacing the use of these features, as they may +change behavior again before becoming stable. - sub { return $a; } +=item * -Either use parentheses or the high-precedence variant of the operator. +L -Note this may be also triggered for constructs like: +L - sub { 1 if die; } +These two deprecation warnings involving C<\N{...}> were incorrectly +implemented. They did not warn by default (now they do) and could not be +made fatal via C<< use warnings FATAL => 'deprecated' >> (now they can). =item * -L +L -(W syntax) In scalar context, you've used an array index/value slice (indicated -by %) to select a single element of an array. Generally it's better to ask for -a scalar value (indicated by $). The difference is that C<$foo[&bar]> always -behaves like a scalar, both in the value it returns and when evaluating its -argument, while C<%foo[&bar]> provides a list context to its subscript, which -can do weird things if you're expecting only one subscript. When called in -list context, it also returns the index (what C<&bar> returns) in addition to -the value. +(W numeric) The indicated string was fed as an argument to the C<++> operator +which expects either a number or a string matching C. +See L for details. =item * -L +L -(W syntax) In scalar context, you've used a hash key/value slice (indicated by -%) to select a single element of a hash. Generally it's better to ask for a -scalar value (indicated by $). The difference is that C<$foo{&bar}> always -behaves like a scalar, both in the value it returns and when evaluating its -argument, while C<@foo{&bar}> and provides a list context to its subscript, -which can do weird things if you're expecting only one subscript. When called -in list context, it also returns the key in addition to the value. +(W misc) A sub was declared as sub foo : prototype(A) : prototype(B) {}, for +example. Since each sub can only have one prototype, the earlier +declaration(s) are discarded while the last one is applied. =item * -L +L -(D deprecated) Using literal control characters in the source to refer to the -^FOO variables, like $^X and ${^GLOBAL_PHASE} is now deprecated. This only -affects code like $\cT, where \cT is a control in the source code: ${"\cT"} and -$^T remain valid. +(W syscalls) Embedded \0 characters in pathnames or other system call arguments +produce a warning as of 5.20. The parts after the \0 were formerly ignored by +system calls. =item * -L - -L +L. -These two deprecation warnings involving C<\N{...}> were incorrectly -implemented. They did not warn by default (now they do) and could not be -made fatal via C<< use warnings FATAL => 'deprecated' >> (now they can). +This replaces the message "Code point 0x%X is not Unicode, all \p{} matches +fail; all \P{} matches succeed". =item * -L +L -(W illegalproto) A grouping was started with C<[> but never closed with -C<]>. +(W illegalproto) A grouping was started with C<[> but never closed with C<]>. =item * -L - -(W numeric) The indicated string was fed as an argument to the C<++> operator -which expects either a number or a string matching C. -See L for details. +L -=item * +(W syntax) There is a possible problem with the mixing of a control flow +operator (e.g. C) and a low-precedence operator like C. Consider: -L + sub { return $a or $b; } -(S) exit() was called or the script otherwise finished gracefully when -C was set in C. +This is parsed as: -=item * + sub { (return $a) or $b; } -L +Which is effectively just: -(S) An uncaught die() was called when C was set in -C. + sub { return $a; } -=item * +Either use parentheses or the high-precedence variant of the operator. -L +Note this may be also triggered for constructs like: -(W misc) A sub was declared as sub foo : prototype(A) : prototype(B) {}, for -example. Since each sub can only have one prototype, the earlier -declaration(s) are discarded while the last one is applied. + sub { 1 if die; } =item * @@ -1088,41 +978,61 @@ used. =item * -L +L -This fixes [Perl #42957]. +(W syntax) In scalar context, you've used an array index/value slice (indicated +by %) to select a single element of an array. Generally it's better to ask for +a scalar value (indicated by $). The difference is that C<$foo[&bar]> always +behaves like a scalar, both in the value it returns and when evaluating its +argument, while C<%foo[&bar]> provides a list context to its subscript, which +can do weird things if you're expecting only one subscript. When called in +list context, it also returns the index (what C<&bar> returns) in addition to +the value. =item * -L<%s on a reference is experimental|perldiag/"%s on a reference is experimental">: +L -The "auto-deref" feature is experimental. +(W syntax) In scalar context, you've used a hash key/value slice (indicated by +%) to select a single element of a hash. Generally it's better to ask for a +scalar value (indicated by $). The difference is that C<$foo{&bar}> always +behaves like a scalar, both in the value it returns and when evaluating its +argument, while C<@foo{&bar}> and provides a list context to its subscript, +which can do weird things if you're expecting only one subscript. When called +in list context, it also returns the key in addition to the value. -Starting in v5.14.0, it was possible to use push, pop, keys, and other -built-in functions not only on aggregate types, but on references to -them. The feature was not deployed to its original intended -specification, and now may become redundant to postfix dereferencing. -It has always been categorized as an experimental feature, and in -v5.20.0 is carries a warning as such. +=item * -Warnings will now be issued at compile time when these operations are -detected. +L to a reference to %s as a form of slurp is deprecated, treating as undef|perldiag/"Setting $E to a reference to %s as a form of slurp is deprecated, treating as undef"> - no if $] >= 5.01908, warnings => "experimental::autoderef"; +=item * -Consider, though, replacing the use of these features, as they may -change behavior again before becoming stable. +L + +(S) exit() was called or the script otherwise finished gracefully when +C was set in C. =item * -L. -This replaces the message "Code point 0x%X is not Unicode, all \p{} -matches fail; all \P{} matches succeed". +L + +(S) An uncaught die() was called when C was set in +C. + +=item * + +L + +(D deprecated) Using literal control characters in the source to refer to the +^FOO variables, like $^X and ${^GLOBAL_PHASE} is now deprecated. This only +affects code like $\cT, where \cT is a control in the source code: ${"\cT"} and +$^T remain valid. =item * -Added L to a reference to %s as a form of slurp is deprecated, treating as undef|perldiag/"Setting $E to a reference to %s as a form of slurp is deprecated, treating as undef"> +L +This fixes [Perl #42957]. =back @@ -1234,17 +1144,7 @@ beginning of a buffer has been fixed. [perl #120244] =back -=head3 L - -=over 4 - -=item * - -L now handles C wildcards correctly. [perl #113054] - -=back - -=head3 F enhancements +=head3 F The git bisection tool F has had many enhancements. @@ -1281,6 +1181,16 @@ which can be useful for pinpointing the origins of bugs or behaviour changes. =back +=head3 L + +=over 4 + +=item * + +L now handles C wildcards correctly. [perl #113054] + +=back + =head3 L =over 4 @@ -1298,13 +1208,6 @@ output raw. =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 ]. - =over 4 =item * -- 2.7.4