This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for fa0789a790
[perl5.git] / pod / perldelta.pod
index f0d4886..5f4a162 100644 (file)
@@ -1,3 +1,9 @@
+=for todo
+b47a847f62 win32/win32sck.c: dont close() a freed socket os handle
+35e037e846 Commit 1735f6f started to escape all...
+ff4a442c79 [perl #75156] fix the return value and bits for removing a...
+9b4bdfd44e fix chop formats with non PV vars
+
 =encoding utf8
 
 =head1 NAME
 [ 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.19.5
+perldelta - what is new for perl v5.19.6
 
 =head1 DESCRIPTION
 
-This document describes differences between the 5.19.4 release and the 5.19.5
+This document describes differences between the 5.19.5 release and the 5.19.6
 release.
 
-If you are upgrading from an earlier release such as 5.19.3, first read
-L<perl5194delta>, which describes differences between 5.19.3 and 5.19.4.
+If you are upgrading from an earlier release such as 5.19.4, first read
+L<perl5195delta>, which describes differences between 5.19.4 and 5.19.5.
 
 =head1 Notice
 
@@ -27,45 +33,12 @@ here, but most should go in the L</Performance Enhancements> section.
 
 [ List each enhancement as a =head2 entry ]
 
-=head2 Unicode 6.3 now supported
-
-Perl now supports and is shipped with Unicode 6.3 (though Perl may be
-recompiled with any previous Unicode release as well).  A detailed list of
-Unicode 6.3 changes is at L<http://www.unicode.org/versions/Unicode6.3.0/>.
-
-=head2 Experimental Postfix Dereferencing
-
-When the C<postderef> feature is in effect, the following syntactical
-equivalencies are set up:
-
-  $sref->$*;  # same as ${ $sref }  # interpolates
-  $aref->@*;  # same as @{ $aref }  # interpolates
-  $href->%*;  # same as %{ $href }
-  $cref->&*;  # same as &{ $cref }
-  $gref->**;  # same as *{ $gref }
-
-  $gref->*{ $slot }; # same as *{ $gref }{ $slot }
-
-  $aref->@[ ... ];  # same as @$aref[ ... ]  # interpolates
-  $href->@{ ... };  # same as @$href{ ... }  # interpolates
-  $aref->%[ ... ];  # same as %$aref[ ... ]
-  $href->%{ ... };  # same as %$href{ ... }
+=head2 $a and $b warnings exemption
 
-Those marked as interpolating only interpolate if the associated
-C<postderef_qq> feature is also enabled.  This feature is B<experimental> and
-will trigger C<experimental::postderef>-category warnings when used, unless
-they are suppressed.
-
-For more information, consult L<the Postfix Dereference Syntax section of
-perlref|perlref/Postfix Dereference Syntax>.
-
-=head2 C<sub>s now take a C<prototype> attribute
-
-When declaring or defining a C<sub>, the prototype can now be specified inside
-of a C<prototype> attribute instead of in parens following the name.
-
-For example, C<sub foo($$){}> could be rewritten as
-C<sub foo : prototype($$){}>.
+The special variables $a and $b, used in C<sort>, are now exempt from "used
+once" warnings, even where C<sort> is not used.  This makes it easier for
+CPAN modules to provide functions using $a and $b for similar purposes.
+[perl #120462]
 
 =head1 Security
 
@@ -85,11 +58,6 @@ XXX For a release on a stable branch, this section aspires to be:
 
 [ List each incompatible change as a =head2 entry ]
 
-=head2 Functions C<PerlIO_vsprintf> and C<PerlIO_sprintf> have been removed
-
-These two functions, undocumented, unused in CPAN, and problematic have been
-removed.
-
 =head1 Deprecations
 
 XXX Any deprecated features, syntax, modules etc. should be listed here.
@@ -114,8 +82,7 @@ not usually on concerns over their design.
 
 =over
 
-XXX Note that deprecated modules should be listed here even if they are listed
-as an updated module in the L</Modules and Pragmata> section.
+=item L<Package::Constants>
 
 =back
 
@@ -132,9 +99,10 @@ There may well be none in a stable release.
 
 =item *
 
-Perl has an optimizer for regular expression patterns.  It analyzes the pattern
-to find things such as the minimum length a string has to be to match, etc.  It
-now better handles code points that are above the Latin1 range.
+Constant hash key lookups (C<$hash{key}> as opposed to C<$hash{$key}>) have
+long had the internal hash value computed at compile time, to speed up
+lookup.  This optimisation has only now been applied to hash slices as
+well.
 
 =back
 
@@ -166,168 +134,56 @@ XXX
 
 =item *
 
-L<attributes> has been upgraded from version 0.21 to 0.22.
-
-Support has been added for the C<prototype> attribute.
-
-=item *
+L<B> has been upgraded from version 1.46 to 1.47.
 
-L<autodie> has been upgraded from version 2.21 to 2.22.
+C<< B::PMOP->precomp >> now preserves the internal UTF8 flag correctly, so
+chr 256 remains chr 256, instead of turning into "\xc4\x80".  This allows
+L<B::Deparse> to deparse Unicode regular expression correctly.
+[perl #120182]
 
-No changes have been made to the installed code other than the version bump to
-keep in sync with the latest CPAN release.
+C<< B::HV->ARRAY >> now preserves the UTF8 flag on returned hash keys.
+[perl #120535]
 
 =item *
 
-L<CPAN::Meta> has been upgraded from version 2.132620 to 2.132830.
+L<B::Concise> has been upgraded from version 0.99 to 0.991.
 
-L<CPAN::Meta::Prereqs> now has a C<merged_requirements> method for combining
-requirements across multiple phases and types, and an invalid 'meta-spec' is no
-longer a fatal error.
+B<-debug> output now includes C<op_other> pointers.
 
 =item *
 
-L<CPAN::Meta::Requirements> has been upgraded from version 2.123 to 2.125.
+L<B::Deparse> has been upgraded from version 1.23 to 1.24.
 
-No changes have been made to the installed code other than the version bump to
-keep in sync with the latest CPAN release.
+C<s//\(3)/e> is now deparsed in a way that does not issue warnings when
+parsed again.  [perl #119807]
 
-=item *
-
-L<CPAN::Meta::YAML> has been upgraded from version 0.008 to 0.010.
+C<glob(my $x)> is now deparsed correctly, rather than as C<< <my $x> >> or
+similar.
 
-No material changes have been made to the installed code other than the version
-bump to keep in sync with the latest CPAN release.
+C<CORE::glob> is now deparsed correctly with the CORE:: prefix when there
+is a subroutine named "glob".
 
 =item *
 
-L<Cwd> has been upgraded from version 3.44 to 3.45.
+L<Module::CoreList> has been upgraded from version 3.00 to 3.01.
 
-An obsolete #define has been removed from the XS code.
+The list of Perl versions covered has been updated.
 
 =item *
 
-L<ExtUtils::Install> has been upgraded from version 1.60 to 1.61.
+L<PerlIO::scalar> has been upgraded from version 0.17 to 0.18.
 
-Some POD formatting errors in the documentation have been corrected.
+A bug fix in 0.17 caused references to be stringified as soon as a handle
+to it was opened, even if it was opened only for reading.  It also croaked
+on read-only references.  This has been fixed.  [perl #119529]
 
 =item *
 
-L<ExtUtils::MakeMaker> has been upgraded from version 6.76 to 6.80.
-
-Numerous updates and bug fixes are incorporated.  See the F<Changes> file for
-full details.
-
-=item *
-
-L<feature> has been upgraded from version 1.33 to 1.34.
-
-The new features C<postderef> and C<postderef_qq> have been added.
-
-=item *
+L<Tie::StdHandle> has been upgraded from version 4.3 to 4.4.
 
-L<File::Fetch> has been upgraded from version 0.42 to 0.44.
+It no longer prints C<$\> twice.  [perl #120202]
 
-No changes have been made to the installed code other than the version bump to
-keep in sync with the latest CPAN release.
-
-=item *
-
-L<File::Glob> has been upgraded from version 1.21 to 1.22.
-
-Since Perl 5.16, code that used C<glob> inside a thread had been
-unintentionally sharing state between threads.  This has now been fixed.  [perl
-#119897/#117823]
-
-=item *
-
-L<File::Temp> has been upgraded from version 0.2301 to 0.2304.
-
-Required versions of other modules used are now listed more explicitly, L<base>
-is now used instead of L<parent>, and L<Exporter> is no longer inherited from.
-
-=item *
-
-L<Getopt::Long> has been upgraded from version 2.41 to 2.42.
-
-The floating point specifier C<name=f> no longer erroneously accepts values
-like 1.2.3.  [cpan #88707]
-
-=item *
-
-L<HTTP::Tiny> has been upgraded from version 0.035 to 0.036.
-
-No changes have been made to the installed code other than the version bump to
-keep in sync with the latest CPAN release.
-
-=item *
-
-L<List::Util> has been upgraded from version 1.32 to 1.34.
-
-The list reduction functions C<any>, C<all>, C<none> and C<notall> have been
-added.
-
-=item *
-
-L<Module::CoreList> has been upgraded from version 2.99 to 3.00.
-
-The list of Perl versions covered has been updated, %delta is now exported, and
-a bug in C<is_core> whereby it wrongly assumed a linear list of releases has
-been fixed.
-
-=item *
-
-L<Module::Metadata> has been upgraded from version 1.000018 to 1.000019.
-
-Warnings are now disabled during version evaluation.
-
-=item *
-
-L<Parse::CPAN::Meta> has been upgraded from version 1.4407 to 1.4409.
-
-No changes have been made to the installed code other than the version bump to
-keep in sync with the latest CPAN release.
-
-=item *
-
-L<Perl::OSType> has been upgraded from version 1.005 to 1.006.
-
-No changes have been made to the installed code other than the version bump to
-keep in sync with the latest CPAN release.
-
-=item *
-
-The podlators modules have been upgraded from version 2.5.1 to 2.5.3.
-
-Numerous updates and bug fixes are incorporated.  See the F<Changes> file in
-the CPAN distribution for full details.
-
-=item *
-
-L<Test::Harness> has been upgraded from version 3.28 to 3.29.
-
-All modules now use C<our> rather than C<use vars>, have C<use warnings>
-enabled and C<use parent> instead of @ISA.
-
-=item *
-
-L<threads> has been upgraded from version 1.87 to 1.89.
-
-The documentation of C<alarm> and C<_handle> has been updated.
-
-=item *
-
-L<Unicode::Normalize> has been upgraded from version 1.16 to 1.17.
-
-The module now C<die>s if it cannot get Unicode code points using C<unpack>.
-(There is already a similar C<die> if Unicode code points cannot be stringified
-using C<pack>.)
-
-=item *
-
-L<warnings> has been upgraded from version 1.19 to 1.20.
-
-The new warnings category C<experimental::postderef> has been added.
+It no longer ignores the offset passed to C<syswrite>.
 
 =back
 
@@ -360,35 +216,13 @@ 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<perlref>
-
-=over 4
-
-=item *
-
-Documentation of the new postfix dereference syntax has been added.
-
-=back
-
-=head3 L<perlreguts>
-
-=over 4
-
-=item *
-
-The documentation has been updated in the light of recent changes to
-F<regcomp.c>.
-
-=back
-
-=head3 L<perlvar>
+=head3 L<XXX>
 
 =over 4
 
 =item *
 
-Three L<English> variable names which have long been documented but do not
-actually exist have been removed from the documentation.
+XXX Description of the change here
 
 =back
 
@@ -422,36 +256,7 @@ XXX L<message|perldiag/"message">
 
 =item *
 
-L<Attribute prototype(%s) discards earlier prototype attribute in same sub|perldiag/"Attribute prototype(%s) discards earlier prototype attribute in same sub">
-
-(W misc) A sub was declared as sub foo : prototype(A) : prototype(B) {}, for
-example.  Since each sub can only have one prototype, the earlier
-declaration(s) are discarded while the last one is applied.
-
-=item *
-
-L<Postfix dereference is experimental|perldiag/"Postfix dereference is experimental">
-
-(S experimental::postderef) This warning is emitted if you use the experimental
-postfix dereference syntax.  Simply suppress the warning if you want to use the
-feature, but know that in doing so you are taking the risk of using an
-experimental feature which may change or be removed in a future Perl version:
-
-    no warnings "experimental::postderef";
-    use feature "postderef", "postderef_qq";
-    $ref->$*;
-    $aref->@*;
-    $aref->@[@indices];
-    ... etc ...
-
-=item *
-
-L<Prototype '%s' overridden by attribute 'prototype(%s)' in %s|perldiag/"Prototype '%s' overridden by attribute 'prototype(%s)' in %s">
-
-(W prototype) A prototype was declared in both the parentheses after the sub
-name and via the prototype attribute.  The prototype in parentheses is useless,
-since it will be replaced by the prototype from the attribute before it's ever
-used.
+XXX L<message|perldiag/"message">
 
 =back
 
@@ -463,7 +268,11 @@ XXX Changes (i.e. rewording) of diagnostic messages go here
 
 =item *
 
-XXX Describe change here
+L<%%s[%s] in scalar context better written as $%s[%s]|perldiag/"%%s[%s] in scalar context better written as $%s[%s]">:
+
+This warning now occurs for any C<%array[$index]> or C<%hash{key}> known to
+be in scalar context at compile time.  Previously it was worded "Scalar
+value %%s[%s] better written as $%s[%s]".
 
 =back
 
@@ -517,30 +326,24 @@ that they represent may be covered elsewhere.
 
 =item *
 
-The new postfix dereference syntax is tested by a new test script,
-F<t/op/postfixderef.t>.
+F<ext/File-Find/t/find.t> has been converted from manual C<print>
+statements to Test::More functions.  Each test now has a description.
+[perl #120503]
 
 =back
 
 =head1 Platform Support
 
-XXX Any changes to platform support should be listed in the sections below.
-
-[ Within the sections, list each platform as a =item entry with specific
-changes as paragraphs below it. ]
-
 =head2 New Platforms
 
-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.
-
 =over 4
 
-=item XXX-some-platform
+=item Synology
 
-XXX
+Synology ships its NAS boxes with a lean Linux distribution (DSM) on relative
+cheap CPU's (like the Marvell Kirkwood mv6282 - ARMv5tel or Freescale QorIQ
+P1022 ppc - e500v2) not meant for workstations or development. These boxes
+should build now. The basic problems are the non-standard location for tools.
 
 =back
 
@@ -565,9 +368,19 @@ L</Modules and Pragmata> section.
 
 =over 4
 
-=item XXX-some-platform
+=item Windows
 
-XXX
+Support for building with Visual C++ 2013 has been added.  There are currently
+two possible test failures (see L<perlwin32/"Testing Perl on Windows">) which
+will hopefully be resolved soon.
+
+=item WinCE
+
+Perl can now be built in one shot with no user intervention on WinCE by running
+C<nmake -f Makefile.ce all>.
+
+Support for building with EVC (Embedded Visual C++) 4 has been restored.  Perl
+can also be built using Smart Devices for Visual C++ 2005 or 2008.
 
 =back
 
@@ -583,7 +396,9 @@ well.
 
 =item *
 
-XXX
+Compiling with C<-Accflags=-PERL_BOOL_AS_CHAR> now allows C99 and C++
+compilers to emulate the aliasing of C<bool> to C<char> that perl does for
+C89 compilers.  [perl #120314]
 
 =back
 
@@ -598,25 +413,169 @@ files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
 
 =item *
 
-C<last> no longer returns values that the same statement has accumulated so
-far, fixing amongst other things the long-standing bug that C<push @a, last>
-would try to return the @a, copying it like a scalar in the process and
-resulting in the error, "Bizarre copy of ARRAY in last."  [perl #3112]
+Perl 5.18.0 accidentally disallowed C<-bareword> under C<use strict> and
+C<use integer>.  This has been fixed.  [perl #120288]
+
+=item *
+
+C<-a> at the start of a line (or a hyphen with any single letter that is
+not a filetest operator) no longer produces an erroneous 'Use of "-a"
+without parentheses is ambiguous' warning.  [perl #120288]
+
+=item *
+
+Lvalue context is now properly propagated into bare blocks and C<if> and
+C<else> blocks in lvalue subroutines.  Previously, arrays and hashes would
+sometimes incorrectly be flattened when returned in lvalue list context, or
+"Bizarre copy" errors could occur.  [perl #119797]
+
+=item *
+
+Lvalue context is now propagated to the branches of C<||> and C<&&> (and
+their alphabetic equivalents, C<or> and C<and>).  This means
+C<foreach (pos $x || pos $y) {...}> now allows C<pos> to be modified
+through $_.
+
+=item *
+
+C<*DB::DB = sub {} if 0> no longer stops Perl's debugging mode from finding
+C<DB::DB> subs declared thereafter.
+
+=item *
+
+C<stat> and C<readline> remember the last handle used; the former
+for the special C<_> filehandle, the latter for C<${^LAST_FH}>.
+C<eval "*foo if 0"> where *foo was the last handle passed to C<stat>
+or C<readline> could cause that handle to be forgotten if the
+handle were not opened yet.  This has been fixed.
+
+=item *
+
+Various cases of C<delete $::{a}>, C<delete $::{ENV}> etc. causing a crash
+have been fixed.  [perl #54044]
+
+=item *
+
+Assigning another typeglob to C<*^R> no longer makes the regular expression
+engine crash.
+
+=item *
+
+C<%{'_<...'}> hashes now set breakpoints on the corresponding C<@{'_<...'}>
+rather than whichever array C<@DB::dbline> is aliased to.  [perl #119799]
+
+=item *
+
+Setting C<$!> to EACCESS before calling C<require> could affect
+C<require>'s behaviour.  This has been fixed.
+
+=item *
+
+The "Can't use \1 to mean $1 in expression" warning message now only occurs
+on the right-hand (replacement) part of a substitution.  Formerly it could
+happen in code embedded in the left-hand side, or in any other quote-like
+operator.
+
+=item *
+
+The C<\N> regular expression escape, when used without the curly braces (to
+mean C<[^\n]>), was ignoring a following C<*> if followed by whitespace
+under /x.  It had been this way since C<\N> to mean C<[^\n]> was introduced
+in 5.12.0.
+
+=item *
+
+Blessing into a reference (C<bless $thisref, $thatref>) has long been
+disallowed, but magical scalars for the second like C<$/> and those tied
+were exempt.  They no longer are.  [perl #119809]
+
+=item *
+
+Blessing into a reference was accidentally allowed in 5.18 if the class
+argument were a blessed reference with stale method caches (i.e., whose
+class had had subs defined since the last method call).  They are
+disallowed once more, as in 5.16.
+
+=item *
+
+An undefined lexical sub used as an inherited method no longer crashes.
+
+=item *
+
+C<< $x->{key} >> where $x was declared as C<my Class $x> no longer crashes
+if a Class::FIELDS subroutine stub has been declared.
+
+=item *
+
+C<@$obj{'key'}> and C<${$obj}{key}> used to be exempt from compile-time
+field checking ("No such class field"; see L<fields>) but no longer are.
+
+=item *
+
+That compile-time field checking also applies now to the C<%$obj{'key'}>
+syntax, added recently in Perl 5.19.4.
+
+=item *
+
+A nonexistent array element with a large index passed to a subroutine that
+ties the array and then tries to access the element no longer results in a
+crash.
 
 =item *
 
-An optimization in Perl 5.18 made incorrect assumptions causing a bad
-interaction with the L<Devel::CallParser> CPAN module.  This was partially
-fixed in Perl 5.19.4, but the fix was not sufficient and another fault has now
-been corrected.
+Declaring a subroutine stub named NEGATIVE_INDICES no longer makes negative
+array indices crash when the current package is a tied array class.
 
 =item *
 
-In some cases, closing file handled opened to pipe to or from a process, which
-had been duplicated into a standard handle, would call perl's internal waitpid
-wrapper with a pid of zero.  With the fix for [perl #85228] this zero pid was
-passed to waitpid(), possibly blocking the process.  This wait for process
-zero no longer occurs.  [perl #119893]
+Declaring a C<require>, C<glob>, or C<do> subroutine stub in the
+CORE::GLOBAL:: package no longer makes compilation of calls to the
+corresponding functions crash.
+
+=item *
+
+Aliasing CORE::GLOBAL:: functions to constants stopped working in Perl 5.10
+but has now been fixed.
+
+=item *
+
+When C<`...`> or C<qx/.../> calls a C<readpipe> override, double-quotish
+interpolation now happens, as is the case when there is no override.
+Previously, the presence of an override would make these quote-like
+operators act like C<q{}>, suppressing interpolation.  [perl #115330]
+
+=item *
+
+C<<<`...`> here-docs (with backticks as the delimiters) now call
+C<readpipe> overrides.  [perl #119827]
+
+=item *
+
+The presence of a lexical sub named "CORE" no longer stops the CORE::
+prefix from working.
+
+=item *
+
+C<&CORE::exit()> and C<&CORE::die()> now respect L<vmsish> hints.
+
+=item *
+
+Undefining a glob that triggers a DESTROY method that undefines the same
+glob is now safe.  It used to produce "Attempt to free unreferenced glob
+pointer" warnings and leak memory.
+
+=item *
+
+If subroutine redefinition (C<eval 'sub foo{}'> or C<newXS> for XS code)
+triggers a DESTROY method on the sub that is being redefined, and that
+method assigns a subroutine to the same slot (C<*foo = sub {}>), C<$_[0]>
+is no longer left pointing to a freed scalar.  Now DESTROY is delayed until
+the new subroutine has been installed.
+
+=item *
+
+C<s///>, C<tr///> and C<y///> now work when a wide character is used as the
+delimiter.  [perl #120463]
 
 =back
 
@@ -632,7 +591,10 @@ platform specific bugs also go here.
 
 =item *
 
-XXX
+C<do CORE()> used to call a sub named "CORE" and treat its return value as
+a file name to execute.  A bug fix inadvertently caused it to be
+interpreted as the deprecated "do-SUB" construct.  (Yes, C<do
+I<bareword>()> is inconsistent.)  This will likely be changed back.
 
 =back
 
@@ -645,7 +607,7 @@ here.
 
 XXX Generate this with:
 
-  perl Porting/acknowledgements.pl v5.19.4..HEAD
+  perl Porting/acknowledgements.pl v5.19.5..HEAD
 
 =head1 Reporting Bugs