This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Increase stylistic consistency in perldelta by adding C<> and F<>.
[perl5.git] / pod / perldelta.pod
index e067934..2ca6787 100644 (file)
@@ -8,8 +8,7 @@ XXX needs to be processed before release. ]
 perldelta - what is new for perl v5.15.0
 
 =for comment
-This has been completed up to 71edc89419f1, but some commits after that
-already have entries.
+This has been completed up to 3ed94dc04.
 
 =head1 DESCRIPTION
 
@@ -42,6 +41,15 @@ here, but most should go in the L</Performance Enhancements> section.
 The C<CORE::> prefix can now be used on keywords enabled by
 L<feature.pm|feature>, even outside the scope of C<use feature>.
 
+=head2 C<continue> no longer requires the "switch" feature
+
+The C<continue> keyword has two meanings.  It can introduce a C<continue>
+block after a loop, or it can exit the current C<when> block.  Up till now,
+the latter meaning was only valid with the "switch" feature enabled, and
+was a syntax error otherwise.  Since the main purpose of feature.pm is to
+avoid conflicts with user-defined subroutines, there is no reason for
+C<continue> to depend on it.
+
 =head2 C<$$> can be assigned to
 
 C<$$> was made read-only in Perl 5.8.0.  But only sometimes: C<local $$>
@@ -50,6 +58,22 @@ XS code to bypass the read-only check, so there is no reason to keep C<$$>
 read-only.  (This change also allowed a bug to be fixed while maintaining
 backward compatibility.)
 
+=head2 Features inside the debugger
+
+The current Perl's feature bundle is now enabled for commands entered in
+the interactive debugger.
+
+=head2 C<\N{...}> can now have Unicode loose name matching
+
+This is described in the C<charnames> item in
+L</Updated Modules and Pragmata> below.
+
+=head2 Breakpoints with file names
+
+The debugger's "b" command for setting breakpoints now allows a line number
+to be prefixed with a file name.  See
+L<perldebug/"b [file]:[line] [condition]">.
+
 =head1 Security
 
 XXX Any security-related notices go here.  In particular, any security
@@ -62,6 +86,39 @@ L</Selected Bug Fixes> section.
 
 [ List each incompatible change as a =head2 entry ]
 
+=head2 Tying scalars that hold typeglobs
+
+Attempting to tie a scalar after a typeglob was assigned to it would
+instead tie the handle in the typeglob's IO slot.  This meant that it was
+impossible to tie the scalar itself.  Similar problems affected C<tied> and
+C<untie>: C<tied $scalar> would return false on a tied scalar if the last
+thing returned was a typeglob, and C<untie $scalar> on such a tied scalar
+would do nothing.
+
+We fixed this problem before Perl 5.14.0, but it caused problems with some
+CPAN modules, so we put in a deprecation cycle instead.
+
+Now the deprecation has been removed and this bug has been fixed.  So
+C<tie $scalar> will always tie the scalar, not the handle it holds.  To tie
+the handle, use C<tie *$scalar> (with an explicit asterisk).  The same
+applies to C<tied *$scalar> and C<untie *$scalar>.
+
+=head2 IPC::Open3 no longer provides C<xfork()>, C<xclose_on_exec()>
+and C<xpipe_anon()>
+
+All three functions were private, undocumented and unexported.  They do
+not appear to be used by any code on CPAN.  Two have been inlined and one
+deleted entirely.
+
+=head2 C<$$> no longer caches PID
+
+Previously, if one embeds Perl or uses XS and calls fork(3) from C, Perls
+notion of C<$$> could go out of sync with what getpid() returns. By always
+fetching the value of C<$$> via getpid(), this potential bug is eliminated.
+Code that depends on the caching behavior will break.  As described in
+L</Core Enhancements>, C<$$> is now writable, but it will be reset during a
+fork.
+
 =head1 Deprecations
 
 XXX Any deprecated features, syntax, modules etc. should be listed here.
@@ -281,8 +338,8 @@ L<IPC::Open3> has been upgraded from version 1.10 to version 1.11.
 
 =item *
 
-Fixes a bug which prevented use of open3 on Windows when *STDIN, *STDOUT or
-*STDERR had been localized.
+Fixes a bug which prevented use of C<open3> on Windows when C<*STDIN>,
+C<*STDOUT> or C<*STDERR> had been localized.
 
 =item *
 
@@ -292,6 +349,23 @@ Fixes a bug which prevented duplicating numeric file descriptors on Windows.
 
 =item *
 
+L<Math::BigFloat> has been upgraded from version 1.993 to 1.994.
+
+The C<numify> method has been corrected to return a normalised Perl number
+(the result of C<0 + $thing>), instead of a string [rt.cpan.org #66732].
+
+=item *
+
+L<Math::BigInt> has been upgraded from version 1.994 to 1.995.
+
+It provides a new C<bsgn> method that complements the C<babs> method.
+
+It fixes the internal C<objectify> function's handling of "foreign objects"
+so they are converted to the appropriate class (Math::BigInt or
+Math::BigFloat).
+
+=item *
+
 L<Math::Complex> has been upgraded from version 1.56 to version 1.57.
 
 Correct copy constructor usage.
@@ -316,6 +390,13 @@ Eliminated use of C<exists> on array elements which has been deprecated.
 
 =item *
 
+L<ODBM_File> has been upgraded from version 1.10 to version 1.11.
+
+The XS code is now compiled with C<PERL_NO_GET_CONTEXT>, which will aid
+performance under ithreads.
+
+=item *
+
 L<PerlIO::encoding> has been upgraded from version 0.14 to 0.15
 
 =item *
@@ -330,11 +411,7 @@ typeglob has been assigned to $scalar [RT #92258].
 
 =item *
 
-XXX If any changes are made, the version will need to be bumped again.
-What blead has is currently (as of a9d1f3db, 7th of June) identical to
-5.14.1's version.
-
-L<Pod::Perldoc> has been upgraded from version 3.15_03 to 3.15_04.
+L<Pod::Perldoc> has been upgraded from version 3.15_03 to 3.15_05.
 
 It corrects the search paths on VMS [RT #90640].
 
@@ -367,7 +444,7 @@ Updated to CLDR 1.9.1
 
 L<Unicode::Normalize> has been upgraded from version 1.10 to version 1.12
 
-Fixes for the removal of C<unicore/CompositionExclusions.txt> from core.
+Fixes for the removal of F<unicore/CompositionExclusions.txt> from core.
 
 =item *
 
@@ -377,17 +454,33 @@ Integrated changes from bleadperl
 
 =item *
 
+L<charnames> can now be invoked with a new option, C<:loose>,
+which is like the existing C<:full> option, but enables Unicode loose
+name matching.  This means that instead of
+having to get the name of the code point or sequence you want exactly right,
+you can fudge things somewhat.  This is especially useful when
+you don't remember if the official Unicode name uses hyphens or
+blanks between words.  Details are in L<charnames/LOOSE MATCHES>.
+
 XXX
 
 =back
 
 =head2 Removed Modules and Pragmata
 
-=over 4
+As promised in Perl 5.14.0's release notes, the following modules have
+been removed from the core distribution, and if needed should be installed
+from CPAN instead.
+
+=over
 
 =item *
 
-XXX
+L<Devel::DProf> has been removed from the Perl core.  Prior version was 20110228.00.
+
+=item *
+
+L<Shell> has been removed from the Perl core.  Prior version was 0.72_01.
 
 =back
 
@@ -416,7 +509,7 @@ section.
 
 =item *
 
-Added portability caveats related to using kill on forked process.
+Added portability caveats related to using C<kill> on forked process.
 
 =back
 
@@ -638,6 +731,13 @@ USE_LOCALE{,_COLLATE,_CTYPE,_NUMERIC} have been added the output of perl -V
 as they have affect the behaviour of the interpreter binary (albeit only
 in a small area).
 
+=item *
+
+The code and tests for L<IPC::Open2> have been moved from F<ext/IPC-Open2>
+into F<ext/IPC-Open3>, as C<IPC::Open2::open2()> is implemented as a thin
+wrapper around C<IPC::Open3::_open3()>, and hence is very tightly coupled to
+it.
+
 =back
 
 =head1 Testing
@@ -687,7 +787,7 @@ on GNU/Hurd.  C.f. Bug-Debian: http://bugs.debian.org/587901
 
 =item Mac OS X
 
-Clarified apple developer tools requirements in README.macosx
+Clarified apple developer tools requirements in F<README.macosx>
 
 =item MSWin32
 
@@ -753,23 +853,43 @@ $h{$_} for keys %h>.
 
 =item *
 
-The compiled representation of formats is now stored via the mg_ptr of
-their PERL_MAGIC_fm. Previously it was stored in the string buffer,
-beyond SvLEN(), the regular end of the string. SvCOMPILED() and
-SvCOMPILED_{on,off}() now exist solely for compatibility for XS code.
+The compiled representation of formats is now stored via the C<mg_ptr> of
+their C<PERL_MAGIC_fm>. Previously it was stored in the string buffer,
+beyond C<SvLEN()>, the regular end of the string. C<SvCOMPILED()> and
+C<SvCOMPILED_{on,off}()> now exist solely for compatibility for XS code.
 The first is always 0, the other two now no-ops.
 
 =item *
 
 Boyer-Moore compiled scalars are now PVMGs, and the Boyer-Moore tables are now
-stored via the mg_ptr of their PERL_MAGIC_bm. Previously they were PVGVs, with
-the tables stored in the string buffer, beyond SvLEN(). This eliminates the
-last place where the core stores data beyond SvLEN().
+stored via the mg_ptr of their C<PERL_MAGIC_bm>. Previously they were PVGVs,
+with the tables stored in the string buffer, beyond C<SvLEN()>. This eliminates
+the last place where the core stores data beyond C<SvLEN()>.
 
 =item *
 
-C<pos> in lvalue context now returns a PVMG instead of a PVLV, storing the
-target SV in C<mg_obj>, instead of C<LvTARG()>.
+Simplified logic in C<Perl_sv_magic()> introduces a small change of
+behaviour for error cases involving unknown magic types. Previously, if
+C<Perl_sv_magic()> was passed a magic type unknown to it, it would
+
+=over
+
+=item 1.
+
+Croak "Modification of a read-only value attempted" if read only
+
+=item 2.
+
+Return without error if the SV happened to already have this magic
+
+=item 3.
+
+otherwise croak "Don't know how to handle magic of type \\%o"
+
+=back
+
+Now it will always croak "Don't know how to handle magic of type \\%o", even
+on read only values, or SVs which already have the unknown magic type.
 
 =back
 
@@ -861,7 +981,7 @@ passing a reference to C<formline> no longer destroys the reference
 
 =head2 Copy-on-write scalars
 
-Copy-on-write scalars were introduced in 5.6.0, but most Perl code
+Copy-on-write scalars were introduced in 5.8.0, but most Perl code
 did not encounter them (they were used mostly internally).  Perl
 5.10.0 extended them, such that assigning C<__PACKAGE__> or a
 hash key to a scalar would make it copy-on-write.  Several parts
@@ -951,17 +1071,29 @@ Autovivification now works on values returned from lvalue subroutines
 When called in pass-by-reference context (e.g., subroutine arguments or a list
 passed to C<for>), an lvalue subroutine returning arrays or hashes used to bind
 the arrays (or hashes) to scalar variables--something that is not supposed to
-happen.  This could result in "Bizzare copy of ARRAY" errors or C<print>
-ignoring its arguments.  It also made non-sensical code like C<@{\$_}> "work".
+happen.  This could result in "Bizarre copy of ARRAY" errors or C<print>
+ignoring its arguments.  It also made nonsensical code like C<@{\$_}> "work".
 This was fixed in 5.14.0 if an array were the first thing returned from the
 subroutine (but not for C<$scalar, @array> or hashes being returned).  Now a
 more general fix has been applied [RT #23790].
 
 =item *
 
+When called in pass-by-reference context, lvalue subroutines used to copy
+any read-only value that were returned.  E.g., C< sub :lvalue { $] } >
+would not return C<$]>, but a copy of it.
+
+=item *
+
 Assignment to C<keys> returned from an lvalue sub used not to work, but now
 it does.
 
+=item *
+
+Applying the C<:lvalue> attribute to an XSUB or to an aliased subroutine
+stub with C<< sub foo :lvalue; >> syntax stopped working in Perl 5.12.
+This has been fixed.
+
 =back
 
 =head2 Fixes related to hashes
@@ -993,12 +1125,6 @@ fixed [RT #85026].
 
 =item *
 
-Previously, if one embeds Perl or uses XS and calls fork(3) from C, Perl's
-notion of C<$$> could go out of sync with what getpid() returns.  By always
-fetching the value of C<$$> via getpid(), this potential bug is eliminated.
-
-=item *
-
 Passing the same constant subroutine to both C<index> and C<formline> no
 longer causes one or the other to fail [RT #89218].
 
@@ -1083,6 +1209,25 @@ C<ST>
 were previously unrecognized by C<\N{}>,
 vianame(), and string_vianame().
 
+=item *
+
+Some cases of threads crashing due to memory allocation during cloning have
+been fixed [RT #90006].
+
+=item *
+
+Attempting to C<goto> out of a tied handle method used to cause memory
+corruption or crashes.  Now it produces an error message instead
+[RT #8611].
+
+=item *
+
+Perl skips copying values returned from a subroutine if it thinks the value
+is not in use elsewhere.  Due to faulty logic, this would happen with the
+result of C<delete>, C<shift> or C<splice>, even if the result was
+referenced elsewhere.  So C<< \sub { delete $_[0] }->($x) >> would return a
+reference to C<$x>.  This has been fixed [RT #91844].
+
 =back
 
 =head2 Additional fixes by ticket number
@@ -1112,6 +1257,10 @@ from either 5.XXX.XXX or 5.XXX.XXX.
 The fix for RT #36347 causes test failures for C<Gtk2> and C<Tk> on some
 systems [RT #82542].
 
+=item *
+
+The changes to C<tie> cause test failures for the C<JS> module.
+
 =back
 
 =head1 Obituary
@@ -1139,7 +1288,7 @@ analysed by the Perl porting team.
 If the bug you are reporting has security implications, which make it
 inappropriate to send to a publicly archived mailing list, then please send
 it to perl5-security-report@perl.org. This points to a closed subscription
-unarchived mailing list, which includes all the core committers, who be able
+unarchived mailing list, which includes all the core committers, who are able
 to help assess the impact of issues, figure out a resolution, and help
 co-ordinate the release of patches to mitigate or fix the problem across all
 platforms on which Perl is supported. Please only use this address for