In perl.git, the branch avar/v5.26.0-RC1-perldelta-fixes has been updated <http://perl5.git.perl.org/perl.git/commitdiff/b9bc6d2b7ea8df80f5b481b89ccf801d864557ee?hp=9c1e4c5a8f742a3008ed7df224e354a367e79537>
discards 9c1e4c5a8f742a3008ed7df224e354a367e79537 (commit) discards c938e8284d90d2f049f2fe1e8237b17f733e3c70 (commit) discards ed5a77ea7f6bf494495e2a6a8e267953232269e4 (commit) discards 6de536f567e95ad09a173a2faaa19bfabb96f755 (commit) discards 8e7c9ef207ebf75eb5c206d3e5004edd2f29dd5b (commit) discards 721b6a1c8e5ae495cc704a3a12cb823bf038f175 (commit) discards e0e8d975f93b557afdcb5c49f0eb649766e3cdfc (commit) discards a27f58bd2bd24ece68158775c8d330e01f7ea008 (commit) discards c9d585100051444908df4c2ab1ce378d09f30552 (commit) discards 620351dd961df7d6bffdb9b8a5f87f942405c783 (commit) discards 3783f6e4a5a49b292637d1def3e54d3738631f2e (commit) - Log ----------------------------------------------------------------- commit b9bc6d2b7ea8df80f5b481b89ccf801d864557ee Author: Ãvar Arnfjörð Bjarmason <[email protected]> Date: Tue May 16 18:30:10 2017 +0000 perldelta: clarify what '.' and @INC is about The existing section we had here was totally misleading. I couldn't understand "now provides a way to build" and "if you want it turn X on" differently than meaning that '.' was still in @INC by default and you had to compile perl with some optional switch to turn it on. It turns out[1] that the exact opposite of that is the case. This is on by default. Rewrite the entire section to make that clear to the reader. While I'm at it dumb it down a bit to be understandable to someone who's just upgrading Perl. Not everyone knows what @INC is offhand, but describing how we now load libraries is understandable to everyone. Then cover PERL_USE_UNSAFE_INC=1 and how it's set by various toolchain modules now, and finally avoid talking about both DEFAULT_INC_EXCLUDES_DOT and -Ddefault_inc_excludes_dot in the context of a build option, just use -Ddefault_inc_excludes_dot consistently. 1. "Re: Perl 5.26.0-RC1 is now available!" (<CAATnKFABh0PjQK0WLqC-MTugj==o22zjwrgdapfb1ehvlr0...@mail.gmail.com>" M pod/perldelta.pod commit 2b9ea28bc21b75f1de22234c9a2fc2441e607bae Author: Ãvar Arnfjörð Bjarmason <[email protected]> Date: Sat May 13 22:14:50 2017 +0000 perldelta: clarify how undeffing HV/AV is faster now There were better notes in the change that introduced this[1]. Copy the performance numbers from there, and say "arrays and hashes". instead of "AV and HV". Better to use the more familiar names than the internal struct names which are mostly only familiar to core devs. 1. be98855787 ("speed up AV and HV clearing/undeffing", 2016-10-26) M pod/perldelta.pod commit 7de7834667c9ca50011050148c23bd0d788706a8 Author: Ãvar Arnfjörð Bjarmason <[email protected]> Date: Sat May 13 22:00:15 2017 +0000 perldelta: clarify what these new capture variables are for This incorporates feedback from Yves[1] on-list ("Re: Perl 5.26.0-RC1 is now available!", [1]). When I first read this I wondered if e.g. the performance of these was different in some ways, it's not. So let's clarify that these are purely handy synonyms. 1. <CANgJU+Uh0Kg_fS=3ux5wvztskocoqt2gjvy8tgyhjctd0-d...@mail.gmail.com> M pod/perldelta.pod commit 9f981a8345fb76b6cc366f030a8c71fc2ee606f0 Author: Ãvar Arnfjörð Bjarmason <[email protected]> Date: Sat May 13 21:56:19 2017 +0000 perldelta: move the note abotu utf8_hop() to the bottom A note about a relatively obscure internal API function really doesn't belong so high up in the "Core Enhancements", before core visible user changes. Move this to the bottom, all of the other things in this section are things normal Perl programmers might actually use/encounter/care about, whereas this change is only relevant for some XS maintainers. M pod/perldelta.pod commit ddde7efd85df21f0cc1c563df853004e91919aa8 Author: Ãvar Arnfjörð Bjarmason <[email protected]> Date: Sat May 13 21:46:43 2017 +0000 perldelta: remove "maybe this won't be in 5.26" note about PERL_USE_UNSAFE_INC This was originally added in commit 8bbdbfcb89 ("Perldelta updates in prep for tomorrows release", 2016-11-19), we're now at RC1 so it's pretty clear that this will be in the release. M pod/perldelta.pod commit 9e0686300213049ca01e2f3dc1e60880250928a0 Author: Ãvar Arnfjörð Bjarmason <[email protected]> Date: Sat May 13 22:06:44 2017 +0000 perldelta: mention when lexical_subs were introduced Doesn't take up much space, and makes you aware that if you e.g. are using 5.18 already you can now use this in all your code without fear. M pod/perldelta.pod commit 53bac1db44b598e109d7b9a8f000fcc60b74fc10 Author: Ãvar Arnfjörð Bjarmason <[email protected]> Date: Sat May 13 22:01:51 2017 +0000 perldelta: 'for slightly more detail' -> 'for more details' There's no need to inject "slightly" there, that documentation section looks pretty complete to me. M pod/perldelta.pod commit c7690457a84f54133a9c065182a2ecc3892b8341 Author: Ãvar Arnfjörð Bjarmason <[email protected]> Date: Sat May 13 21:41:54 2017 +0000 perldelta: grammar fix: "[process] do not function well" -> "does not ..." M pod/perldelta.pod ----------------------------------------------------------------------- Summary of changes: pod/perldelta.pod | 72 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/pod/perldelta.pod b/pod/perldelta.pod index c8dc2b81a3..2932386447 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -64,14 +64,25 @@ prints "Hello there\n" with no leading whitespace. =head2 '.' and @INC -Perl now provides a way to build perl without C<.> in @INC by default. If you -want this feature, you can build with -Ddefault_inc_excludes_dot - -Because the build & test process for many Perl modules does not -function well with C<.> missing from @INC, setting -C<PERL_USE_UNSAFE_INC=1> in the environment for a perl built with the -"-Ddefault_inc_excludes_dot" option makes it behave as it previously -did, returning C<.> to @INC in all child processes. +Since time immemorial Perl has, as a last resort, loaded libraries +from the current directory. For security reasons this is no longer the +case, the C<@INC> variable no longer contains C<.> as its last element +by default. + +If you want to disable this behavior at compile-time build perl with +C<-Udefault_inc_excludes_dot> (C<-Ddefault_inc_excludes_dot> being the +default now). + +If you'd like to add C<.> back to C<@INC> at runtime set +C<PERL_USE_UNSAFE_INC=1> in the environment before starting +perl. Setting it to 1 restores C<.> in the C<@INC> when perl otherwise +lacks it. + +Various toolchain modules will set C<PERL_USE_UNSAFE_INC=1> +themselves. E.g. L<Test::Harness> sets it since loading modules from a +relative path is a common idiom in test code. If you find that you +have C<.> in C<@INC> on a perl built with default settings it's likely +that your code is being invoked by a toolchain module of some sort. =head2 @{^CAPTURE}, %{^CAPTURE}, and %{^CAPTURE_ALL} @@ -82,10 +93,10 @@ C<%{^CAPTURE}> is the equivalent to C<%+> (ie named captures) C<%{^CAPTURE_ALL}> is the equivalent to C<%-> (ie all named captures). - ^ This really needs a note about what this is actually for. Is it - just so you can get an array of all matched params? Why would you - use a more verbose synonym like %{^CAPTURE} instead of %+ in your - code? +Unlike e.g. the C<@-> replacement for the C<$&> regex variable there's +no performance reason to use these new synonyms. They've purely been +added for clarity similar to the L<English>.pm synonyms for various +variables documented in L<perlvar>. =head2 Unicode 9.0 is now supported @@ -198,13 +209,8 @@ the end of the supplied buffer. =head2 Remove current dir (C<.>) from C<@INC> For security reasons, C<@INC> no longer contains the default directory -(C<.>). - - Why are we mentioning this both here and in the main section - (maybe not an issue), but most importantly isn't this wrong? - don't we have . in @INC now unless you opt-in via - -Ddefault_inc_excludes_dot? If not the main section above - needs changing. +(C<.>). See L<the Core Enhancements section/"'.' and @INC"> for +details. =head2 "Escaped" colons and relative paths in PATH @@ -294,9 +300,6 @@ ones which weren't have been improved. Several other ops may now also be faster in boolean context. - Could we be a bit less vague here? Arithmetic ops? stuff like - print, what? - =item * New Faster Hash Function on 64 bit builds We use a different hash function for short and long keys. This should @@ -339,12 +342,22 @@ Enhancements in Regex concat COW implementation. =item * -Speed up C<AV> and C<HV> clearing/undeffing. +Clearing hashes and arrays has been made slightly faster. Now code +like this is around 5% faster: + + my @a; + for my $i (1..3_000_000) { + @a = (1,2,3); + @a = (); + } + +and this code around 3% faster: - Does this mean that `undef %h` and `undef @a` are faster, or is it - for some reason only the internal XS stuff? If it's the former - (which I assume) let's use the more readable forms someone not - deep into XS will know about. + my %h; + for my $i (1..3_000_000) { + %h = qw(a 1 b 2); + %h = (); + } =item * @@ -1651,10 +1664,7 @@ tests for perlbug. [perl #128020] =item * -C<DEFAULT_INC_EXCLUDES_DOT> has been turned on as default. - - Again, wasn't this off now by default per the intro section - talking about -Ddefault_inc_excludes_dot? +C<-Ddefault_inc_excludes_dot> has been turned on as default. =item * -- Perl5 Master Repository
