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 e4fbc83..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,63 +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 Aliasing via reference
+  open my $fh, "-|", "program", @arguments;
 
-Variables and subroutines can now be aliased by assigning to a reference:
+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.
 
-    \$c = \$d;
-    \&x = \&y;
+=head2 Assignment to list repetition
 
-Or by using a backslash before a C<foreach> iterator variable, which is
-perhaps the most useful idiom this feature provides:
-
-    foreach \%hash (@array_of_hash_refs) { ... }
-
-This feature is experimental and must be enabled via C<use feature
-'refaliasing'>.  It will warn unless the C<experimental::refaliasing>
-warnings category is disabled.
-
-See L<perlref/Assigning to References>.
-
-=head2 Perl now supports POSIX 2008 locale currency additions.
-
-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>.
-
-=head2 Packing infinity or not-a-number into a character is now fatal.
-
-Before, when trying to pack infinity or not-a-number into a
-(signed) character, Perl would warn, and assumed you tried to
-pack C<< 0xFF >>; if you gave it as an argument to C<< chr >>,
-C<< U+FFFD >> was returned. 
-
-But now, all such actions (C<< pack >>, C<< chr >>, and C<< print '%c' >>)
-result in a fatal error.
+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()>.
 
 =head1 Security
 
-=head2 Perl is now compiled with -fstack-protector-strong if available
-
-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 ]
 
@@ -128,20 +92,18 @@ as an updated module in the L</Modules and Pragmata> section.
 
 =back
 
-=head2 Use of multiple /x regexp modifiers
-
-It is now deprecated to say something like any of the following:
+[ List each other deprecation as a =head2 entry ]
 
-    qr/foo/xx;
-    /(?xax:foo)/;
-    use re qw(/amxx);
+=head2 Use of non-graphic characters in single-character variable names
 
-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
 
@@ -154,40 +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.
-
-=item *
-
-In C<@array = split>, the assigment can be optimised away with C<split>
-writing directly to the array.  This optimisation was happening only for
-package arrays other than @_ and only
-sometimes.  Now this optimisation happens
-almost all the time.
-
-=item *
-
-C<join> is now subject to constant folding.  Moreover, C<join> with a
-scalar or constant for the separator and a single-item list to join is
-simplified to a stringification.  The separator doesn't even get evaluated.
-
-=item *
-
-C<qq(@array)> is implemented using two ops: a stringify op and a join op.
-If the qq contains nothing but a single array, the stringification is
-optimised away.
-
-=item *
-
-C<our $var> and C<our($s,@a,%h)> in void context are no longer evaluated at
-run time.  Even a whole sequence of C<our $foo;> statements will simply be
-skipped over.  The same applies to C<state> variables.
+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
 
@@ -217,83 +150,13 @@ XXX
 
 =item *
 
-L<attributes> has been upgraded from version 0.23 to 0.24.
-
-Avoid reading beyond the end of a buffer. [perl #122629]
-
-=item *
-
-L<B::Concise> has been upgraded from version 0.993 to 0.994.
-
-Null ops that are part of the execution chain are now given sequence
-numbers.
-
-Private flags for nulled ops are now dumped with mnemonics as they would be
-for the non-nulled counterparts.
-
-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.
+L<IO::Socket> has been upgraded from version 1.37 to 1.38.
 
-Add support for the Linux pipe buffer size fcntl() commands.
+Document the limitations of the isconnected() method.  [perl #123096]
 
 =item *
 
-L<File::Find> has been upgraded from version 1.28 to 1.29.
-
-Slightly faster module loading time.
-
-=item *
-
-L<Module::CoreList> has been upgraded from version 5.20140920 to 5.20141020.
-
-Updated to cover the latest releases of Perl.
-
-=item *
-
-The PathTools module collection has been upgraded from version 3.50 to 3.51.
-
-Slightly faster module loading time.
-
-=item *
-
-L<POSIX> has been upgraded from version 1.44 to 1.45.
-
-POSIX::tmpnam() now produces a deprecation warning.  [perl #122005]
-
-=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
 
@@ -326,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
 
@@ -361,29 +220,34 @@ and New Warnings
 
 =item *
 
-L<message|perldiag/"Cannot chr %f">
+XXX L<message|perldiag/"message">
 
-=item *
+=back
 
-L<message|perldiag/"Cannot compress %f in pack">
+=head3 New Warnings
+
+=over 4
 
 =item *
 
-L<message|perldiag/"Cannot pack %f with '%c'">
+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 *
 
-L<message|perldiag/"Cannot printf %f with '%c'">
+A new C<locale> warning category has been created, with the following warning
+messages currently in it:
 
-=back
+=over 4
 
-=head3 New Warnings
+=item *
 
-=over 4
+L<Locale '%s' may not work well.%s|perldiag/Locale '%s' may not work well.%s>
 
 =item *
 
-XXX L<message|perldiag/"message">
+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
 
@@ -395,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
 
@@ -432,7 +299,7 @@ L</Platform Support> section, instead.
 
 =item *
 
-XXX
+F<Configure> with C<-Dmksymlinks> should now be faster. [perl #122002]
 
 =back
 
@@ -450,10 +317,7 @@ that they represent may be covered elsewhere.
 
 =item *
 
-Some regular expression tests are written in such a way that they will
-run very slowly if certain optimizations break. These tests have been
-moved into new files, F<< t/re/speed.t >> and F<< t/re/speed_thr.t >>,
-and are run with a C<< watchdog() >>.
+XXX
 
 =back
 
@@ -500,76 +364,56 @@ L</Modules and Pragmata> section.
 
 =over 4
 
-=item EBCDIC
+=item XXX-some-platform
 
-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>.
+XXX
 
 =back
 
-=head1 Internal Changes
-
-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.
-
-[ List each change as a =item entry ]
+=head3 Win32
 
 =over 4
 
 =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.
+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>
 
 =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]
+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.
 
-=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.
+=back
 
-=item *
+=head1 Internal Changes
 
-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>.
+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.
 
-=item *
+[ List each change as a =item entry ]
 
-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.
+=over 4
 
 =item *
 
-The macros SETsv and SETsvUN have been removed. They were no longer used
-in the core since commit 6f1401dc2a, and have not been found present on
-CPAN.
+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 *
 
-The C<< SvFAKE >> bit (unused on HVs) got informally reserved by
-David Mitchell for future work on vtables.
+C<newDEFSVOP>, C<block_start>, C<block_end> and C<intro_my> have been added
+to the API.
 
 =item *
-The C<sv_catpvn_flags> function accepts C<SV_CATBYTES> and C<SV_CATUTF8>
-flags, which specify whether the appended string is bytes or utf8,
-respectively.
+
+The internal C<convert> function in F<op.c> has been renamed
+C<op_convert_list> and added to the API.
 
 =back
 
@@ -584,84 +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.
-
-=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.
+fchmod() and futimes() now set C<$!> when they fail due to being
+passed a closed file handle.  [perl #122703]
 
 =item *
 
-The flip-flop operator (C<..> in scalar context) would return the same
-scalar each time, unless the containing subroutine was called recursively.
-Now it always returns a new scalar.  [perl #122829]
+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 *
 
-Some unterminated C<(?(...)...)> constructs in regular expressions would
-either crash or give erroneous error messages.  C</(?(1)/> is one such
-example.
+op_free() no longer crashes due to a stack overflow when freeing a
+deeply recursive op tree. [perl #108276]
 
 =item *
 
-C<pack "w", $tied> no longer calls FETCH twice.
+scalarvoid() would crash due to a stack overflow when processing a
+deeply recursive op tree. [perl #108276]
 
 =item *
 
-List assignments like C<($x, $z) = (1, $y)> now work correctly if $x and $y
-have been aliased by C<foreach>.
+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 *
 
-Some patterns including code blocks with syntax errors, such as
-C</ (?{(^{})/>, would hang or fail assertions on debugging builds.  Now
-they produce errors.
+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 *
 
-An assertion failure when parsing C<sort> with debugging enabled has been
-fixed.  [perl #122771]
+C<else{foo()}> with no space before C<foo> is now better at assigning the
+right line number to that statement.  [perl #122695]
 
 =item *
 
-C<*a = *b; @a = split //, $b[1]> could do a bad read and produce junk
-results.
+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 *
 
-In C<() = @array = split>, the C<() => at the beginning no longer confuses
-the optimiser, making it assume a limit of 1.
+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 *
 
-Fatal warnings no longer prevent the output of syntax errors.
-[perl #122966]
-
-=item *
-
-Fixed a NaN double to long double conversion error on VMS. For quiet NaNs
-(and only on Itanium, not Alpha) negative infinity instead of NaN was
-produced. 
-
-=item *
-
-Fixed the issue that caused C<< make distclean >> to leave files behind
-that shouldn't. [perl #122820]
-
-=item *
-
-AIX now sets the length in C<< getsockopt >> correctly. [perl #120835],
-[rt #91183], [rt #85570].
-
-=item *
-
-During the pattern optimization phase, we no longer recurse into
-GOSUB/GOSTART when not SCF_DO_SUBSTR. This prevents the optimizer
-to run "forever" and exhaust all memory. [perl #122283]
+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
 
@@ -677,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
 
@@ -687,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
 
@@ -701,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