This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Module::CoreList for 5.17.8
[perl5.git] / pod / perldelta.pod
index 3415403..f99ccb7 100644 (file)
 =encoding utf8
 
-=for to-do
-23b7025ebc definitely needs to be summarised.
-
 =head1 NAME
 
-perldelta - what is new for perl v5.17.7
+perldelta - what is new for perl v5.17.8
 
 =head1 DESCRIPTION
 
-This document describes differences between the 5.17.6 release and the 5.17.7
+This document describes differences between the 5.17.7 release and the 5.17.8
 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.
+If you are upgrading from an earlier release such as 5.17.6, first read
+L<perl5177delta>, which describes differences between 5.17.6 and 5.17.7.
 
 =head1 Core Enhancements
 
-=head2 $&, $` and $' are no longer slow
-
-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
+=head2 Regular Expression Set Operations
 
-=head2 C<Storable> security warning in documentation
+This is an experimental feature to allow matching against the the union,
+intersection, etc., of sets of code points, similar to
+L<Unicode::Regex::Set>.  It can also be used to extend C</x> processing
+to [bracketed] character classes, and as a replacement of user-defined
+properties, allowing more complex expressions than they do.  See
+L<perlre/(?[ ])>.
 
-The documentation for C<Storable> now includes a section which warns readers
-of the danger of accepting Storable documents from untrusted sources. The
-short version is that deserializing certain types of data can lead to loading
-modules and other code execution. This is documented behavior and wanted
-behavior, but this opens an attack vector for malicious entities.
+=head1 Deprecations
 
-=head2 C<Locale::Maketext> allowed code injection via a malicious template
+=head2 Deprecated modules
 
-If users could provide a translation string to Locale::Maketext, this could be
-used to invoke arbitrary Perl subroutines available in the current process.
+The Pod::LaTeX module is now deprecated, and due to be moved out of the Perl
+core in 5.20.  Until then, using the core-installed version will produce a
+warning.  You can suppress the warning by installing the module from CPAN.
 
-This has been fixed, but it is still possible to invoke any method provided by
-C<Locale::Maketext> itself or a subclass that you are using. One of these
-methods in turn will invoke the Perl core's C<sprintf> subroutine.
+=head2 User-defined charnames with surprising whitespace
 
-In summary, allowing users to provide translation strings without auditing
-them is a bad idea.
+A user-defined character name with trailing or multiple spaces in a row is
+likely a typo.  This now generates a warning when defined, on the assumption
+that uses of it will be unlikely to include the excess whitespace.
 
-This vulnerability is documented in CVE-2012-6329.
+=head2 Various XS-callable functions are now deprecated
 
-=head1 Incompatible Changes
+All the functions used to classify characters 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<perlapi/Character classes>.  The complete list (including some
+that were deprecated in 5.17.7) is:
+C<is_uni_alnum>, C<is_uni_alnumc>, C<is_uni_alnumc_lc>,
+C<is_uni_alnum_lc>, C<is_uni_alpha>, C<is_uni_alpha_lc>,
+C<is_uni_ascii>, C<is_uni_ascii_lc>, C<is_uni_blank>,
+C<is_uni_blank_lc>, C<is_uni_cntrl>, C<is_uni_cntrl_lc>,
+C<is_uni_digit>, C<is_uni_digit_lc>, C<is_uni_graph>,
+C<is_uni_graph_lc>, C<is_uni_idfirst>, C<is_uni_idfirst_lc>,
+C<is_uni_lower>, C<is_uni_lower_lc>, C<is_uni_print>,
+C<is_uni_print_lc>, C<is_uni_punct>, C<is_uni_punct_lc>,
+C<is_uni_space>, C<is_uni_space_lc>, C<is_uni_upper>,
+C<is_uni_upper_lc>, C<is_uni_xdigit>, C<is_uni_xdigit_lc>,
+C<is_utf8_alnum>, C<is_utf8_alnumc>, C<is_utf8_alpha>,
+C<is_utf8_ascii>, C<is_utf8_blank>, C<is_utf8_char>,
+C<is_utf8_cntrl>, C<is_utf8_digit>, C<is_utf8_graph>,
+C<is_utf8_idcont>, C<is_utf8_idfirst>, C<is_utf8_lower>,
+C<is_utf8_mark>, C<is_utf8_perl_space>, C<is_utf8_perl_word>,
+C<is_utf8_posix_digit>, C<is_utf8_print>, C<is_utf8_punct>,
+C<is_utf8_space>, C<is_utf8_upper>, C<is_utf8_xdigit>,
+C<is_utf8_xidcont>, C<is_utf8_xidfirst>.
+
+In addition these three functions that have never worked properly are
+deprecated:
+C<to_uni_lower_lc>, C<to_uni_title_lc>, and C<to_uni_upper_lc>.
 
-=head2 readline() with C<$/ = \N> now reads N characters, not N bytes
+=head2 Certain rare uses of backslashes within regexes are now deprectated
 
-Previously, when reading from a stream with I/O layers such as
-C<encoding>, the readline() function, otherwise known as the C<< <> >>
-operator, would read I<N> bytes from the top-most layer. [perl #79960]
+There are three pairs of characters that Perl recognizes as
+metacharacters in regular expression patterns: C<{}>, C<[]>, and C<()>.
+These can be used as well to delimit patterns, as in:
 
-Now, I<N> characters are read instead.
+ m{foo}
+ s(foo)(bar)
 
-There is no change in behaviour when reading from streams with no
-extra layers, since bytes map exactly to characters.
+Since they are metacharacters, they have special meaning to regular
+expression patterns, and it turns out that you can't turn off that
+special meaning by the normal means of preceding them with a backslash,
+if you use them, paired, within a pattern delimitted by them.  For
+example, in
 
-=head2 Lexical subroutine warnings have moved
+ m{foo\{1,3\}}
 
-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>.
+the backslashes do not change the behavior, and this matches
+S<C<"f o">> followed by one to three more occurrences of C<"o">.
 
-This stops C<use feature ':all'> from warning, but causes
-C<my sub foo; my sub bar> to warn twice.
+Usages like this, where they are interpreted as metacharacters, are
+exceedingly rare; we think there are none, for example, in all of CPAN.
+Hence, this deprecation should affect very little code.  It does give
+notice, however, that any such code needs to change, which will in turn
+allow us to change the behavior in future Perl versions so that the
+backslashes do have an effect, and without fear that we are silently
+breaking any existing code.
 
-=head2 Overridden C<glob> is now passed one argument
+=head1 Modules and Pragmata
 
-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.
+=head2 Selected Updates to Modules and Pragmata
 
-=head1 Deprecations
+=over 4
 
-=head2 Lexical $_ is now deprecated
+=item *
 
-Since it was introduced in Perl 5.10, it has caused much confusion with no
-obvious solution:
+Several modules have had their version number changed to one with no
+underscore, since such version numbers are usually interpreted to mean
+"development-only version".  No other changes have been made in these cases.
+The affected modules are:
 
-=over
+=over 4
 
 =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.
+L<I18N::Langinfo> was 0.08_02 and is now 0.09
 
 =item *
 
-A C<my $_> declaration earlier in the same file can cause confusing closure
-warnings.
+L<I18N::LangTags::List> was 0.35_01 and is now 0.39
 
 =item *
 
-The "_" subroutine prototype character allows called subroutines to access
-your lexical $_, so it is not really private after all.
+L<IO> was 1.25_08 and is now 1.26
 
 =item *
 
-Nevertheless, subroutines with a "(@)" prototype and methods cannot access
-the caller's lexical $_, unless they are written in XS.
+L<Safe> was 2.33_01 and is now 2.34
 
 =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 $_.
+L<Test> was 1.25_02 and is now 1.26.
 
 =back
 
-=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<perlapi/Character classes>:
-C<is_uni_ascii>, C<is_uni_ascii_lc>, C<is_uni_blank>, C<is_uni_blank_lc>,
-C<is_uni_cntrl>, C<is_uni_cntrl_lc>, C<is_uni_idfirst_lc>, C<is_uni_space>,
-C<is_uni_space_lc>, C<is_uni_xdigit>, C<is_uni_xdigit_lc>, C<is_utf8_ascii>,
-C<is_utf8_blank>, C<is_utf8_cntrl>, C<is_utf8_idcont>, C<is_utf8_idfirst>,
-C<is_utf8_perl_space>, C<is_utf8_perl_word>, C<is_utf8_posix_digit>,
-C<is_utf8_space>, C<is_utf8_xdigit>. C<is_utf8_xidcont>, C<is_utf8_xidfirst>,
-C<to_uni_lower_lc>, C<to_uni_title_lc>, and C<to_uni_upper_lc>.
-
-=head1 Performance Enhancements
-
-=over 4
-
 =item *
 
-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
-
-=head2 Updated Modules and Pragmata
-
-=over 4
-
-=item *
-
-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.
+L<Digest::SHA> has been upgraded from version 5.80 to 5.81.  This fixes a
+double-free bug, which might have caused vulnerabilities in some cases.
 
 =item *
 
-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.
+L<Module::CoreList> has been upgraded from 2.79 to 2.80.
 
 =item *
 
-L<GDBM_File> has been upgraded from version 1.14 to 1.15. The undocumented
-optional fifth parameter to C<TIEHASH> has been removed. This was intended
-to provide control of the callback used by C<gdbm*> 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<croak>. Problems on some platforms with
-how the C<C> C<croak> function is called have also been resolved.
-
-=back
-
-=head1 Documentation
-
-=head2 Changes to Existing Documentation
-
-=head3 L<perlapi/Character classes>
-
-=over 4
-
-=item *
-
-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.
+L<Socket> has been upgraded from 2.006_001 to 2.009.  This fixes an
+uninitialized memory read.
 
 =back
 
@@ -199,210 +156,142 @@ 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>.
 
-=head2 Changes to Existing Diagnostics
-
-=over 4
-
-=item *
+=head2 New Diagnostics
 
-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
-
-=head1 Internal Changes
+=head3 New Warnings
 
 =over 4
 
 =item *
 
-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.
-
-So this is now a syntax error:
-
-    if (!SvUPGRADE(sv)) { croak(...); }
-
-If you have code like that, simply replace it with
-
-    SvUPGRADE(sv);
-
-or to to avoid compiler warnings with older perls, possibly
-
-    (void)SvUPGRADE(sv);
+L<'%s' resolved to '\o{%s}%d'|perldiag/"'%s' resolved to '\o{%s}%d'">
 
 =item *
 
-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.
-
-This breaks a few XS modules by allowing copy-on-write scalars to go
-through code paths that never encountered them before.
-
-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 *
-
-Copy-on-write no longer uses the SvFAKE and SvREADONLY flags.  Hence,
-SvREADONLY indicates a true read-only SV.
-
-Use the SvIsCOW macro (as before) to identify a copy-on-write scalar.
+L<'Trailing white-space in a charnames alias definition is deprecated'|perldiag/"Trailing white-space in a charnames alias definition is deprecated">
 
 =item *
 
-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.
-
-The previous behaviour can still be enabled by running F<Configure> with
-B<-Accflags=-DPERL_SAWAMPERSAND>.
+L<'A sequence of multiple spaces in a charnames alias definition is deprecated'|perldiag/"A sequence of multiple spaces in a charnames alias definition is deprecated">
 
 =item *
 
-PL_glob_index is gone.
+L<'Passing malformed UTF-8 to "%s" is deprecated'|perldiag/"Passing malformed UTF-8 to "%s" is deprecated">
 
 =back
 
-=head1 Selected Bug Fixes
+=head1 Testing
 
 =over 4
 
 =item *
 
-C<sort {undef} ...> under fatal warnings no longer crashes.  It started
-crashing in Perl 5.16.
-
-=item *
-
-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.
+Many more of the core's tests now have descriptions.
 
 =item *
 
-Numerous memory leaks have been fixed, mostly involving fatal warnings and
-syntax errors.
+Thread stress-tests now adapt to the speed of the machine running the tests,
+thus reducing the incidence of false failures.
 
-=item *
+=back
 
-Lexical constants (C<my sub answer () { 42 }>) no longer cause double
-frees.
+=head1 Platform Support
 
-=item *
+=head2 Discontinued Platforms
 
-Constant subroutine redefinition warns by default, but lexical constants
-were accidentally exempt from default warnings.  This has been corrected.
+=over 4
 
-=item *
+=item Rhapsody
 
-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].
+Support for Rhapsody has been removed.
 
-=item *
+=back
 
-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].
+=head2 Platform-Specific Notes
 
-=item *
+=over 4
 
-Several bugs involving C<local *ISA> and C<local *Foo::> causing stale
-MRO caches have been fixed.  
+=item Windows
 
-=item *
+Perl can now be built using Microsoft's Visual C++ 2012 compiler by specifying
+CCTYPE=MSVC110 (or MSVC110FREE if you are using the free Express edition for
+Windows Desktop) in F<win32/Makefile>.
 
-Defining a subroutine when its typeglob has been aliased no longer results
-in stale method caches.  This bug was introduced in Perl 5.10.
+=item Haiku
 
-=item *
+Perl should now work out of the box on Haiku R1 Alpha 4.
 
-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.
+=back
 
-=item *
+=head1 Internal Changes
 
-Under some circumstances, C<local *method=...> would fail to reset method
-caches upon scope exit.
+=over 4
 
 =item *
 
-C</[.foo.]/> is no longer an error, but produces a warning (as before) and
-is treated as C</[.fo]/> [perl #115818].
-
-=item *
+A synonym for the misleadingly named C<av_len()> has been created:
+C<av_top()>.  Both of these return the number of the highest index in
+the array, not the number of elements it contains.
 
-C<goto $tied_var> now calls FETCH before deciding what type of goto
-(subroutine or label) this is.
+=back
 
-=item *
+=head1 Selected Bug Fixes
 
-Renaming packages through glob assignment
-(C<*Foo:: = *Bar::; *Bar:: = *Baz::>) in combination with C<m?...?> and
-C<reset> no longer makes threaded builds crash.
+=over 4
 
 =item *
 
-An earlier release in the 5.17.x series could crash if user code prevented
-_charnames from loading via C<$INC{'_charnames.pm'}++>.
+A bug in the core typemap caused any C types that map to the T_BOOL core
+typemap entry to not be set, updated, or modified when the T_BOOL variable was
+used in an OUTPUT: section with an exception for RETVAL. T_BOOL in an INPUT:
+section was not affected. Using a T_BOOL return type for an XSUB (RETVAL)
+was not affected. A side effect of fixing this bug is, if a T_BOOL is specified
+in the OUTPUT: section (which previous did nothing to the SV), and a read only
+SV (literal) is passed to the XSUB, croaks like "Modification of a read-only
+value attempted" will happen. [perl #115796]
 
 =item *
 
-A number of bugs related to hash assignment have been fixed:
-
-=over 8
+On many platforms, providing a directory name as the script name caused perl
+to do nothing and report success.  It should now universally report an error
+and exit nonzero. [perl #61362]
 
-=item -
-
-The expression C<scalar(%h = (1, 1, 1, 1))> now returns C<4>, not C<2>.
-
-=item -
+=back
 
-Perl now issues the same warning on C<($s, %h) = (1, {})> as it does for
-C<(%h) = ({})>, "Reference found where even-sized list expected".
+=head1 Known Problems
 
-=item -
+=over 4
 
-The return value of C<%h = (1, 1, 1)> in list context was wrong.
+=item *
 
-=item -
+Perl 5.17.7 introduced a new internal copy-on-write mechanism, in the
+interests of speed.  An flaw in the implementation means that some regexp
+matches which previously completed very fast, without invoking the full
+regexp engine, now run much slower than before.  We expect this performance
+problem to be resolved before 5.18.0 is released.
 
-A number of additional edge cases in list assignment to hashes were
-corrected. For more details see commit 23b7025ebc.
+=item *
 
-=back
+The C<POSIX> module may yield test failures when building on a ZFS
+filesystem under FreeBSD.
 
 =back
 
 =head1 Acknowledgements
 
-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
+Perl 5.17.8 represents approximately 5 weeks of development since Perl 5.17.7
+and contains approximately 18,000 lines of changes across 280 files from 24
 authors.
 
 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:
-
-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.
+improvements that became Perl 5.17.8:
+
+Aaron Crane, Andy Dougherty, Augustina Blair, Chris 'BinGOs' Williams, Craig
+A. Berry, Daniel Dragan, Dave Rolsky, David Mitchell, Eric Brine, Father
+Chrysostomos, H.Merijn Brand, James E Keenan, Jerry D. Hedden, Jesse Luehrs,
+Karl Williamson, Matthew Horsfall, Nicholas Clark, Renee Baecker, Ricardo
+Signes, Shlomi Fish, Steffen Müller, Steve Hay, Steven Schubiger, Tony Cook.
 
 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