This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta: move several change notes to Selected Bug Fixes
[perl5.git] / pod / perldelta.pod
index 7c30b55..da6a970 100644 (file)
@@ -1,23 +1,20 @@
 =encoding utf8
 
-=for todo
-83b195e49dd1 ensure correctness if sv_2mortal modifies errno
-
 =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.17.1
+perldelta - what is new for perl v5.17.2
 
 =head1 DESCRIPTION
 
-This document describes differences between the 5.17.0 release and
-the 5.17.1 release.
+This document describes differences between the 5.17.1 release and
+the 5.17.2 release.
 
-If you are upgrading from an earlier release such as 5.16.0, first read
-L<perl5170delta>, which describes differences between 5.16.0 and
-5.17.0.
+If you are upgrading from an earlier release such as 5.17.0, first read
+L<perl5171delta>, which describes differences between 5.17.0 and
+5.17.1.
 
 =head1 Notice
 
@@ -31,18 +28,6 @@ here, but most should go in the L</Performance Enhancements> section.
 
 [ List each enhancement as a =head2 entry ]
 
-=head2 More CORE:: subs
-
-Several more built-in functions have been added as subroutines to the
-CORE:: namespace, namely, those non-overridable keywords that can be
-implemented without custom parsers: C<defined>, C<delete>, C<exists>,
-C<glob>, C<pos>, C<protoytpe>, C<scalar>, C<split>, C<study>, C<undef>,
-
-As some of these have prototypes, C<prototype('CORE::...')> has been
-changed not to make a distinction between overridable and non-overridable
-keywords.  This is to make C<prototype('CORE::pos')> consistent with
-C<prototype(&CORE::pos)>.
-
 =head1 Security
 
 XXX Any security-related notices go here.  In particular, any security
@@ -59,41 +44,7 @@ XXX For a release on a stable branch, this section aspires to be:
     If any exist, they are bugs, and we request that you submit a
     report.  See L</Reporting Bugs> below.
 
-=head2 C</(?{})/> and C</(??{}> have been heavily reworked.
-
-The implementation of this feature has been almost completely written.
-Although its main intent is is to fix bugs, some behaviours, especially
-related to the scope of lexical variables, will have changed.  This is
-described more fully in the L</Selected Bug Fixes> section.
-
-=head2 C<\N{BELL}> now refers to U+1F514 instead of U+0007
-
-Unicode 6.0 reused the name "BELL" for a different code point than it
-traditionally had meant.  Since Perl v5.14, use of this name still
-referred to U+0007, but would raise a deprecated warning.  Now, "BELL"
-refers to U+1F514, and the name for U+0007 is "ALERT".  All the
-functions in L<charnames> have been correspondingly updated.
-
-=head2 Alphanumeric operators must now be separated from the closing
-delimter of regular expressions
-
-You may no longer write something like:
-
- m/a/and 1
-
-Instead you must write
-
- m/a/ and 1
-
-with whitespace separating the operator from the closing delimiter of
-the regular expression.  Not having whitespace has resulted in a
-deprecated warning since Perl v5.14.0.
-
-=head2 C<require> dies for unreadable files
-
-When C<require> encounters an unreadable file, it now dies.  It used to
-ignore the file and continue searching the directories in @INC
-[perl #113422].
+[ List each incompatible change as a =head2 entry ]
 
 =head1 Deprecations
 
@@ -114,9 +65,7 @@ may well be none in a stable release.
 
 =item *
 
-The C<x> repetition operator is now folded to a single constant at compile
-time if called in scalar context with constant operands and no parentheses
-around the left operand.
+XXX
 
 =back
 
@@ -148,68 +97,29 @@ XXX
 
 =item *
 
-L<ExtUtils::CBuilder> has been upgraded from version 0.280206 to 0.280208.
-
-Manifest files are now correctly embedded for those versions of VC++ which
-make use of them.
-
-=item *
-
-L<B> has been upgraded from version 1.35 to 1.36.
-
-C<B::COP::stashlen> has been replaced with C<B::COP::stashoff>.
-
-C<B::COP::stashpv> now supports UTF8 package names and embedded nulls.
-
-=item *
-
-L<Class::Struct> has been upgraded from version 0.63 to 0.64.
-
-The constructor now respects overridden accessor methods [perl #29230].
-
-=item *
-
-L<ExtUtils::CBuilder> has been upgraded from version 0.280206 to 0.280208.
-
-It no longer fails when trying to embed manifests on Windows
-[perl #111782, #111798].
-
-=item *
-
-L<File::DosGlob> has been upgraded from version 1.07 to 1.08.
-
-There are no visible changes, only minor internal refactorings.
-
-=item *
-
-L<File::Spec::Unix> has been upgraded from version 3.39_02 to 3.39_03.
+L<File::stat> has been upgraded from version 1.06 to 1.07.
 
-C<abs2rel> could produce incorrect results when given two relative paths or
-the root directory twice [perl #111510].
+Previously C<File::stat>'s overloaded C<-x> and C<-X> operators did not give
+the correct results for directories or executable files when running as
+root. They had been treating executable permissions for root just like for
+any other user, performing group membership tests I<etc> for files not owned
+by root. They now follow the correct Unix behaviour - for a directory they
+are always true, and for a file if any of the three execute permission bits
+are set then they report that root can execute the file. Perl's builtin
+C<-x> and C<-X> operators have always been correct.
 
 =item *
 
-L<IO> has been upgraded from version 1.25_06 to 1.25_07.
+L<Tie::StdHandle> has been upgraded from version 4.2 to 4.3.
 
-C<sync()> can now be called on read-only file handles [perl #64772].
+C<READ> now respects the offset argument to C<read> [perl #112826].
 
 =item *
 
-L<Pod::Html> has been upgraded from version 1.15_02 to 1.16.
+L<IO> has been upgraded from version 1.25_07 to 1.25_08.
 
-The option C<--libpods> has been re-instated. It is deprecated, and its use
-does nothing other than issue a warning that it is no longer supported.
-
-=item *
-
-L<Unicode::UCD> has been upgraded from version 0.43 to 0.44.
-
-This adds a function L<all_casefolds()|Unicode::UCD/all_casefolds()>
-that returns all the casefolds.
-
-=item *
-
-L<Scalar::Util> has been upgraded from version 1.23 to version 1.25.
+L<IO::Socket> tries harder to cache or otherwise fetch socket
+information.
 
 =back
 
@@ -242,13 +152,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<perlfaq>
+=head3 L<XXX>
 
 =over 4
 
 =item *
 
-L<perlfaq> has been synchronised with version 5.0150040 from C<CPAN>.
+XXX Description of the change here
 
 =back
 
@@ -279,7 +189,10 @@ XXX Newly added diagnostic messages go here
 
 =item *
 
-XXX L<message|perldiag/"message">
+L<Group name must start with a non-digit word character in regex; marked by <-- HERE in mE<sol>%sE<sol>|perldiag/"Group name must start with a non-digit word character in regex; marked by <-- HERE in m/%s/">
+
+This error has been added for C<(?&0)>, which is invalid.  It used to
+produce an incomprehensible error message [perl #101666].
 
 =back
 
@@ -289,35 +202,29 @@ XXX L<message|perldiag/"message">
 
 =item *
 
-XXX L<message|perldiag/"message">
-
-=back
-
-=head2 Changes to Existing Diagnostics
+C<chr()> now warns when passed a negative value [perl #83048].
 
-XXX Changes (i.e. rewording) of diagnostic messages go here
+=item *
 
-=over 4
+C<srand()> now warns when passed a value that doesn't fit in a C<UV> (since the
+value will be truncated rather than overflowing) [perl #40605].
 
 =item *
 
-XXX Describe change here
+Running perl with the C<-i> flag now warns if no input files are provided on
+the command line [perl #113410].
 
 =back
 
-=head2 Removals of Diagnostics
-
-=over 4
+=head2 Changes to Existing Diagnostics
 
-=item *
+XXX Changes (i.e. rewording) of diagnostic messages go here
 
-The "Runaway prototype" warning that occurs in bizarre cases has been
-removed as being unhelpful and inconsistent.
+=over 4
 
 =item *
 
-The "Not a format reference" error has been removed, as the only case in
-which it could be triggered was a bug.
+XXX Describe change here
 
 =back
 
@@ -353,7 +260,9 @@ L</Platform Support> section, instead.
 
 =item *
 
-XXX
+Building perl with some Windows compilers used to fail due to a problem
+with miniperl's C<glob> operator (which uses the C<perlglob> program)
+deleting the PATH environment variable [perl #113798].
 
 =back
 
@@ -391,9 +300,11 @@ source tree.
 
 =over 4
 
-=item XXX-some-platform
+=item *
 
-XXX
+Configure now always adds -qlanglvl=extc99 to the CC flags on AIX when
+using xlC.  This will make it easier to compile a number of XS-based modules
+that assume C99 [perl #113778].
 
 =back
 
@@ -418,17 +329,9 @@ L</Modules and Pragmata> section.
 
 =over 4
 
-=item Win32
-
-C<link> on Win32 now attempts to set C<$!> to more appropriate values
-based on the Win32 API error code. [perl #112272]
+=item XXX-some-platform
 
-Perl no longer mangles the environment block, e.g. when launching a new
-sub-process, when the environment contains non-ASCII characters. Known
-problems still remain, however, when the environment contains characters
-outside of the current ANSI codepage (e.g. see the item about Unicode in
-C<%ENV> in L<http://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/todo.pod>).
-[perl #113536]
+XXX
 
 =back
 
@@ -444,27 +347,7 @@ be noted as well.
 
 =item *
 
-The C<study> function was made a no-op in 5.16.  It was simply disabled via
-a C<return> statement; the code was left in place.  Now the code supporting
-what C<study> used to do has been removed.
-
-=item *
-
-Under threaded perls, there is no longer a separate PV allocated for every
-COP to store its package name (C<< cop->stashpv >>).  Instead, there is an
-offset (C<< cop->stashoff >>) into the new C<PL_stashpad> array, which
-holds stash pointers.
-
-=item *
-
-In the pluggable regex API, the C<regexp_engine> struct has acquired a new
-field C<op_comp>, which is currently just for perl's internal use, and
-should be initialised to NULL by other regexp plugin modules.
-
-=item *
-
-A new function C<alloccoptash> has been added to the API, but is considered
-experimental.  See L<perlapi>.
+XXX
 
 =back
 
@@ -480,247 +363,105 @@ L</Modules and Pragmata>.
 
 =item *
 
-The implementation of code blocks in regular expressions, such as C<(?{})>
-and C<(??{})> has been heavily reworked to eliminate a whole slew of bugs.
-The main user-visible changes are:
-
-=over 4
-
-=item *
-
-Code blocks within patterns are now parsed in the same pass as the
-surrounding code; in particular it is no longer necessary to have balanced
-braces: this now works:
-
-    /(?{  $x='{'  })/
-
-This means that this error message is longer generated:
-
-    Sequence (?{...}) not terminated or not {}-balanced in regex
-
-but a new error may be seen:
-
-    Sequence (?{...}) not terminated with ')'
-
-In addition, literal code blocks within run-time patterns are only
-compiled once, at perl compile-time:
-
-    for my $p (...) {
-        # this 'FOO' block of code is compiled once,
-       # at the same time as the surrounding 'for' loop
-        /$p{(?{FOO;})/;
-    }
+A regression introduced in v5.14.0 has been fixed, in which some calls
+to the C<re> module would clobber C<$_>.
 
 =item *
 
-Lexical variables are now sane as regards scope, recursion and closure
-behaviour. In particular, C</A(?{B})C/> behaves (from a closure viewpoint)
-exactly like C</A/ && do { B } && /C/>, while  C<qr/A(?{B})C/> is like
-C<sub {/A/ && do { B } && /C/}>. So this code now works how you might
-expect, creating three regexes that match 0, 1, and 2:
-
-    for my $i (0..2) {
-        push @r, qr/^(??{$i})$/;
-    }
-    "1" =~ $r[1]; # matches
+C<do FILE> now always either sets or clears C<$@>, even when the file can't be
+read. This ensures that testing C<$@> first (as recommended by the
+documentation) always returns the correct result.
 
 =item *
 
-The C<use re 'eval'> pragma is now  only required for code blocks defined
-at runtime; in particular in the following, the text of the $r pattern is
-still interpolated into the new pattern and recompiled, but the individual
-compiled code-blocks within $r are reused rather than being recompiled,
-and C<use re 'eval'> isn't needed any more:
+The array iterator used for the C<each @array> construct is now correctly
+reset when C<@array> is cleared (RT #75596). This happens for example when the
+array is globally assigned to, as in C<@array = (...)>, but not when its
+B<values> are assigned to. In terms of the XS API, it means that C<av_clear()>
+will now reset the iterator.
 
-    my $r = qr/abc(?{....})def/;
-    /xyz$r/;
+This mirrors the behaviour of the hash iterator when the hash is cleared.
 
 =item *
 
-Flow control operators no longer crash. Each code block runs in a new
-dynamic scope, so C<next> etc. will not see any enclosing loops and
-C<caller> will not see any calling subroutines. C<return> returns a value
-from the code block, not from any enclosing subroutine.
+C<< $class->can >>, C<< $class->isa >>, and C<< $class->DOES >> now return
+correct results, regardless of whether that package referred to by C<$class>
+exists [perl #47113].
 
 =item *
 
-Perl normally caches the compilation of run-time patterns, and doesn't
-recompile if the pattern hasn't changed; but this is now disabled if
-required for the correct behaviour of closures; for example:
-
-    my $code = '(??{$x})';
-    for my $x (1..3) {
-       # recompile to see fresh value of $x each time
-        $x =~ /$code/;
-    }
-
+Arriving signals no longer clear C<$@> [perl #45173].
 
 =item *
 
-The C</msix> and C<(?msix)> etc. flags are now propagated into the return
-value from C<(??{})>; this now works:
-
-    "AB" =~ /a(??{'b'})/i;
+Allow C<my ()> declarations with an empty variable list [perl #113554].
 
 =item *
 
-Warnings and errors will appear to come from the surrounding code (or for
-run-time code blocks, from an eval) rather than from an C<re_eval>:
-
-    use re 'eval'; $c = '(?{ warn "foo" })'; /$c/;
-    /(?{ warn "foo" })/;
-
-formerly gave:
-
-    foo at (re_eval 1) line 1.
-    foo at (re_eval 2) line 1.
-
-and now gives:
-
-    foo at (eval 1) line 1.
-    foo at /some/prog line 2.
-
-=back
+During parsing, subs declared after errors no longer leave stubs
+[perl #113712].
 
 =item *
 
-Perl now works as well as can be expected on all releases of Unicode so
-far.  In v5.16, it worked on Unicodes 6.0 and 6.1, but there were
-various bugs for earlier releases; the older the release the more
-problems.
+Closures containing no string evals no longer hang on to their containing
+subroutines, allowing variables closed over by outer subroutines to be
+freed when the outer sub is freed, even if the inner sub still exists
+[perl #89544].
 
 =item *
 
-C<vec> no longer produces "uninitialized" warnings in lvalue context
-[perl #9423].
+Duplication of in-memory filehandles by opening with a "<&=" or ">&=" mode
+stopped working properly in 5.16.0.  It was causing the new handle to
+reference a different scalar variable.  This has been fixed [perl #113764].
 
 =item *
 
-An optimisation involving fixed strings in regular expressions could cause
-a severe performance penalty in edge cases.  This has been fixed
-[perl #76546].
+C<qr//> expressions no longer crash with custom regular expression engines
+that do not set C<offs> at regular expression compilation time
+[perl #112962].
 
 =item *
 
-The "Can't find an opnumber" message that C<prototype> produces when passed
-a string like "CORE::nonexistent_keyword" is now passes UTF8 and embedded
-nulls through unchanged [perl #97478].
+C<delete local> no longer crashes with certain magical arrays and hashes
+[perl #112966].
 
 =item *
 
-C<prototype> now treats magical variables like C<$1> the same way as
-non-magical variables when checking for the CORE:: prefix, instead of
-treating them as subroutine names.
+C<local> on elements of certain magical arrays and hashes used not to
+arrange to have the element deleted on scope exit, even if the element did
+not exist before C<local>.
 
 =item *
 
-Under threaded perls, a run-time code block in a regular expression could
-corrupt the package name stored in the op tree, resulting in bad reads
-in C<caller>, and possibly crashes [perl #113060].
+C<scalar(write)> no longer returns multiple items [perl #73690].
 
 =item *
 
-Referencing a closure prototype (C<\&{$_[1]}> in an attribute handler for a
-closure) no longer results in a copy of the subroutine (or assertion
-failures on debugging builds).
+String to floating point conversions no longer misparse certain strings under
+C<use locale> [perl #109318].
 
 =item *
 
-C<eval '__PACKAGE__'> now returns the right answer on threaded builds if
-the current package has been assigned over (as in
-C<*ThisPackage:: = *ThatPackage::>) [perl #78742].
+C<@INC> filters that die no longer leak memory [perl #92252].
 
 =item *
 
-If a package is deleted by code that it calls, it is possible for C<caller>
-to see a stack frame belonging to that deleted package.  C<caller> could
-crash if the stash's memory address was reused for a scalar and a
-substitution was performed on the same scalar [perl #113486].
+The implementations of overloaded operations are now called in the correct
+context. This allows, among other things, being able to properly override
+C<< <> >> [perl #47119].
 
 =item *
 
-C<UNIVERSAL::can> no longer treats its first argument differently
-depending on whether it is a string or number internally.
-
-=item *
-
-C<open> with "<&" for the mode checks to see whether the third argument is
-a number, in determining whether to treat it as a file descriptor or a
-handle name.  Magical variables like C<$1> were always failing the numeric
-check and being treated as handle names.
-
-=item *
-
-C<warn>'s handling of magical variables (C<$1>, ties) has undergone several
-fixes.  FETCH is only called once now on a tied argument or a tied C<$@>
-[perl #97480].  Tied variables returning objects that stringify as "" are
-no longer ignored.  A tied C<$@> that happened to return a reference the
-I<previous> time is was used is no longer ignored.
-
-=item *
-
-C<warn ""> now treats C<$@> with a number in it the same way, regardless of
-whether it happened via C<$@=3> or C<$@="3">.  It used to ignore the
-former.  Now it appends "\t...caught", as it has always done with
-C<$@="3">.
-
-=item *
-
-Numeric operators on magical variables (e.g., S<C<$1 + 1>>) used to use
-floating point operations even where integer operations were more appropriate,
-resulting in loss of accuracy on 64-bit platforms [perl #109542].
-
-=item *
-
-Unary negation no longer treats a string as a number if the string happened
-to be used as a number some time.  So, if $x contains the string "dogs",
-C<-$x> returns "-dogs" even if C<$y=0+$x> has happened at some point.
-
-=item *
-
-In Perl 5.14, C<-'-10'> was fixed to return "10", not "+10".  But magical
-variables (C<$1>, ties) were not fixed till now [perl #57706].
-
-=item *
-
-Unary negation now treats strings consistently, regardless of the internal
-UTF8 flag.
-
-=item *
-
-A regression introduced in Perl v5.16.0 involving
-C<tr/I<SEARCHLIST>/I<REPLACEMENTLIST>/> has been fixed.  Only the first
-instance is supposed to be meaningful if a character appears more than
-once in C<I<SEARCHLIST>>.  Under some circumstances, the final instance
-was overriding all earlier ones.  [perl #113584]
-
-=item *
-
-Regular expressions like C<qr/\87/> previously silently inserted a NUL
-character, thus matching as if it had been written C<qr/\00087/>.  Now it
-matchs as if it had been written as C<qr/87/>, with a message that the
-sequence C<"\8"> is unrecognized.
-
-=item *
-
-C<__SUB__> now works in special blocks (BEGIN, END, etc.).
-
-=item *
-
-Thread creation on Windows could theoretically result in a crash if done
-inside a BEGIN block.  It still does not work properly, but it no longer
-crashes [perl #111610].
+Specifying only the C<fallback> key when calling C<use overload> now behaves
+properly [perl #113010].
 
 =back
 
 =head1 Known Problems
 
 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
-tests that had to be C<TODO>ed for the release would be noted here, unless
-they were specific to a particular platform (see below).
-
-This is a list of some significant unfixed bugs, which are regressions
-from either 5.XXX.XXX or 5.XXX.XXX.
+tests that had to be C<TODO>ed for the release would be noted here. Unfixed
+platform specific bugs also go here.
 
 [ List each fix as a =item entry ]
 
@@ -741,7 +482,7 @@ here.
 
 XXX Generate this with:
 
-  perl Porting/acknowledgements.pl v5.17.0..HEAD
+  perl Porting/acknowledgements.pl v5.17.1..HEAD
 
 =head1 Reporting Bugs