This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add the generated Acknowledgements section to perldelta
[perl5.git] / pod / perldelta.pod
index 4de94a3..b9434ad 100644 (file)
@@ -1,9 +1,9 @@
 =encoding utf8
 
-=head1 NAME
+=for to-do
+23b7025ebc definitely needs to be summarised.
 
-[ this is a template for a new perldelta file.  Any text flagged as XXX needs
-to be processed before release. ]
+=head1 NAME
 
 perldelta - what is new for perl v5.17.7
 
@@ -15,26 +15,16 @@ release.
 If you are upgrading from an earlier release such as 5.17.5, first read
 L<perl5176delta>, which describes differences between 5.17.5 and 5.17.6.
 
-=head1 Notice
-
-XXX Any important notices here
-
 =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</Performance Enhancements> section.
+=head2 $&, $` and $' are no longer slow
 
-[ List each enhancement as a =head2 entry ]
+These three infamous variables have been redeemed and no longer slow down
+your program when used.  Hence, the /p regular expression flag now does
+nothing.
 
 =head1 Security
 
-XXX Any security-related notices go here.  In particular, any security
-vulnerabilities closed should be noted here rather than in the
-L</Selected Bug Fixes> section.
-
-[ List each security issue as a =head2 entry ]
-
 =head1 Incompatible Changes
 
 =head2 readline() with C<$/ = \N> now reads N characters, not N bytes
@@ -48,21 +38,60 @@ Now, I<N> 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:
+=head2 Lexical subroutine warnings have moved
+
+The warning about the use of an experimental feature emitted when lexical
+subroutines (added in 5.17.4) are used now happens when the subroutine
+itself is declared, not when the "lexical_subs" feature is activated via
+C<use feature>.
 
-    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</Reporting Bugs> below.
+This stops C<use feature ':all'> from warning, but causes
+C<my sub foo; my sub bar> to warn twice.
 
-[ List each incompatible change as a =head2 entry ]
+=head2 Overridden C<glob> is now passed one argument
+
+C<glob> overrides used to be passed a magical undocumented second argument
+that identified the caller.  Nothing on CPAN was using this, and it got in
+the way of a bug fix, so it was removed.  If you really need to identify
+the caller, see L<Devel::Callsite> on CPAN.
 
 =head1 Deprecations
 
-XXX Any deprecated features, syntax, modules etc. should be listed here.  In
-particular, deprecated modules should be listed here even if they are listed as
-an updated module in the L</Modules and Pragmata> section.
+=head2 Lexical $_ is now deprecated
+
+Since it was introduced in Perl 5.10, it has caused much confusion with no
+obvious solution:
 
-[ List each deprecation as a =head2 entry ]
+=over
+
+=item *
+
+Various modules (e.g., List::Util) expect callback routines to use the
+global $_.  C<use List::Util 'first'; my $_; first { $_ == 1 } @list> does
+not work as one would expect.
+
+=item *
+
+A C<my $_> declaration earlier in the same file can cause confusing closure
+warnings.
+
+=item *
+
+The "_" subroutine prototype character allows called subroutines to access
+your lexical $_, so it is not really private after all.
+
+=item *
+
+Nevertheless, subroutines with a "(@)" prototype and methods cannot access
+the caller's lexical $_, unless they are written in XS.
+
+=item *
+
+But even XS routines cannot access a lexical $_ declared, not in the
+calling subroutine, but in an outer scope, iff that subroutine happened not
+to mention $_ or use any operators that default to $_.
+
+=back
 
 =head2 Various XS-callable functions are now deprecated
 
@@ -101,44 +130,37 @@ C<to_uni_upper_lc>.
 
 =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 *
 
-XXX
+Perl has a new copy-on-write mechanism that avoids the need to copy the
+internal string buffer when assigning from one scalar to another.  This
+makes copying large strings appear much faster.  Modifying one of the two
+(or more) strings after an assignment will force a copy internally.  This
+makes it unnecessary to pass strings by reference for efficiency.
 
 =back
 
 =head1 Modules and Pragmata
 
-XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
-go here.  If Module::CoreList is updated, generate an initial draft of the
-following sections using F<Porting/corelist-perldelta.pl>, which prints stub
-entries to STDOUT.  Results can be pasted in place of the '=head2' entries
-below.  A paragraph summary for important changes should then be added by hand.
-In an ideal world, dual-life modules would have a F<Changes> file that could be
-cribbed.
-
-[ Within each section, list entries as a =item entry ]
-
-=head2 New Modules and Pragmata
+=head2 Updated Modules and Pragmata
 
 =over 4
 
 =item *
 
-XXX
+L<File::DosGlob> has been upgraded from version 1.08 to 1.09.  The internal
+cache of file names that it keeps for each caller is now freed when that
+caller is freed.  This means
+C<< use File::DosGlob 'glob'; eval 'scalar <*>' >> no longer leaks memory.
 
-=back
-
-=head2 Updated Modules and Pragmata
+=item *
 
-=over 4
+L<File::Glob> has been upgraded from version 1.18 to 1.19.  File::Glob has
+had exactly the same fix as File::DosGlob.  Since it is what Perl's own
+C<glob> operator itself uses (except on VMS), this means
+C<< eval 'scalar <*>' >> no longer leaks.
 
 =item *
 
@@ -152,35 +174,10 @@ how the C<C> C<croak> function is called have also been resolved.
 
 =back
 
-=head2 Removed Modules and Pragmata
-
-=over 4
-
-=item *
-
-XXX
-
-=back
-
 =head1 Documentation
 
-XXX Changes to files in F<pod/> go here.  Consider grouping entries by
-file and be sure to link to the appropriate page, e.g. L<perlfunc>.
-
-=head2 New Documentation
-
-XXX Changes which create B<new> files in F<pod/> go here.
-
-=head3 L<XXX>
-
-XXX Description of the purpose of the new file here
-
 =head2 Changes to Existing Documentation
 
-XXX Changes which significantly change existing files in F<pod/> go here.
-However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
-section.
-
 =head3 L<perlapi/Character classes>
 
 =over 4
@@ -200,204 +197,219 @@ 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<perldiag>.
 
-XXX New or changed warnings emitted by the core's C<C> code go here.  Also
-include any changes in L<perldiag> that reconcile it to the C<C> code.
-
-=head2 New Diagnostics
-
-XXX Newly added diagnostic messages go under here, separated into New Errors
-and New Warnings
-
-=head3 New Errors
+=head2 Changes to Existing Diagnostics
 
 =over 4
 
 =item *
 
-XXX L<message|perldiag/"message">
+L<Constant(%s): Call to &{$^H{%s}} did not return a defined value|perldiag/Constant(%s): Call to &{$^H{%s}} did not return a defined value>
+
+Constant overloading that returns C<undef> results in this error message.
+For numeric constants, it used to say "Constant(undef)".  "undef" has been
+replaced with the number itself.
 
 =back
 
-=head3 New Warnings
+=head1 Internal Changes
 
 =over 4
 
 =item *
 
-XXX L<message|perldiag/"message">
+SvUPGRADE() is no longer an expression. Originally this macro (and its
+underlying function, sv_upgrade()) were documented as boolean, although
+in reality they always croaked on error and never returned false. In 2005
+the documentation was updated to specify a void return value, but
+SvUPGRADE() was left always returning 1 for backwards compatibility. This
+has now been removed, and SvUPGRADE() is now a statement with no return
+value.
 
-=back
+So this is now a syntax error:
 
-=head2 Changes to Existing Diagnostics
-
-XXX Changes (i.e. rewording) of diagnostic messages go here
-
-=over 4
+    if (!SvUPGRADE(sv)) { croak(...); }
 
-=item *
+If you have code like that, simply replace it with
 
-XXX Describe change here
+    SvUPGRADE(sv);
 
-=back
+or to to avoid compiler warnings with older perls, possibly
 
-=head1 Utility Changes
+    (void)SvUPGRADE(sv);
 
-XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
-Most of these are built within the directories F<utils> and F<x2p>.
+=item *
 
-[ List utility changes as a =head3 entry for each utility and =item
-entries for each change
-Use L<XXX> with program names to get proper documentation linking. ]
+Perl has a new copy-on-write mechanism that allows any SvPOK scalar to be
+upgraded to a copy-on-write scalar.  A reference count on the string buffer
+is stored in the string buffer itself.
 
-=head3 L<XXX>
+This breaks a few XS modules by allowing copy-on-write scalars to go
+through code paths that never encountered them before.
 
-=over 4
+This behaviour can still be disabled by running F<Configure> with
+B<-Accflags=-DPERL_NO_COW>.  This option will probably be removed in Perl
+5.20.
 
 =item *
 
-XXX
+Copy-on-write no longer uses the SvFAKE and SvREADONLY flags.  Hence,
+SvREADONLY indicates a true read-only SV.
 
-=back
+Use the SvIsCOW macro (as before) to identify a copy-on-write scalar.
 
-=head1 Configuration and Compilation
+=item *
 
-XXX Changes to F<Configure>, F<installperl>, F<installman>, 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</Platform Support> section, instead.
+C<PL_sawampersand> is now a constant.  The switch this variable provided
+(to enable/disable the pre-match copy depending on whether C<$&> had been
+seen) has been removed and replaced with copy-on-write, eliminating a few
+bugs.
 
-[ List changes as a =item entry ].
-
-=over 4
+The previous behaviour can still be enabled by running F<Configure> with
+B<-Accflags=-DPERL_SAWAMPERSAND>.
 
 =item *
 
-XXX
+PL_glob_index is gone.
 
 =back
 
-=head1 Testing
-
-XXX Any significant changes to the testing of a freshly built perl should be
-listed here.  Changes which create B<new> files in F<t/> go here as do any
-large changes to the testing harness (e.g. when parallel testing was added).
-Changes to existing files in F<t/> aren't worth summarizing, although the bugs
-that they represent may be covered elsewhere.
-
-[ List each test improvement as a =item entry ]
+=head1 Selected Bug Fixes
 
 =over 4
 
 =item *
 
-XXX
+C<sort {undef} ...> under fatal warnings no longer crashes.  It started
+crashing in Perl 5.16.
 
-=back
-
-=head1 Platform Support
+=item *
 
-XXX Any changes to platform support should be listed in the sections below.
+Stashes blessed into each other
+(C<bless \%Foo::, 'Bar'; bless \%Bar::, 'Foo'>) no longer result in double
+frees.  This bug started happening in Perl 5.16.
 
-[ Within the sections, list each platform as a =item entry with specific
-changes as paragraphs below it. ]
+=item *
 
-=head2 New Platforms
+Numerous memory leaks have been fixed, mostly involving fatal warnings and
+syntax errors.
 
-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<hints/>
-directories, or new subdirectories and F<README> files at the top level of the
-source tree.
+=item *
 
-=over 4
+Lexical constants (C<my sub answer () { 42 }>) no longer cause double
+frees.
 
-=item XXX-some-platform
+=item *
 
-XXX
+Constant subroutine redefinition warns by default, but lexical constants
+were accidentally exempt from default warnings.  This has been corrected.
 
-=back
+=item *
 
-=head2 Discontinued Platforms
+Some failed regular expression matches such as C<'f' =~ /../g> were not
+resetting C<pos>.  Also, "match-once" patterns (C<m?...?g>) failed to reset
+it, too, when invoked a second time [perl #23180].
 
-=over 4
+=item *
 
-=item BeOS
+Accessing C<$&> after a pattern match now works if it had not been seen
+before the match.  I.e., this applies to C<${'&'}> (under C<no strict>) and
+C<eval '$&'>.  The same applies to C<$'> and C<$`> [perl #4289].
 
-Support for BeOS has been removed.
+=item *
 
-=back
+Several bugs involving C<local *ISA> and C<local *Foo::> causing stale
+MRO caches have been fixed.  
 
-=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</Modules and Pragmata> section.
+Defining a subroutine when its typeglob has been aliased no longer results
+in stale method caches.  This bug was introduced in Perl 5.10.
 
-=over 4
+=item *
 
-=item XXX-some-platform
+Localising a typeglob containing a subroutine when the typeglob's package
+has been deleted from its parent stash no longer produces an error.  This
+bug was introduced in Perl 5.14.
 
-XXX
+=item *
 
-=back
+Under some circumstances, C<local *method=...> would fail to reset method
+caches upon scope exit.
 
-=head1 Internal Changes
+=item *
 
-XXX Changes which affect the interface available to C<XS> code go here.  Other
-significant internal changes for future core maintainers should be noted as
-well.
+C</[.foo.]/> is no longer an error, but produces a warning (as before) and
+is treated as C</[.fo]/> [perl #115818].
 
-[ List each change as a =item entry ]
+=item *
 
-=over 4
+C<goto $tied_var> now calls FETCH before deciding what type of goto
+(subroutine or label) this is.
 
 =item *
 
-XXX
+Renaming packages through glob assignment
+(C<*Foo:: = *Bar::; *Bar:: = *Baz::>) in combination with C<m?...?> and
+C<reset> no longer makes threaded builds crash.
 
-=back
+=item *
 
-=head1 Selected Bug Fixes
+An earlier release in the 5.17.x series could crash if user code prevented
+_charnames from loading via C<$INC{'_charnames.pm'}++>.
 
-XXX Important bug fixes in the core language are summarized here.  Bug fixes in
-files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
+=item *
 
-[ List each fix as a =item entry ]
+A number of bugs related to hash assignment have been fixed:
 
-=over 4
+=over 8
 
-=item *
+=item
 
-XXX
+The expression C<scalar(%h = (1, 1, 1, 1))> now returns C<4>, not C<2>.
 
-=back
+=item
 
-=head1 Known Problems
+Perl now issues the same warning on C<($s, %h) = (1, {})> as it does for
+C<(%h) = ({})>, "Reference found where even-sized list expected".
 
-XXX Descriptions of platform agnostic bugs we know we can't fix go here.  Any
-tests that had to be C<TODO>ed for the release would be noted here.  Unfixed
-platform specific bugs also go here.
+=item
 
-[ List each fix as a =item entry ]
+The return value of C<%h = (1, 1, 1)> (in list context was wrong. It would
+return I<just> those items instead of returning an additional C<undef> value
+for the missing value in the assignment.
 
-=over 4
+=back
 
-=item *
+=back
 
-XXX
+=head1 Acknowledgements
 
-=back
+Perl 5.17.7 represents approximately 4 weeks of development since Perl 5.17.6
+and contains approximately 30,000 lines of changes across 490 files from 26
+authors.
 
-=head1 Obituary
+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.17.7:
 
-XXX If any significant core contributor has died, we've added a short obituary
-here.
+Alexandr Ciornii, Bob Ernst, Brian Carlson, Chris 'BinGOs' Williams, Craig A.
+Berry, Daniel Dragan, Dave Rolsky, David Mitchell, Father Chrysostomos, Hugo
+van der Sanden, James E Keenan, Joel Berger, Karl Williamson, Lukas Mai, Martin
+Hasch, Matthew Horsfall, Nicholas Clark, Ricardo Signes, Ruslan Zakirov, Sergey
+Alekseev, Steffen Müller, Sullivan Beck, Sven Strickroth, Sébastien
+Aperghis-Tramoni, Tony Cook, Yves Orton.
 
-=head1 Acknowledgements
+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.
 
-XXX Generate this with:
+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.
 
-  perl Porting/acknowledgements.pl v5.17.6..HEAD
+For a more complete list of all of Perl's historical contributors, please see
+the F<AUTHORS> file in the Perl source distribution.
 
 =head1 Reporting Bugs