This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta entries for 088225f
[perl5.git] / pod / perldelta.pod
index 53f8785..d7fa8e4 100644 (file)
@@ -688,6 +688,28 @@ such as signal handlers being wiped when modules were loaded, etc.
 This has been fixed (or the feature has been removed, depending on how you see
 it).
 
+=head3 local($_) will strip all magic from $_
+
+local() on scalar variables will give them a new value, but keep all
+their magic intact.  This has proven to be problematic for the default
+scalar variable $_, where L<perlsub> recommends that any subroutine
+that assigns to $_ should localize it first.  This would throw an
+exception if $_ is aliased to a read-only variable, and could have
+various unintentional side-effects in general.
+
+Therefore, as an exception to the general rule, local($_) will not
+only assign a new value to $_, but also remove all existing magic from
+it as well.
+
+=head3 Parsing of package and variable names
+
+The parsing of the names of packages and package variables has changed, in
+that multiple adjacent pairs of colons (as in foo::::bar) are all treated
+as package separators.
+
+Regardless of this change, the exact parsing of package separators has
+never been guaranteed and is subject to change in future Perl versions.
+
 =head2 Changes to Syntax or to Perl Operators
 
 =head3 C<given> return values
@@ -780,6 +802,13 @@ If it is absolutely necessary to have empty attribute lists (for example,
 because of a code generator) then avoid the error by adding a space before
 the C<=>.
 
+=head3 Change in the parsing of identifiers
+
+Characters outside the Unicode "XIDStart" set are no longer allowed at the
+beginning of an identifier.  This means that certain accents and marks
+that normally follow an alphabetic character may no longer be the first
+character of an identifier.
+
 =head2 Threads and Processes
 
 =head3 Directory handles not copied to threads
@@ -924,7 +953,7 @@ L<Unicode::Casing>, which provides improved functionality.
 
 The following modules will be removed from the core distribution in a
 future release, and should be installed from CPAN instead. Distributions
-on CPAN which require these should add them to their prerequisites. The
+on CPAN which require these should add them to their prerequisites.  The
 core versions of these modules will issue a deprecation warning.
 
 If you ship a packaged version of Perl, either alone or as part of a
@@ -959,10 +988,10 @@ preference, as it offers significantly improved profiling and reporting.
 
 =head2 "Safe signals" optimisation
 
-Signal dispatch has been moved from the runloop into control ops. This
+Signal dispatch has been moved from the runloop into control ops.  This
 should give a few percent speed increase, and eliminates almost all of
 the speed penalty caused by the introduction of "safe signals" in
-5.8.0. Signals should still be dispatched within the same statement as
+5.8.0.  Signals should still be dispatched within the same statement as
 they were previously - if this is not the case, or it is possible to
 create uninterruptible loops, this is a bug, and reports are encouraged
 of how to recreate such issues.
@@ -1020,7 +1049,7 @@ been).
 
 When an object has many weak references to it, freeing that object
 can under some some circumstances take O(N^2) time to free (where N is the
-number of references). The number of circumstances has been reduced
+number of references).  The number of circumstances has been reduced
 [perl #75254]
 
 =head2 Lexical array and hash assignments
@@ -1039,7 +1068,7 @@ the subroutine is called [perl #72416].
 =head2 Size optimisations to SV and HV structures
 
 xhv_fill has been eliminated from struct xpvhv, saving 1 IV per hash and
-on some systems will cause struct xpvhv to become cache-aligned. To avoid
+on some systems will cause struct xpvhv to become cache-aligned.  To avoid
 this memory saving causing a slowdown elsewhere, boolean use of HvFILL
 now calls HvTOTALKEYS instead (which is equivalent) - so while the fill
 data when actually required are now calculated on demand, the cases when
@@ -1066,7 +1095,8 @@ uses Exporter but doesn't use this functionality.
 =head2 Memory savings for weak references
 
 For weak references, the common case of just a single weak reference per
-referent has been optimised to reduce the storage required. In this case it
+referent has been optimised to reduce the
+storage required.  In this case it
 saves the equivalent of one small Perl array per referent.
 
 =head2 C<%+> and C<%-> use less memory
@@ -1114,22 +1144,22 @@ at compile time.
 C<CPAN::Meta::YAML> 0.003 has been added as a dual-life module.  It supports a
 subset of YAML sufficient for reading and writing META.yml and MYMETA.yml files
 included with CPAN distributions or generated by the module installation
-toolchain. It should not be used for any other general YAML parsing or
+toolchain.  It should not be used for any other general YAML parsing or
 generation task.
 
 =item *
 
-C<CPAN::Meta> version 2.110440 has been added as a dual-life module. It
+C<CPAN::Meta> version 2.110440 has been added as a dual-life module.  It
 provides a standard library to read, interpret and write CPAN distribution
 metadata files (e.g. META.json and META.yml) which describes a
 distribution, its contents, and the requirements for building it and
-installing it. The latest CPAN distribution metadata specification is
+installing it.  The latest CPAN distribution metadata specification is
 included as C<CPAN::Meta::Spec> and notes on changes in the specification
 over time are given in C<CPAN::Meta::History>.
 
 =item *
 
-C<HTTP::Tiny> 0.011 has been added as a dual-life module.  It is a very
+C<HTTP::Tiny> 0.012 has been added as a dual-life module.  It is a very
 small, simple HTTP/1.1 client designed for simple GET requests and file
 mirroring.  It has has been added to enable CPAN.pm and CPANPLUS to
 "bootstrap" HTTP access to CPAN using pure Perl without relying on external
@@ -1159,7 +1189,7 @@ a single location for easier maintenance.
 =item *
 
 The following modules were added by the C<Unicode::Collate> 
-upgrade. See below for details.
+upgrade.  See below for details.
 
 C<Unicode::Collate::CJK::Big5>
 
@@ -1306,7 +1336,7 @@ C<Benchmark> has been upgraded from version 1.11 to 1.12.
 
 =item *
 
-C<bignum> has been upgraded from version 0.23 to 0.26.
+C<bignum> has been upgraded from version 0.23 to 0.27.
 
 =item *
 
@@ -1506,7 +1536,7 @@ Exporter no longer overrides C<$SIG{__WARN__}> [perl #74472]
 
 =item *
 
-C<ExtUtils::CBuilder> has been upgraded from version 0.27 to 0.280202.
+C<ExtUtils::CBuilder> has been upgraded from version 0.27 to 0.280203.
 
 =item *
 
@@ -1547,7 +1577,7 @@ C<Fcntl> has been upgraded from version 1.06 to 1.11.
 
 =item *
 
-C<File::Basename> has been upgraded from version 2.78 to 2.81.
+C<File::Basename> has been upgraded from version 2.78 to 2.82.
 
 =item *
 
@@ -1837,7 +1867,7 @@ C<PerlIO::via> has been upgraded from version 0.09 to 0.11.
 
 =item *
 
-C<Pod::Html> has been upgraded from version 1.09 to 1.1.
+C<Pod::Html> has been upgraded from version 1.09 to 1.11.
 
 =item *
 
@@ -2185,7 +2215,7 @@ See L</perlhack and perlrepository revamp>, below.
 =head3 L<perlmodlib> is now complete
 
 The perlmodlib page that came with Perl 5.12.0 was missing a lot of
-modules, due to a bug in the script that generates the list. This has been
+modules, due to a bug in the script that generates the list.  This has been
 fixed [perl #74332] (5.12.1).
 
 =head3 Replace wrong tr/// table in L<perlebcdic>
@@ -2279,7 +2309,7 @@ L<perlbook> has been expanded to cover many more popular books.
 
 The documentation for the C<SvTRUE> macro in
 L<perlapi> was simply wrong in stating that
-get-magic is not processed. It has been corrected.
+get-magic is not processed.  It has been corrected.
 
 =head3 L<perlvar> revamp
 
@@ -2299,7 +2329,7 @@ C<use locale> affects formats.
 
 =head3 L<overload>
 
-L<overload>'s documentation has practically undergone a rewrite. It
+L<overload>'s documentation has practically undergone a rewrite.  It
 is now much more straightforward and clear.
 
 =head3 perlhack and perlrepository revamp
@@ -2308,13 +2338,15 @@ The L<perlhack> and perlrepository documents have been heavily edited and
 split up into several new documents.
 
 The L<perlhack> document is now much shorter, and focuses on the Perl 5
-development process and submitting patches to Perl. The technical content has
+development process and submitting patches
+to Perl.  The technical content has
 been moved to several new documents, L<perlsource>, L<perlinterp>,
-L<perlhacktut>, and L<perlhacktips>. This technical content has only been
+L<perlhacktut>, and L<perlhacktips>.  This technical content has only been
 lightly edited.
 
-The perlrepository document has been renamed to L<perlgit>. This new document
-is just a how-to on using git with the Perl source code. Any other content
+The perlrepository document has been renamed to
+L<perlgit>.  This new document is just a how-to
+on using git with the Perl source code.  Any other content
 that used to be in perlrepository has been moved to perlhack.
 
 =head3 Time::Piece examples
@@ -2393,8 +2425,8 @@ deprecated so as to reserve its use for Perl itself in a future release.
 =item Operation "%s" returns its argument for ...
 
 Performing an operation requiring Unicode semantics (such as case-folding)
-on a Unicode surrogate or a non-Unicode character now triggers a warning:
-'Operation "%s" returns its argument for ...'.
+on a Unicode surrogate or a non-Unicode character now triggers this
+warning.
 
 =item Use of qw(...) as parentheses is deprecated
 
@@ -2597,13 +2629,14 @@ Perl now builds on AIX 4.2 (5.12.1).
 =item Apollo DomainOS
 
 The last vestiges of support for this platform have been excised from the
-Perl distribution. It was officially discontinued in version 5.12.0. It had
+Perl distribution.  It was officially discontinued
+in version 5.12.0.  It had
 not worked for years before that.
 
 =item MacOS Classic
 
 The last vestiges of support for this platform have been excised from the
-Perl distribution. It was officially discontinued in an earlier version.
+Perl distribution.  It was officially discontinued in an earlier version.
 
 =back
 
@@ -2681,11 +2714,21 @@ Perl now allows -Duse64bitint without promoting to use64bitall on HP-UX
 
 =head3 IRIX
 
+=over
+
+=item *
+
 Conversion of strings to floating-point numbers is now more accurate on
 IRIX systems [perl #32380].
 
+=back
+
 =head3 Mac OS X
 
+=over
+
+=item *
+
 Early versions of Mac OS X (Darwin) had buggy implementations of the
 C<setregid>, C<setreuid>, C<setrgid> and C<setruid> functions, so perl
 would pretend they did not exist.
@@ -2693,35 +2736,67 @@ would pretend they did not exist.
 These functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and
 higher, as they have been fixed [perl #72990].
 
+=back
+
 =head3 MirBSD
 
+=over
+
+=item *
+
 Previously if you built perl with a shared libperl.so on MirBSD (the
 default config), it would work up to the installation; however, once
 installed, it would be unable to find libperl.  So path handling is now
 treated as in the other BSD dialects.
 
+=back
+
 =head3 NetBSD
 
+=over
+
+=item *
+
 The NetBSD hints file has been changed to make the system's malloc the
 default.
 
+=back
+
 =head3 Recent OpenBSDs now use perl's malloc
 
+=over
+
+=item *
+
 OpenBSD E<gt> 3.7 has a new malloc implementation which is mmap-based
 and as such can release memory back to the OS; however, perl's use of
 this malloc causes a substantial slowdown so we now default to using
 perl's malloc instead [perl #75742].
 
+=back
+
 =head3 OpenVOS
 
+=over
+
+=item *
+
 perl now builds again with OpenVOS (formerly known as Stratus VOS)
 [perl #78132] (5.12.3).
 
+=back
+
 =head3 Solaris
 
-DTrace is now supported on Solaris. There used to be build failures, but
+=over
+
+=item *
+
+DTrace is now supported on Solaris.  There used to be build failures, but
 these have been fixed [perl #73630] (5.12.3).
 
+=back
+
 =head3 VMS
 
 =over
@@ -2780,7 +2855,8 @@ introduction of spurious line breaks whenever the perlio buffer fills up.
 
 =item *
 
-F<git_version.h> is now installed on VMS. This was an oversight in v5.12.0 which
+F<git_version.h> is now installed on VMS.  This
+was an oversight in v5.12.0 which
 caused some extensions to fail to build (5.12.2).
 
 =item *
@@ -2962,7 +3038,7 @@ supported but discouraged.
 
 It is now possible for XS code to hook into Perl's lexical scope
 mechanism at compile time, using the new C<Perl_blockhook_register>
-function. See L<perlguts/"Compile-time scope hooks">.
+function.  See L<perlguts/"Compile-time scope hooks">.
 
 =head3 The recursive part of the peephole optimizer is now hookable
 
@@ -3150,11 +3226,8 @@ C<UNICODE_ALLOW_FDD0>, C<UNICODE_ALLOW_FFFF>, C<UNICODE_ILLEGAL>, and
 C<UNICODE_IS_ILLEGAL> have been removed, as they stem from a
 fundamentally broken model of how the Unicode non-character code points
 should be handled, which is now described in
-L<perlunicode/Non-character code points>.  See also L</Selected Bug Fixes>.
-
-XXX Which bugs in particular? Selected Bug Fixes is too long for this link
-to be meaningful right now
-I don't see the bugs in that section currently -- khw
+L<perlunicode/Non-character code points>.  See also the Unicode section
+under L</Selected Bug Fixes>.
 
 =head2 Deprecated C APIs
 
@@ -3182,7 +3255,8 @@ its design was insufficient for reliably getting the lexical C<$_> at
 run-time.
 
 Use the new C<find_rundefsv> function or the C<UNDERBAR> macro
-instead. They directly return the right SV representing C<$_>, whether it's
+instead.  They directly return the right SV
+representing C<$_>, whether it's
 lexical or dynamic.
 
 =item C<CALL_FPTR> and C<CPERLscope>
@@ -3268,12 +3342,12 @@ cause perl to crash whenever the glob's contents were accessed
 =item *
 
 PerlIO no longer crashes when called recursively, e.g., from a signal
-handler. Now it just leaks memory [perl #75556].
+handler.  Now it just leaks memory [perl #75556].
 
 =item *
 
 Most I/O functions were not warning for unopened handles unless the
-'closed' and 'unopened' warnings categories were both enabled. Now only
+'closed' and 'unopened' warnings categories were both enabled.  Now only
 C<use warnings 'unopened'> is necessary to trigger these warnings (as was
 always meant to be the case).
 
@@ -3347,7 +3421,7 @@ unrecognized escape sequences, passed-through.
 
 A regular expression match in the right-hand side of a global substitution
 (C<s///g>) that is in the same scope will no longer cause match variables
-to have the wrong values on subsequent iterations. This can happen when an
+to have the wrong values on subsequent iterations.  This can happen when an
 array or hash subscript is interpolated in the right-hand side, as in
 C<s|(.)|@a{ print($1), /./ }|g> [perl #19078].
 
@@ -3400,7 +3474,7 @@ point it is.
 =item *
 
 The C<(?|...)> regular expression construct no longer crashes if the final
-branch has more sets of capturing parentheses than any other branch. This
+branch has more sets of capturing parentheses than any other branch.  This
 was fixed in Perl 5.10.1 for the case of a single branch, but that fix did
 not take multiple branches into account [perl #84746].
 
@@ -3466,7 +3540,7 @@ to turn into
 
   $text =~ /phoo/
 
-at compile time. Now it correctly matches against C<$_> [perl #20444].
+at compile time.  Now it correctly matches against C<$_> [perl #20444].
 
 =item *
 
@@ -3486,12 +3560,6 @@ such as U+387 [perl #74022].
 
 =item *
 
-Several contexts no longer allow a Unicode character to begin a word
-that should never begin words, for an example an accent that must follow
-another character previously could precede all other characters.
-
-=item *
-
 Defining a constant with the same name as one of perl's special blocks
 (e.g., INIT) stopped working in 5.12.0, but has now been fixed
 [perl #78634].
@@ -3508,7 +3576,8 @@ is no longer treated as a constant [perl #63540].
 
 =item *
 
-C<state> can now be used with attributes. It used to mean the same thing as
+C<state> can now be used with attributes.  It
+used to mean the same thing as
 C<my> if attributes were present [perl #68658].
 
 =item *
@@ -3587,7 +3656,7 @@ the assignment contained a subroutine.
 
 C<PL_isarev>, which is accessible to Perl via C<mro::get_isarev> is now
 updated properly when packages are deleted or removed from the C<@ISA> of
-other classes. This allows many packages to be created and deleted without
+other classes.  This allows many packages to be created and deleted without
 causing a memory leak [perl #75176].
 
 =back
@@ -3623,7 +3692,7 @@ means the following code will no longer crash:
 =item *
 
 Assigning a glob to a PVLV used to convert it to a plain string. Now it
-works correctly, and a PVLV can hold a glob. This would happen when a
+works correctly, and a PVLV can hold a glob.  This would happen when a
 nonexistent hash or array element was passed to a subroutine:
 
   sub { $_[0] = *foo }->($hash{key});
@@ -3645,7 +3714,7 @@ cases.
 During the restoration of a localised typeglob on scope exit, any
 destructors called as a result would be able to see the typeglob in an
 inconsistent state, containing freed entries, which could result in a
-crash. This would affect code like this:
+crash.  This would affect code like this:
 
   local *@;
   eval { die bless [] }; # puts an object in $@
@@ -3654,10 +3723,26 @@ crash. This would affect code like this:
   }
 
 Now the glob entries are cleared before any destructors are called. This
-also means that destructors can vivify entries in the glob. So perl tries
+also means that destructors can vivify entries in the glob.  So perl tries
 again and, if the entries are re-created too many times, dies with a
 'panic: gp_free...' error message.
 
+=item *
+
+If a typeglob is freed while a subroutine attached to it is still
+referenced elsewhere, the subroutine is renamed to __ANON__ in the same
+package, unless the package has been undefined, in which case the __ANON__
+package is used.  This could cause packages to be autovivified in some
+cases; e.g., if the package had been deleted.  Now this is no longer the
+case.  The __ANON__ package is now used also when the original package is
+no longer attached to the symbol table.  This avoids memory leaks in some
+cases [perl #87664].
+
+=item *
+
+Subroutines and package variables inside a package whose name ends with
+"::" can now be accessed with a fully qualified name.
+
 =back
 
 =head2 Unicode
@@ -3681,7 +3766,7 @@ There are two known exceptions:
 The now-deprecated user-defined case changing
 functions require utf8-encoded strings to function.  The CPAN module
 L<Unicode::Casing> has been written to replace this feature, without its
-drawacks, and the feature is scheduled to be removed in 5.16
+drawbacks, and the feature is scheduled to be removed in 5.16.
 
 =item 2
 
@@ -3732,7 +3817,7 @@ None of these match.
 
 Also, this matching doesn't fully conform to the current Unicode
 standard, which asks that the matching be made upon the NFD
-(Normalization Form .ecomposed) of the text.  However, as of this
+(Normalization Form Decomposed) of the text.  However, as of this
 writing, March 2010, the Unicode standard is currently in flux about
 what they will recommend doing with regard to such cases.  It may be
 that they will throw out the whole concept of multi-character matches.
@@ -3791,10 +3876,6 @@ too many or too few times have been fixed:
 
 =item *
 
-FETCH is no longer called on tied variables in void context.
-
-=item *
-
 C<$tied-E<gt>()> did not always call FETCH [perl #8438].
 
 =item *
@@ -3823,17 +3904,29 @@ by C<splice @ISA> are respected by method calls) [perl #78400].
 In-memory files created by C<open $fh, 'E<gt>' \$buffer> were not calling
 FETCH/STORE at all [perl #43789] (5.12.2).
 
+=item *
+
+utf8::is_utf8 now respects get-magic (e.g. $1) (5.12.1).
+
 =back
 
 =item *
 
+Non-commutative binary operators used to swap their operands if the same
+tied scalar was used for both operands and returned a different value for
+each FETCH. For instance, if C<$t> returned 2 the first time and 3 the
+second, then C<$t/$t> would evaluate to 1.5. This has been fixed
+[perl #87708].
+
+=item *
+
 String C<eval> now detects taintedness of overloaded or tied
 arguments [perl #75716].
 
 =item *
 
 String C<eval> and regular expression matches against objects with string
-overloading no longer cause memory corruption or crashes [perl 77084].
+overloading no longer cause memory corruption or crashes [perl #77084].
 
 =item *
 
@@ -3886,13 +3979,15 @@ name was not tainted.
 
 =item *
 
-C<sprintf> now dies when passed a tainted scalar for the format. It did
+C<sprintf> now dies when passed a tainted scalar for the format.  It did
 already die for arbitrary expressions, but not for simple scalars
 [perl #82250].
 
 =item *
 
-utf8::is_utf8 now respects get-magic (e.g. $1) (5.12.1).
+C<lc>, C<uc>, C<lcfirst> and C<ucfirst> no longer return untainted strings
+when the argument is tainted.  This has been broken since perl 5.8.9
+[perl #87336].
 
 =back
 
@@ -3929,8 +4024,8 @@ already have values when $^P is assigned to [perl #72422].
 
 C<#line> directives in string evals were not properly updating the arrays
 of lines of code (C<< @{"_<..."} >>) that the debugger (or any debugging or
-profiling module) uses. In threaded builds, they were not being updated at
-all. In non-threaded builds, the line number was ignored, so any change to
+profiling module) uses.  In threaded builds, they were not being updated at
+all.  In non-threaded builds, the line number was ignored, so any change to
 the existing line number would cause the lines to be misnumbered
 [perl #79442].
 
@@ -3956,8 +4051,9 @@ Creating a new thread when directory handles were open used to cause a
 crash, because the handles were not cloned, but simply passed to the new
 thread, resulting in a double free.
 
-Now directory handles are cloned properly, on systems that have a C<fchdir>
-function. On other systems, new threads simply do not inherit directory
+Now directory handles are cloned properly, on Windows
+and on systems that have a C<fchdir> function.  On other
+systems, new threads simply do not inherit directory
 handles from their parent threads [perl #75154].
 
 =item *
@@ -3973,7 +4069,8 @@ separator), had the wrong reference count in child threads.
 =item *
 
 Perl now does a timely cleanup of SVs that are cloned into a new thread but
-then discovered to be orphaned (i.e., their owners are I<not> cloned). This
+then discovered to be orphaned (i.e., their
+owners are I<not> cloned).  This
 eliminates several "scalars leaked" warnings when joining threads.
 
 =back
@@ -4044,7 +4141,7 @@ they were blocked before by C<POSIX::sigprocmask> [perl #82040].
 =item *
 
 A signal handler called within a signal handler could cause leaks or
-double-frees.  Now fixed. [perl #76248].
+double-frees.  Now fixed [perl #76248].
 
 =back
 
@@ -4062,7 +4159,7 @@ L<substr()|perlfunc/"substr EXPR,OFFSET,LENGTH,REPLACEMENT">,
 L<pos()|perlfunc/"index STR,SUBSTR,POSITION">, L<keys()|perlfunc/"keys HASH">,
 and L<vec()|perlfunc/"vec EXPR,OFFSET,BITS"> could, when used in combination
 with lvalues, result in leaking the scalar value they operate on, and cause its
-destruction to happen too late. This has now been fixed.
+destruction to happen too late.  This has now been fixed.
 
 =item *
 
@@ -4239,7 +4336,7 @@ The ref types in the typemap for XS bindings now support magical variables
 =item *
 
 C<sv_catsv_flags> no longer calls C<mg_get> on its second argument (the
-source string) if the flags passed to it do not include SV_GMAGIC. So it
+source string) if the flags passed to it do not include SV_GMAGIC.  So it
 now matches the documentation.
 
 =item *
@@ -4351,6 +4448,12 @@ You can now use the C<keys>, C<values>, C<each> builtin functions on arrays
 This is actually a change introduced in perl 5.12.0, but it was missed from
 that release's perldelta.
 
+=head2 C<split> and C<@_>
+
+C<split> no longer modifies C<@_> when called in scalar or void context.
+In void context it now produces a "Useless use of split" warning.
+This was also a perl 5.12.0 changed that missed the perldelta.
+
 =head1 Obituary
 
 Randy Kobes, creator of the kobesearch alternative to search.cpan.org and