This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for #122829 / 00e40766a
[perl5.git] / pod / perldelta.pod
index f18c7e8..3ac4e90 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.5
+perldelta - what is new for perl v5.21.6
 
 =head1 DESCRIPTION
 
-This document describes differences between the 5.21.4 release and the 5.21.5
+This document describes differences between the 5.21.5 release and the 5.21.6
 release.
 
-If you are upgrading from an earlier release such as 5.21.3, first read
-L<perl5214delta>, which describes differences between 5.21.3 and 5.21.4.
+If you are upgrading from an earlier release such as 5.21.4, first read
+L<perl5215delta>, which describes differences between 5.21.4 and 5.21.5.
 
 =head1 Notice
 
@@ -27,35 +27,27 @@ here, but most should go in the L</Performance Enhancements> section.
 
 [ List each enhancement as a =head2 entry ]
 
-=head2 New double-diamond operator
+=head2 List form of pipe open implemented for Win32
 
-C<<< <<>>> >>> is like C<< <> >> but uses three-argument C<open> to open
-each file in @ARGV.  So each element of @ARGV is an actual file name, and
-"|foo" won't be treated as a pipe open.
+The list form of pipe:
 
-=head2 Perl now supports POSIX 2008 locale currency additions.
+  open my $fh, "-|", "program", @arguments;
 
-On platforms that are able to handle POSIX.1-2008, the
-hash returned by
-L<C<POSIX::localeconv()>|perllocale/The localeconv function>
-includes the international currency fields added by that version of the
-POSIX standard.  These are
-C<int_n_cs_precedes>,
-C<int_n_sep_by_space>,
-C<int_n_sign_posn>,
-C<int_p_cs_precedes>,
-C<int_p_sep_by_space>,
-and
-C<int_p_sign_posn>.
+is now implemented on Win32.  It has the same limitations as C<system
+LIST> on Win32, since the Win32 API doesn't accept program arguments
+as a list.
 
-=head1 Security
+=head2 Assignment to list repetition
+
+C<(...) x ...> can now be used within a list that is assigned to, as long
+as the left-hand side is a valid lvalue.  This allows C<(undef,undef,$foo)
+= that_function()> to be written as C<((undef)x2, $foo) = that_function()>.
 
-=head2 Perl is now compiled with -fstack-protector-strong if available
+=head1 Security
 
-Perl has been compiled with the anti-stack-smashing option
-C<-fstack-protector> since 5.10.1.  Now Perl uses the newer variant
-called C<-fstack-protector-strong>, if available.  (This was added
-already in 5.21.4.)
+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 ]
 
@@ -100,20 +92,18 @@ as an updated module in the L</Modules and Pragmata> section.
 
 =back
 
-=head2 Use of multiple /x regexp modifiers
+[ List each other deprecation as a =head2 entry ]
 
-It is now deprecated to say something like any of the following:
+=head2 Use of non-graphic characters in single-character variable names
 
-    qr/foo/xx;
-    /(?xax:foo)/;
-    use re qw(/amxx);
-
-That is, now C<x> should only occur once in any string of contiguous
-regular expression pattern modifiers.  We do not believe there are any
-occurrences of this in all of CPAN.  This is in preparation for a future
-Perl release having C</xx> mean to allow white-space for readability in
-bracketed character classes (those enclosed in square brackets:
-C<[...]>).
+The syntax for single-character variable names is more lenient than
+for longer variable names, allowing the one-character name to be a
+punctuation character or even invisible (a non-graphic).  Perl v5.20
+deprecated the ASCII-range controls as such a name.  Now, all
+non-graphic characters that formerly were allowed are deprecated.
+The practical effect of this occurs only when not under C<S<"use
+utf8">>, and affects just the C1 controls (code points 0x80 through
+0xFF), NO-BREAK SPACE, and SOFT HYPHEN.
 
 =head1 Performance Enhancements
 
@@ -126,14 +116,11 @@ There may well be none in a stable release.
 
 =item *
 
-C<length> is up to 20% faster for non-magical/non-tied scalars containing a
-string if it is a non-utf8 string or if C<use bytes;> is in scope.
-
-=item *
-
-Non-magical/non-tied scalars that contain only a floating point value and are
-on most Perl builds with 64 bit integers now use 8-32 less bytes of memory
-depending on OS.
+C<(...)x1>, C<("constant")x0> and C<($scalar)x0> are now optimised in list
+context.  If the right-hand argument is a constant 1, the repetition
+operator disappears.  If the right-hand argument is a constant 0, the whole
+expressions is optimised to the empty list, so long as the left-hand
+argument is a simple scalar or constant.  C<(foo())x0> is not optimised.
 
 =back
 
@@ -163,57 +150,13 @@ XXX
 
 =item *
 
-L<attributes> has been upgraded from version 0.23 to 0.24.
+L<IO::Socket> has been upgraded from version 1.37 to 1.38.
 
-Avoid reading beyond the end of a buffer. [perl #122629]
+Document the limitations of the isconnected() method.  [perl #123096]
 
 =item *
 
-L<B::Deparse> has been upgraded from version 1.28 to 1.29.
-
-Parenthesised arrays in lists passed to C<\> are now correctly deparsed
-with parentheses (e.g., C<\(@a, (@b), @c)> now retains the parentheses
-around @b), this preserving the flattening behaviour of referenced
-parenthesised arrays.  Formerly, it only worked for one array: C<\(@a)>.
-
-C<local our> is now deparsed correctly, with the C<our> included.
-
-C<for($foo; !$bar; $baz) {...}> was deparsed without the C<!> (or C<not>).
-This has been fixed.
-
-Core keywords that conflict with lexical subroutines are now deparsed with
-the C<CORE::> prefix.
-
-C<foreach state $x (...) {...}> now deparses correctly with C<state> and
-not C<my>.
-
-C<our @array = split(...)> now deparses correctly with C<our> in those
-cases where the assignment is optimised away.
-
-=item *
-
-L<DynaLoader> has been upgraded from version 1.26 to 1.27.
-
-Remove dl_nonlazy global if unused in Dynaloader. [perl #122926]
-
-=item *
-
-L<Fcntl> has been upgraded from version 1.12 to 1.13.
-
-Add support for the Linux pipe buffer size fcntl() commands.
-
-=item *
-
-L<Module::CoreList> has been upgraded from version 5.20140920 to 5.20141020.
-
-Updated to cover the latest releases of Perl.
-
-=item *
-
-L<XSLoader> has been upgraded from version 0.17 to 0.18.
-
-Allow XSLoader to load modules from a different namespace.
-[perl #122455]
+L<DynaLoader> has been upgraded from version 1.27 to 1.28.
 
 =back
 
@@ -246,18 +189,14 @@ 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<XXX>
+=head3 L<perldata/Identifier parsing>
 
 =over 4
 
 =item *
 
-Clarifications have been added to L<perlrecharclass/Character Ranges>
-to the effect that Perl guarantees that C<[A-Z]>, C<[a-z]>, C<[0-9]> and
-any subranges thereof in regular expression bracketed character classes
-are guaranteed to match exactly what a naive English speaker would
-expect them to match, even on platforms (such as EBCDIC) where special
-handling is required to accomplish this.
+The syntax of single-character variable names has been brought
+up-to-date and more fully explained.
 
 =back
 
@@ -291,7 +230,24 @@ XXX L<message|perldiag/"message">
 
 =item *
 
-XXX L<message|perldiag/"message">
+L<Use of literal non-graphic characters in variable names is deprecated|perldiag/"Use of literal non-graphic characters in variable names is deprecated">
+
+=item *
+
+A new C<locale> warning category has been created, with the following warning
+messages currently in it:
+
+=over 4
+
+=item *
+
+L<Locale '%s' may not work well.%s|perldiag/Locale '%s' may not work well.%s>
+
+=item *
+
+L<Can't do %s("%s") on non-UTF-8 locale; resolved to "%s".|perldiag/Can't do %s("%s") on non-UTF-8 locale; resolved to "%s".>
+
+=back
 
 =back
 
@@ -303,8 +259,11 @@ XXX Changes (i.e. rewording) of diagnostic messages go here
 
 =item *
 
-'"my" variable &foo::bar can't be in a package' has been reworded to say
-'subroutine' instead of 'variable'.
+L<Quantifier unexpected on zero-length expression in regex m/%s/|perldiag/"Quantifier unexpected on zero-length expression in regex m/%s/">.
+
+This message has had the S<"<-- HERE"> marker removed, as it was always
+placed at the end of the regular expression, regardless of where the
+problem actually occurred.  [perl #122680]
 
 =back
 
@@ -340,7 +299,7 @@ L</Platform Support> section, instead.
 
 =item *
 
-XXX
+F<Configure> with C<-Dmksymlinks> should now be faster. [perl #122002]
 
 =back
 
@@ -405,15 +364,28 @@ L</Modules and Pragmata> section.
 
 =over 4
 
-=item EBCDIC
+=item XXX-some-platform
+
+XXX
+
+=back
+
+=head3 Win32
+
+=over 4
+
+=item *
+
+In the experimental C<:win32> layer, a crash in C<open> was fixed. Also
+opening C</dev/null>, which works the Win32 Perl's normal C<:unix> layer, was
+implemented for C<:win32>.
+L<[perl #122224]|https://rt.perl.org/Ticket/Display.html?id=122224>
 
-Special handling is required on EBCDIC platforms to get C<qr/[i-j]/> to
-match only C<"i"> and C<"j">, since there are 7 characters between the
-code points for C<"i"> and C<"j">.  This special handling had only been
-invoked when both ends of the range are literals.  Now it is also
-invoked if any of the C<\N{...}> forms for specifying a character by
-name or Unicode code point is used instead of a literal.  See
-L<perlrecharclass/Character Ranges>.
+=item *
+
+A new makefile option, C<USE_LONG_DOUBLE>, has been added to the Windows
+dmake makefile for gcc builds only.  Set this to "define" if you want perl to
+use long doubles to give more accuracy and range for floating point numbers.
 
 =back
 
@@ -429,36 +401,19 @@ well.
 
 =item *
 
-SVs of type SVt_NV are now bodyless when a build configure and platform allow
-it, specifically C<sizeof(NV) <= sizeof(IV)>. The bodyless trick is the same one
-as for IVs since 5.9.2, but for NVs, unlike IVs, is not guarenteed on all
-platforms and build configurations.
-
-=item *
-
-The C<$DB::single>, C<$DB::signal> and C<$DB::trace> now have set and
-get magic that stores their values as IVs and those IVs are used when
-testing their values in C<pp_dbstate>.  This prevents perl from
-recursing infinity if an overloaded object is assigned to any of those
-variables. [perl #122445]
-
-=item *
-
-C<Perl_tmps_grow> which is marked as public API but undocumented has been
-removed from public API. If you use C<EXTEND_MORTAL> macro in your XS code to
-preextend the mortal stack, you are unaffected by this change.
+C<screaminstr> has been removed. Although marked as public API, it is
+undocumented and has no usage in modern perl versions on CPAN Grep. Calling it
+has been fatal since 5.17.0.
 
 =item *
 
-C<cv_name>, which was introduced in 5.21.4, has been changed incompatibly.
-It now has a flags field that allows the caller to specify whether the name
-should be fully qualified.  See L<perlapi/cv_name>.
+C<newDEFSVOP>, C<block_start>, C<block_end> and C<intro_my> have been added
+to the API.
 
 =item *
 
-Internally Perl no longer uses the C<SVs_PADMY> flag.  C<SvPADMY()> now
-returns a true value for anything not marked PADTMP.  C<SVs_PADMY> is now
-defined as 0.
+The internal C<convert> function in F<op.c> has been renamed
+C<op_convert_list> and added to the API.
 
 =back
 
@@ -473,47 +428,63 @@ files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
 
 =item *
 
-Locking and unlocking values via L<Hash::Util> or C<Internals::SvREADONLY>
-no longer has any affect on values that are read-only to begin.  Unlocking
-such values could result in crashes, hangs or other erratic behaviour.
+fchmod() and futimes() now set C<$!> when they fail due to being
+passed a closed file handle.  [perl #122703]
 
 =item *
 
-The internal C<looks_like_number> function (which L<Scalar::Util> provides
-access to) began erroneously to return true for "-e1" in 5.21.4, affecting
-also C<-'-e1'>.  This has been fixed.
+Perl now comes with a corrected Unicode 7.0 for the erratum issued on
+October 21, 2014 (see L<http://www.unicode.org/errata/#current_errata>),
+dealing with glyph shaping in Arabic.
 
 =item *
 
-The flip-flop operator (C<..> in scalar context) would return the same
-scalar each time, unles the containing subroutine was called recursively.
-Now it always returns a new scalar.  [perl #122829]
+op_free() no longer crashes due to a stack overflow when freeing a
+deeply recursive op tree. [perl #108276]
 
 =item *
 
-Some unterminated C<(?(...)...)> constructs in regular expressions would
-either crash or give erroneous error messages.  C</(?(1)/> is one such
-example.
+scalarvoid() would crash due to a stack overflow when processing a
+deeply recursive op tree. [perl #108276]
 
 =item *
 
-C<pack "w", $tied> no longer calls FETCH twice.
+In Perl 5.20.0, C<$^N> accidentally had the internal UTF8 flag turned off
+if accessed from a code block within a regular expression, effectively
+UTF8-encoding the value.  This has been fixed.  [perl #123135]
 
 =item *
 
-List assignments like C<($x, $z) = (1, $y)> now work correctly if $x and $y
-have been aliased by C<foreach>.
+A failed C<semctl> call no longer overwrites existing items on the stack,
+causing C<(semctl(-1,0,0,0))[0]> to give an "uninitialized" warning.
 
 =item *
 
-Some patterns including code blocks with syntax errors, such as
-C</ (?{(^{})/>, would hang or fail assertions on debugging builds.  Now
-they produce errors.
+C<else{foo()}> with no space before C<foo> is now better at assigning the
+right line number to that statement.  [perl #122695]
 
 =item *
 
-An assertion failure when parsing C<sort> with debugging enabled has been
-fixed.  [perl #122771]
+Sometimes the assignment in C<@array = split> gets optimised and C<split>
+itself writes directly to the array.  This caused a bug, preventing this
+assignment from being used in lvalue context.  So
+C<(@a=split//,"foo")=bar()> was an error.  (This bug probably goes back to
+Perl 3, when the optimisation was added.)  This optimisation, and the bug,
+started to happen in more cases in 5.21.5.  It has now been fixed.
+[perl #123057]
+
+=item *
+
+When argument lists that fail the checks installed by subroutine
+signatures, the resulting error messages now give the file and line number
+of the caller, not of the called subroutine.  [perl #121374]
+
+=item *
+
+Flip-flop operators (C<..> and C<...> in scalar context) used to maintain
+a separate state for each recursion level (the number of times the
+enclosing sub was called recursively), contrary to the documentation.  Now
+each closure has one internal state for each flip-flop.  [perl #122829]
 
 =back
 
@@ -529,7 +500,10 @@ platform specific bugs also go here.
 
 =item *
 
-XXX
+Starting in 5.21.6, accessing L<perlapi/CvPADLIST> in an XSUB is forbidden.
+CvPADLIST has be reused for a different internal purpose for XSUBs. Guard all
+CvPADLIST expressions with C<CvISXSUB()> if your code doesn't already block
+XSUB CV*s from going through optree CV* expecting code.
 
 =back
 
@@ -539,8 +513,15 @@ XXX
 
 =item *
 
-XXX Add anything here that we forgot to add, or were mistaken about, in
-the perldelta of a previous release.
+Due to a mistake in the string-copying logic, copying the value of a state
+variable could instead steal the value and undefine the variable.  This
+bug, introduced in 5.20, would happen mostly for long strings (1250 chars
+or more), but could happen for any strings under builds with copy-on-write
+disabled.  [perl #123029]
+
+This bug was actually fixed in 5.21.5, but it was not until after that
+release that this bug, and the fact that it had been fixed, were
+discovered.
 
 =back
 
@@ -553,7 +534,7 @@ here.
 
 XXX Generate this with:
 
-  perl Porting/acknowledgements.pl v5.21.4..HEAD
+  perl Porting/acknowledgements.pl v5.21.5..HEAD
 
 =head1 Reporting Bugs