This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for f9d9e965
[perl5.git] / pod / perldelta.pod
index bb8dd38..1c20e7f 100644 (file)
@@ -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.21.3
+perldelta - what is new for perl v5.21.4
 
 =head1 DESCRIPTION
 
-This document describes differences between the 5.21.2 release and the 5.21.3
+This document describes differences between the 5.21.3 release and the 5.21.4
 release.
 
-If you are upgrading from an earlier release such as 5.21.1, first read
-L<perl5212delta>, which describes differences between 5.21.1 and 5.21.2.
+If you are upgrading from an earlier release such as 5.21.2, first read
+L<perl5213delta>, which describes differences between 5.21.2 and 5.21.3.
 
 =head1 Notice
 
@@ -27,6 +27,15 @@ here, but most should go in the L</Performance Enhancements> section.
 
 [ List each enhancement as a =head2 entry ]
 
+=head2 Infinity and NaN (not-a-number) handling improved
+
+Floating point values are able to hold the special values infinity
+(also -infinity), and NaN (not-a-number).  Now we more robustly recognize
+and propagate the value in computations, and on output normalize them
+to C<Inf> and C<NaN>.
+
+See also the L<POSIX> enhancements.
+
 =head1 Security
 
 XXX Any security-related notices go here.  In particular, any security
@@ -45,11 +54,22 @@ XXX For a release on a stable branch, this section aspires to be:
 
 [ List each incompatible change as a =head2 entry ]
 
-=head2 S<C<use UNIVERSAL '...'>> is now a fatal error
+=head2 Changes to the C<*> prototype
+
+The C<*> character in a subroutine's prototype used to allow barewords
+to take precedence over most, but not all subroutines.  It was never
+consistent and exhibited buggy behaviour.
 
-Importing functions from C<UNIVERSAL> has been deprecated since v5.12, and
-is now a fatal error.  S<C<"use UNIVERSAL">> without any arguments is still
-allowed.
+Now it has been changed, so subroutines always take precedence over
+barewords, which brings it into conformity with similarly prototyped
+built-in functions:
+
+    sub splat($) { ... }
+    sub foo { ... }
+    splat(foo); # now always splat(foo())
+    splat(bar); # still splat('bar') as before
+    close(foo); # close(foo())
+    close(bar); # close('bar')
 
 =head1 Deprecations
 
@@ -95,7 +115,18 @@ There may well be none in a stable release.
 
 =item *
 
-XXX
+Subroutines with an empty prototype and bodies containing just C<undef> are
+now eligible for inlining.  [perl #122728]
+
+=item *
+
+Subroutines in packages no longer need to carry typeglobs around with them.
+Declaring a subroutine will now put a simple sub reference in the stash if
+possible, saving memory.  The typeglobs still notionally exist, so
+accessing them will cause the subroutine reference to be upgraded to a
+typeglob.  This optimisation does not currently apply to XSUBs or exported
+subroutines, and method calls will undo it, since they cache things in
+typeglobs.  [perl #120441]
 
 =back
 
@@ -125,45 +156,86 @@ XXX
 
 =item *
 
-L<B::Debug> has been upgraded from version 1.19 to 1.21
+L<B> has been upgraded from version 1.50 to 1.51.
+
+It provides a new C<B::safename> function, based on the existing
+C<< B::GV->SAFENAME >>, that converts "\cOPEN" to "^OPEN".
+
+=item *
+
+L<B::Concise> has been upgraded from version 0.992 to 0.993.
 
 =item *
 
-L<Config::Perl::V> has been upgraded from version 0.20 to 0.22.
+L<B::Deparse> has been upgraded from version 1.27 to 1.28.
+
+It now deparses C<our(I<LIST>)> and typed lexical (C<my Dog $spot>)
+correctly.
 
 =item *
 
-L<CPAN::Meta> has been upgraded from version 2.141520 to 2.142060.
+L<CPAN::Meta::Requirements> has been upgraded from version 2.126 to 2.128.
 
 =item *
 
-L<CPAN::Meta::Requirements> has been upgraded from version 2.125 to 2.126.
+L<ExtUtils::CBuilder> has been upgraded from version 0.280216 to 0.280219.
+[perl #122675].
 
 =item *
 
-L<ExtUtils::Manifest> has been upgraded from version 1.64 to 1.65.
+L<ExtUtils::Manifest> has been upgraded from version 1.65 to 1.66.
+[perl #122415].
+
+=item *
 
-The MANIFEST is now opened with C<:raw>, to prevent C<CRLF>s leaking in.
+L<ExtUtils::ParseXS>:  Documentation has been added to
+F<ExtUtils-ParseXS/lib/perlxs.pod> concerning handling of locales when writing
+XS code.
 
 =item *
 
-L<perl5db.pl> has been upgraded from version 1.45 to 1.46.
+L<File::Find> has been upgraded from version 1.27 to 1.28.
 
-Fixed the scope level handling of the debugger's C<y> command.
+C<find()> and C<finddepth()> will now warn if passed inappropriate or
+misspelled options.
 
 =item *
 
-L<POSIX> has been upgraded from version 1.41 to 1.42.
+L<Getopt::Std> has been upgraded from version 1.10 to 1.11.
+
+=item *
+
+L<HTTP::Tiny> has been upgraded from version 0.047 to 0.048.
+
+=item *
+
+L<Module::CoreList> has been upgraded from version 5.021003 to 5.021004.
+
+=item *
+
+L<POSIX> has been upgraded from version 1.42 to 1.43.
+
+The C99 math functions and constants (for example acosh, round,
+M_E, M_PI) have been added.
+
+=item *
+
+L<Pod::Perldoc> has been upgraded from version 3.23 to 3.24.
+
+=item *
 
-Replaced the thread-unsafe code used to prevent duplicate warning
-messages for using the isxxx() functions.  [perl #122476]
+Scalar-List-Utils has been upgraded from version 1.40 to 1.41.
 
 =item *
 
-L<Socket> has been upgraded from version 2.014 to 2.015.
+L<constant> has been upgraded from version 1.31 to 1.32.
 
-Test suite updates, particularly useful for Solaris and cygwin, and
-a slight change to the pattern used for IPv4 address matching.
+It now accepts fully-qualified constant names, allowing constants to be
+defined in packages other than the caller.
+
+=item *
+
+L<threads> has been upgraded from version 1.95 to 1.96.
 
 =back
 
@@ -204,6 +276,11 @@ section.
 
 XXX Description of the change here
 
+=item *
+
+L<perlsyn>: An ambiguity in the documentation of the Ellipsis statement has
+been corrected. [perl #122661]
+
 =back
 
 =head1 Diagnostics
@@ -236,60 +313,45 @@ XXX L<message|perldiag/"message">
 
 =item *
 
-L<Hexadecimal float: exponent overflow|perldiag/"Hexadecimal float: exponent overflow">
+XXX L<message|perldiag/"message">
 
-(W overflow) The hexadecimal floating point has larger exponent
-than the floating point supports.
+=back
 
-=item *
+=head2 Changes to Existing Diagnostics
 
-L<Hexadecimal float: exponent underflow|perldiag/"Hexadecimal float: exponent underflow">
+XXX Changes (i.e. rewording) of diagnostic messages go here
 
-(W overflow) The hexadecimal floating point has smaller exponent
-than the floating point supports.
+=over 4
 
 =item *
 
-L<Hexadecimal float: internal error|perldiag/"Hexadecimal float: internal error">
-
-(F) Something went horribly bad in hexadecimal float handling.
+XXX Describe change here
 
-=item *
+=back
 
-L<Hexadecimal float: mantissa overflow|perldiag/"Hexadecimal float: mantissa overflow">
+=head2 Diagnostic Removals
 
-(W overflow) The hexadecimal floating point literal had more bits in
-the mantissa (the part between the 0x and the exponent, also known as
-the fraction or the significand) than the floating point supports.
+=over 4
 
 =item *
 
-L<Hexadecimal float: precision loss|perldiag/"Hexadecimal float: precision loss">
+"Constant is not a FOO reference"
 
-(W overflow) The hexadecimal floating point had internally more
-digits than could be output.  This can be caused by unsupported
-long double formats, or by 64-bit integers not being available
-(needed to retrieve the digits under some configurations).
+Compile-time checking of constant dereferencing (e.g.,
+C<< my_constant->() >>) has been removed, since it was not taking
+overloading into account.  [perl #69456] [perl #122607]
 
 =item *
 
-L<Hexadecimal float: unsupported long double format|perldiag/"Hexadecimal float: unsupported long double format">
-
-(F) You have configured Perl to use long doubles but
-the internals of the long double format are unknown,
-therefore the hexadecimal float output is impossible.
-
-=back
-
-=head2 Changes to Existing Diagnostics
-
-XXX Changes (i.e. rewording) of diagnostic messages go here
-
-=over 4
+The warning "Ambiguous use of -foo resolved as -&foo()" has been removed.
+There is actually no ambiguity here, and this impedes the use of negated
+constants; e.g., C<-Inf>.
 
 =item *
 
-XXX Describe change here
+The little-known C<my Class $var> syntax (see L<fields> and L<attributes>)
+could get confused in the scope of C<use utf8> if C<Class> were a constant
+whose value contained Latin-1 characters.
 
 =back
 
@@ -325,7 +387,7 @@ L</Platform Support> section, instead.
 
 =item *
 
-Internal handling of floating point values has been improved.
+XXX
 
 =back
 
@@ -408,11 +470,32 @@ well.
 
 =item *
 
-Added L<perlapi/sync_locale>.
-Changing the program's locale should be avoided by XS code.  Nevertheless,
-certain non-Perl libraries called from XS, such as C<Gtk> do so.  When this
-happens, Perl needs to be told that the locale has changed.  Use this function
-to do so, before returning to Perl.
+C<save_re_context> no longer does anything and has been moved to
+F<mathoms.c>.
+
+=item *
+
+C<cv_name> is a new API function that can be passed a CV or GV.  It returns
+an SV containing the name of the subroutine for use in diagnostics.
+[perl #116735] [perl #120441]
+
+=item *
+
+C<cv_set_call_checker_flags> is a new API function that works like
+C<cv_set_call_checker>, except that it allows the caller to specify whether
+the call checker requires a full GV for reporting the subroutine's name, or
+whether it could be passed a CV instead.  Whatever value is passed will be
+acceptable to C<cv_name>.  C<cv_set_call_checker> guarantees there will be
+a GV, but it may have to create one on the fly, which is inefficient.
+[perl #116735]
+
+=item *
+
+C<CvGV> (which is not part of the API) is now a more complex macro, which
+may call a function and reify a GV.  For those cases where is has been used
+as a boolean, C<CvHASGV> has been added, which will return true for CVs
+that notionally have GVs, but without reifying the GV.  C<CvGV> also
+returns a GV now for lexical subs.  [perl #120441]
 
 =back
 
@@ -427,15 +510,129 @@ files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
 
 =item *
 
-Failing to compile C<use Foo> in an eval could leave a spurious
-C<BEGIN> subroutine definition, which would produce a "Subroutine
-BEGIN redefined" warning on the next use of C<use>, or other C<BEGIN>
-block.  [perl #122107]
+XXX
+
+=item *
+
+Constant dereferencing now works correctly for typeglob constants.
+Previously the glob was stringified and its name looked up.  Now the glob
+itself is used.  [perl #69456]
+
+=item *
+
+When parsing a funny character ($ @ % &) followed by braces, the parser no
+longer tries to guess whether it is a block or a hash constructor (causing
+a syntax error when it guesses the latter), since it can only be a block.
+
+=item *
+
+C<undef $reference> now frees the referent immediately, instead of hanging
+on to it until the next statement.  [perl #122556]
+
+=item *
+
+Various cases where the name of a sub is used (autoload, overloading, error
+messages) used to crash for lexical subs, but have been fixed.
+
+=item *
+
+Bareword lookup now tries to avoid vivifying packages if it turns out the
+bareword is not going to be a subroutine name.
+
+=item *
+
+Compilation of anonymous constants (e.g., C<sub () { 3 }>) no longer
+deletes any subroutine named C<__ANON__> in the current package.  Not only
+was C<*__ANON__{CODE}> cleared, but there was a memory leak, too.  This bug
+goes back to perl 5.8.0. 
+
+=item *
+
+Stub declarations like C<sub f;> and C<sub f ();> no longer wipe out
+constants of the same name declared by C<use constant>.  This bug was
+introduced in perl 5.10.0.
+
+=item *
+
+Under some conditions a warning raised in compilation of regular
+expression patterns could be displayed multiple times.  This is now
+fixed.
+
+=item *
+
+C<qr/[\N{named sequence}]/> now works properly in many instances.  Some
+names known to C<\N{...}> refer to a sequence of multiple characters,
+instead of the usual single character.  Bracketed character classes
+generally only match single characters, but now special handling has
+been added so that they can match named sequences, but not if the class
+is inverted or the sequence is specified as the beginning or end of a
+range.  In these cases, the only behavior change from before is a slight
+rewording of the fatal error message given when this class is part of a
+C<?[...])> construct.  When the C<[...]> stands alone, the same
+non-fatal warning as before is raised, and only the first character in
+the sequence is used, again just as before.
+
+=item *
+
+Tainted constants evaluated at compile time no longer cause unrelated
+statements to become tainted.  [perl #122669]
+
+=item *
+
+C<open $$fh, ...>, which vivifies a handle with a name like "main::_GEN_0",
+was not giving the handle the right reference count, so a double free could
+happen.
+
+=item *
+
+When deciding that a bareword was a method name, the parser would get
+confused if an "our" sub with the same name existed, and look up the method
+in the package of the "our" sub, instead of the package of the invocant.
+
+=item *
+
+The parser no longer gets confused by C<\U=> within a double-quoted string.
+It used to roduce a syntax error, but now compiles it correctly.
+[perl #80368]
+
+=item *
+
+It has always been the intention for the C<-B> and C<-T> file test
+operators to treat UTF-8 encoded files as text.
+(L<perlfunc|perlfunc/-X FILEHANDLE> has been updated to say this.)
+Previously, it was possible for some files to be considered UTF-8 that
+actually weren't valid UTF-8.  This is now fixed.  The operators now
+work on EBCDIC platforms as well.
+
+=item *
+
+Under some conditions warning messages raised during regular expression
+pattern compilation were being output more than once.  This has now been
+fixed.
+
+=item *
+
+A regression has been fixed that was introduced in v5.20.0 (fixed in
+v5.20.1 as well as here) in which a UTF-8 encoded regular expression
+pattern that contains a single ASCII lowercase letter does not match its
+uppercase counterpart. [perl #122655]
+
+=item *
+
+Constant folding could incorrectly suppress warnings if lexical warnings
+(C<use warnings> or C<no warnings>) were not in effect and C<$^W> were
+false at compile time and true at run time.
+
+=item *
+
+Loading UTF8 tables during a regular expression match could cause assertion
+failures under debugging builds if the previous match used the very same
+regular expression.  [perl #122747]
 
 =item *
 
-C<method { BLOCK } ARGS> syntax now correctly parses the arguments if they
-begin with an opening brace.  [perl #46947]
+Thread cloning used to work incorrectly for lexical subs, possibly causing
+crashes or double frees on exit.
 
 =back
 
@@ -475,7 +672,7 @@ here.
 
 XXX Generate this with:
 
-  perl Porting/acknowledgements.pl v5.21.2..HEAD
+  perl Porting/acknowledgements.pl v5.21.3..HEAD
 
 =head1 Reporting Bugs