This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta: mention OP_PADRANGE
[perl5.git] / pod / perldelta.pod
index 59f4e4a..d7d6834 100644 (file)
@@ -1,19 +1,24 @@
 =encoding utf8
 
+=for todo
+284167a smueller Add C define to remove taint support from perl
+ba593ad davem    clone() wasn't cloning the whole stack
+7dc8663 demerphq Hash Function Change - Murmur hash and true per process...
+
 =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.3
+perldelta - what is new for perl v5.17.6
 
 =head1 DESCRIPTION
 
-This document describes differences between the 5.17.2 release and the 5.17.3
+This document describes differences between the 5.17.5 release and the 5.17.6
 release.
 
-If you are upgrading from an earlier release such as 5.17.1, first read
-L<perl5172delta>, which describes differences between 5.17.1 and 5.17.2.
+If you are upgrading from an earlier release such as 5.17.4, first read
+L<perl5175delta>, which describes differences between 5.17.4 and 5.17.5.
 
 =head1 Notice
 
@@ -27,12 +32,15 @@ here, but most should go in the L</Performance Enhancements> section.
 
 [ List each enhancement as a =head2 entry ]
 
-=head2 Computed Labels
+=head2 Character name aliases may now include non-Latin1-range characters
 
-The loop controls C<next>, C<last> and C<redo>, and the special C<dump>
-operator, now allow arbitrary expressions to be used to compute labels at
-run time.  Previously, any argument that was not a constant was treated as
-the empty string.
+It is possible to define your own names for characters for use in
+C<\N{...}>, C<charnames::vianame()>, etc.  These names can now be
+comprised of characters from the whole Unicode range.  This allows for
+names to be in your native language, and not just English.  Certain
+restrictions apply to the characters that may be used (you can't define
+a name that has punctuation in it, for example).  See L<charnames/CUSTOM
+ALIASES>.
 
 =head1 Security
 
@@ -44,28 +52,33 @@ L</Selected Bug Fixes> section.
 
 =head1 Incompatible Changes
 
+XXX For a release on a stable branch, this section aspires to be:
+
+    There are no changes intentionally incompatible with 5.XXX.XXX
+    If any exist, they are bugs, and we request that you submit a
+    report.  See L</Reporting Bugs> below.
+
 [ List each incompatible change as a =head2 entry ]
 
-=head2 C<$ENV{foo}=undef> deletes value from environ, like C<delete $ENV{foo}>
+=head2 An unknown character name in C<\N{...}> is now a syntax error
 
-This facilitates use of C<local()> with C<%ENV> entries.  In previous
-versions of Perl, C<undef> was converted to the empty string.
+Previously, it warned, and the Unicode REPLACEMENT CHARACTER was
+substituted.  Unicode now recommends that this situation be a syntax
+error.  Also, the previous behavior led to some confusing warnings and
+behaviors, and since the REPLACEMENT CHARACTER has no use other than as
+a stand-in for some unknown character, any code that has this problem is
+buggy.
 
-=head2 Defined values stored in environment are forced to byte strings
+=head2 Formerly deprecated characters in C<\N{}> character name aliases are now errors.
 
-A value stored in an environment variable has always been stringified.  In
-this release, it is converted to be only a byte string.  First, it is forced
-to be a only a string.  Then if the string is utf8 and the equivalent of
-C<utf8::downgrade()> works, that result is used; otherwise, the equivalent of
-C<utf8::encode()> is used, and a warning is issued about wide characters
-(L</Diagnostics>).
+Since v5.12.0, it has been deprecated to use certain characters in
+user-defined C<\N{...}> character names.  These now cause a syntax
+error.  For example, it is now an error to begin a name with a digit,
+such as in
 
-=head2 C<given> now aliases the global C<$_>
+ my $undraftable = "\N{4F}";    # Syntax error!
 
-Instead of assigning to an implicit lexical C<$_>, C<given> now makes the
-global C<$_> an alias for its argument, just like C<foreach>.  However, it
-still uses lexical C<$_> if there is lexical C<$_> in scope (again, just like
-C<foreach>).
+or to have commas anywhere in the name.  See L<charnames/CUSTOM ALIASES>
 
 =head1 Deprecations
 
@@ -86,7 +99,8 @@ There may well be none in a stable release.
 
 =item *
 
-XXX
+Lists of lexical variable declarations (C<my($x, $y)>) are now optimised
+down to a single op, and are hence faster than before.
 
 =back
 
@@ -118,143 +132,45 @@ XXX
 
 =item *
 
-L<B> has been upgraded from version 1.36 to 1.37.  All C<CVf_*> and C<GVf_*>
-and more SV-related flag values are now provided as constants in the C<B::>
-namespace and available for export.  The default export list has not changed.
-
-=item *
-
-L<B::Concise> has been upgraded from version 0.91 to 0.92.  The C<-nobanner>
-option has been fixed, and C<format>s can now be dumped.  When passed a sub
-name to dump, it will check also to see whether it is the name of a format.  If
-a sub and a format share the same name, it will dump both.
-
-=item *
-
-L<B::Deparse> has been upgraded from version 1.15 to 1.16.  It now deparses
-loop controls with the correct precedence, and multiple statements in a
-C<format> line are also now deparsed correctly.
-
-=item *
-
-L<Compress::Raw::Bzip2> has been upgraded from version 2.05201 to 2.055.  The
-misuse of Perl's "magic" API has been fixed.
-
-=item *
-
-L<Compress::Raw::Zlib> has been upgraded from version 2.05401 to 2.056.  The
-misuse of Perl's "magic" API has been fixed.
-
-=item *
-
-L<Compress::Zlib> has been upgraded from version 2.052 to 2.055.
-C<compress()>, C<uncompress()>, C<memGzip()> and C<memGunzip()> have been
-speeded up by making parameter validation more efficient.
+L<Carp> has been upgraded from version 1.27 to 1.28.
 
-=item *
-
-L<Data::Dumper> has been upgraded from version 2.135_06 to 2.135_07.  It has
-been optimized to only build a seen-scalar hash as necessary, thereby speeding
-up serialization drastically.
-
-=item *
-
-L<Devel::Peek> has been upgraded from version 1.08 to 1.09.  The only change
-has been to the test script, to account for changes to some flags in perl's
-internals.
+Carp is no longer confused when C<caller> returns undef for a package that
+has been deleted.
 
 =item *
 
-L<Encode> has been upgraded from version 2.44 to 2.47.  The Mac alias x-mac-ce
-has been added, and various bugs have been fixed in Encode::Unicode,
-Encode::UTF7 and Encode::GSM0338.
+L<CPAN> has been upgraded from version 1.98 to 1.99_51.
 
 =item *
 
-L<Module::Build> has been upgraded from version 0.40 to 0.4002.  A minor bug
-fix allows markup to be used around the leading "Name" in a POD "abstract"
-line, and some documentation improvements have been made.
+L<DynaLoader> has been upgraded from version 1.16 to 1.17.
 
 =item *
 
-L<Module::CoreList> has been upgraded from version 2.69 to 2.70.  Version
-information is now stored as a delta, which greatly reduces the size of the
-F<CoreList.pm> file.
-
-=item *
-
-L<Module::Load::Conditional> has been upgraded from version 0.50 to 0.54.
-Various enhancements include the new use of Module::Metadata.
-
-=item *
-
-L<Module::Metadata> has been upgraded from version 1.000009 to 1.000010.  The
-creation of a Module::Metadata object for a typical module file has been sped
-up by about 40%.
-
-=item *
-
-L<Module::Pluggable> has been upgraded from version 4.0 to 4.2.  Amongst other
-changes, triggers are now allowed on events, which gives a powerful way to
-modify behaviour.
-
-=item *
-
-L<Pod::Simple> has been upgraded from version 3.20 to 3.23.  Numerous
-improvements have been made, mostly to Pod::Simple::XHTML, which also has a
-compatibility change: the C<codes_in_verbatim> option is now disabled by
-default.  See F<cpan/Pod-Simple/ChangeLog> for the full details.
-
-=item *
+L<Env> has been upgraded from version 1.03 to 1.04.
 
-L<re> has been upgraded from version 0.21 to 0.22.  Single character [class]es
-like C</[s]/> or C</[s]/i> are now optimized as if they did not have the
-brackets, i.e. C</s/> or C</s/i>.
+Its SPLICE implementation no longer misbehaves in list context.
 
 =item *
 
-L<Socket> has been upgraded from version 2.002 to 2.003.  Constants and
-functions required for IP multicast source group membership have been added.
+L<Tie::Hash::NamedCapture> has been upgraded from version 0.08 to 0.09.
 
-=item *
-
-L<Storable> has been upgraded from version 2.37 to 2.38.  It can now freeze
-and thaw vstrings correctly.  This causes a slight incompatible change in
-the storage format, so the format version has increased to 2.9.
-
-=item *
-
-L<Sys::Syslog> has been upgraded from version 0.29 to 0.30.  An issue with
-C<POSIX::strftime()> on Windows and a build problem on Haiku-OS have been
-resolved, and <getservbyname()> is no longer called when the port is specified.
-
-=item *
-
-L<Time::Local> has been upgraded from version 1.2000 to 1.2300.  Seconds values
-greater than 59 but less than 60 no longer cause C<timegm()> and C<timelocal()>
-to croak.
-
-=item *
-
-L<Unicode::UCD> has been upgraded from version 0.44 to 0.45.  This has been
-modified slightly for reasons of perl internal use only.
+=back
 
-=item *
+=head2 Removed Modules and Pragmata
 
-L<Win32> has been upgraded from version 0.44 to 0.45.  New APIs have been added
-for getting and setting the current code page.
+=over 4
 
 =item *
 
-L<Win32CORE> has been upgraded from version 0.02 to 0.03.  The use of
-PERL_NO_GET_CONTEXT here has resulted in smaller machine code.
+XXX
 
 =back
 
 =head1 Documentation
 
-XXX Changes to files in F<pod/> go here.  Consider grouping entries by file and
-be sure to link to the appropriate page, e.g. L<perlfunc>.
+XXX Changes to files in F<pod/> go here.  Consider grouping entries by
+file and be sure to link to the appropriate page, e.g. L<perlfunc>.
 
 =head2 New Documentation
 
@@ -270,15 +186,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<perlfunc>, L<perlop>
+=head3 L<perlref>
 
 =over 4
 
 =item *
 
-Loop control verbs (C<dump>, C<goto>, C<next>, C<last> and C<redo>) have
-always had the same precedence as assignment operators, but this was never
-documented until now.
+C<*foo{NAME}> and C<*foo{PACKAGE}>, which have existed since perl 5.005,
+are now documented.
 
 =back
 
@@ -302,13 +217,7 @@ and New Warnings
 
 =item *
 
-L<Unterminated delimiter for here document|perldiag/"Unterminated delimiter for here document">
-
-This message now occurs when a here document label has an initial quotation
-mark but the final quotation mark is missing.
-
-This replaces a bogus and misleading error message about not finding the
-label itself [perl #114104].
+XXX L<message|perldiag/"message">
 
 =back
 
@@ -318,10 +227,7 @@ label itself [perl #114104].
 
 =item *
 
-L<Wide character in setenv|perldiag/"Wide character in %s">
-
-Attempts to put wide characters into environment variables via C<%ENV> now
-provoke this warning.
+XXX L<message|perldiag/"message">
 
 =back
 
@@ -401,7 +307,7 @@ 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/>
+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.
 
@@ -415,13 +321,13 @@ XXX
 
 =head2 Discontinued Platforms
 
-XXX List any platforms that this version of perl no longer compiles on.
-
 =over 4
 
-=item XXX-some-platform
+=item EPOC
 
-XXX
+Support code relating to EPOC has been removed.  EPOC was a family of
+operating systems developed by Psion for mobile devices.  It was the
+predecessor of Symbian.  The port was last updated in April 2002.
 
 =back
 
@@ -452,7 +358,24 @@ well.
 
 =item *
 
-XXX
+The private Perl_croak_no_modify has had its context parameter removed. It is
+now has a void prototype. Users of the public API croak_no_modify remain
+unaffected.
+
+=item *
+
+Copy-on-write (shared hash key) scalars are no longer marked read-only.
+C<SvREADONLY> returns false on such an SV, but C<SvIsCOW> still returns
+true.
+
+=item *
+
+A new op type, C<OP_PADRANGE> has been introduced. The perl peephole
+optimiser will, where possible, substitute a single padrange op for a
+pushmark followed by one or more pad ops, and possibly also skipping list
+and nextstate ops. In addition, the op can carry out the tasks associated
+with the RHS of a my(...) = @_ assignment, so those ops may be optimised
+away too.
 
 =back
 
@@ -467,111 +390,96 @@ files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
 
 =item *
 
-C<\w> now matches the code points U+200C (ZERO WIDTH NON-JOINER) and
-U+200D (ZERO WIDTH JOINER).  C<\W> no longer matches these.  This change
-is because Unicode corrected their definition of what C<\w> should match.
-
-=item *
-
-C<dump LABEL> no longer leaks its label.
-
-=item *
-
-Constant folding no longer changes the behaviour of functions like C<stat()>
-and C<truncate()> that can take either filenames or handles.
-C<stat 1 ? foo : bar> nows treats its argument as a file name (since it is
-an arbitrary expression), rather than the handle "foo".
-
-=item *
-
-C<truncate FOO, $len> no longer falls back to treating "FOO" as a file name
-if the filehandle has been deleted.  This was broken in Perl 5.16.0.
+Uninitialized warnings mentioning hash elements would only mention the
+element name if it was not in the first bucket of the hash, due to an
+off-by-one error.
 
 =item *
 
-Subroutine redefinitions after sub-to-glob and glob-to-glob assignments no
-longer cause double frees or panic messages.
+A regular expression optimizer bug could cause multiline "^" to behave
+incorrectly in the presence of line breaks, such that
+C<"/\n\n" =~ m#\A(?:^/$)#im> would not match [perl #115242].
 
 =item *
 
-C<s///> now turns vstrings into plain strings when performing a
-substitution, even if the resulting string is the same (C<s/a/a/>).
+Failed C<fork> in list context no longer currupts the stack.
+C<@a = (1, 2, fork, 3)> used to gobble up the 2 and assign C<(1, undef, 3)>
+if the C<fork> call failed.
 
 =item *
 
-Prototype mismatch warnings no longer erroneously treat constant subs as
-having no prototype when they actually have "".
+Numerous memory leaks have been fixed, mostly involving tied variables that
+die, regular expression character classes and code blocks, and syntax
+errors.
 
 =item *
 
-Constant subroutines and forward declarations no longer prevent prototype
-mismatch warnings from omitting the sub name.
+Assigning a regular expression (C<${qr//}>) to a variable that happens to
+hold a floating point number no longer causes assertion failures on
+debugging builds.
 
 =item *
 
-C<undef> on a subroutine now clears call checkers.
+Assigning a regular expression to a scalar containing a number no longer
+causes subsequent nummification to produce random numbers.
 
 =item *
 
-The C<ref> operator started leaking memory on blessed objects in Perl
-5.16.0.  This has been fixed [perl #114340].
+Assigning a regular expression to a magic variable no longer wipes away the
+magic.  This is a regression from 5.10.
 
 =item *
 
-C<use> no longer tries to parse its arguments as a statement, making
-C<use constant { () };> a syntax error [perl #114222].
+Assigning a regular expression to a blessed scalar no longer results in
+crashes.  This is also a regression from 5.10.
 
 =item *
 
-On debugging builds, "uninitialized" warnings inside formats no longer
-cause assertion failures.
+Regular expression can now be assigned to tied hash and array elements with
+flattening into strings.
 
 =item *
 
-On debugging builds, subroutines nested inside formats no longer cause
-assertion failures [perl #78550].
+Nummifying a regular expression no longer results in an uninitialized
+warning.
 
 =item *
 
-C<print $x> and C<sub { print $x }->()> now always produce the same output.
-It was possible for the latter to refuse to close over $x if the variable
-was not active; e.g., if it was defined outside a currently-running named
-subroutine.
+Negative array indices no longer cause EXISTS methods of tied variables to
+be ignored.  This is a regression from 5.12.
 
 =item *
 
-Similarly, C<print $x> and C<print eval '$x'> now produce the same output.
-This also allows "my $x if 0" variables to be seen in the debugger
-[perl #114018].
+Negative array indices no longer result in crashes on arrays tied to
+non-objects.
 
 =item *
 
-Formats called recursively no longer stomp on their own lexical variables,
-but each recursive call has its own set of lexicals.
+C<$x = "(?{})"; /a++(?{})+$x/x> no longer erroneous produces an error (just
+a warning, as expected).  This was broken in 5.17.1.
 
 =item *
 
-Attempting to free an active format or the handle associated with it no
-longer results in a crash.
+C<$byte_overload .= $utf8> no longer results in doubly-encoded UTF8 if the
+left-hand scalar happened to have produced a UTF8 string the last time
+overloading was invoked.
 
 =item *
 
-Format parsing no longer gets confused by braces, semicolons and
-low-precedence operators.  It used to be possible to use braces as format
-delimiters (instead of C<=> and C<.>), but only sometimes.  Semicolons and
-low-precedence operators in format argument lines no longer confuse the
-parser into ignoring the line's return value.  In format argument lines,
-braces can now be used for anonymous hashes, instead of being treated
-always as C<do> blocks.
+C<goto &sub> now uses the current value of @_, instead of using the array
+the subroutine was originally called with.  This means
+C<local @_ = (...); goto &sub> now works [perl #43077].
 
 =item *
 
-Formats can now be nested inside code blocks in regular expressions and
-other quoted constructs (C</(?{...})/> and C<qq/${...}/>) [perl #114040].
+If a debugger is invoked recursively, it no longer stomps on its own
+lexical variables.  Formerly under recursion all calls would share the same
+set of lexical variables [perl #115742].
 
 =item *
 
-Formats are no longer created after compilation errors.
+C<*_{ARRAY}> returned from a subroutine no longer spontaneously
+becomes empty.
 
 =back
 
@@ -600,7 +508,7 @@ here.
 
 XXX Generate this with:
 
-  perl Porting/acknowledgements.pl v5.17.2..HEAD
+  perl Porting/acknowledgements.pl v5.17.5..HEAD
 
 =head1 Reporting Bugs