This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Maintainers.pl and perldelta.pod for Storable update.
[perl5.git] / pod / perldelta.pod
index a516465..994effe 100644 (file)
@@ -1,9 +1,16 @@
 =encoding utf8
 
 =for comment
-This has been completed up to 157486ae134392, except for:
+This has been completed up to 4df35a07ff9, except for:
 04777d295957ad270188e4debf51b523e07cc5b0
 c565ab54dc649bb62cd4d57149d7b2abb21df5f3
+1c8d11ca3d0ce8bc11562f159b94c2c7e62dea6c
+51698cb360d5bba06e12496ef9c7bf82e3352b71
+0c4d3b5ea916cf640ea163c5a6bcffefade55a1b
+9960802c2b6f4b61c0c7ce718f3ce247a3a13bf1
+2726813d9af5d50f1451663cd931317e7172da50
+8951c461a5079d86be33a432491eda98c24dc397
+I may have missed a few module version bumps.
 
 =head1 NAME
 
@@ -59,6 +66,77 @@ till the end of the lexical scope:
 
 See L<re/'/flags' mode> for details.
 
+=head2 Statement labels can appear in more places
+
+Statement labels can now occur before any type of statement or declaration,
+such as C<package>.
+
+=head2 C<use feature "unicode_strings"> now applies to more regex matching
+
+Another chunk of the L<perlunicode/The "Unicode Bug"> is fixed in this
+release.  Now, regular expressions compiled within the scope of the
+"unicode_strings" feature (or under the "u" regex modifier (specifiable
+currently only with infix notation C<(?u:...)> or via C<use re '/u'>)
+will match the same whether or not the target string is encoded in utf8,
+with regard to C<[[:posix:]]> character classes
+
+Work is underway to add the case sensitive matching to the control of
+this feature, but was not complete in time for this dot release.
+
+=head2 Array and hash container functions accept references
+
+All built-in functions that operate directly on array or hash
+containers now also accept hard references to arrays or hashes:
+
+  |----------------------------+---------------------------|
+  | Traditional syntax         | Terse syntax              |
+  |----------------------------+---------------------------|
+  | push @$arrayref, @stuff    | push $arrayref, @stuff    |
+  | unshift @$arrayref, @stuff | unshift $arrayref, @stuff |
+  | pop @$arrayref             | pop $arrayref             |
+  | shift @$arrayref           | shift $arrayref           |
+  | splice @$arrayref, 0, 2    | splice $arrayref, 0, 2    |
+  | keys %$hashref             | keys $hashref             |
+  | keys @$arrayref            | keys $arrayref            |
+  | values %$hashref           | values $hashref           |
+  | values @$arrayref          | values $arrayref          |
+  | ($k,$v) = each %$hashref   | ($k,$v) = each $hashref   |
+  | ($k,$v) = each @$arrayref  | ($k,$v) = each $arrayref  |
+  |----------------------------+---------------------------|
+
+This allows these built-in functions to act on long dereferencing chains
+or on the return value of subroutines without needing to wrap them in
+C<@{}> or C<%{}>:
+
+  push @{$obj->tags}, $new_tag;  # old way
+  push $obj->tags,    $new_tag;  # new way
+
+  for ( keys %{$hoh->{genres}{artists}} ) {...} # old way 
+  for ( keys $hoh->{genres}{artists}    ) {...} # new way 
+
+For C<push>, C<unshift> and C<splice>, the reference will auto-vivify
+if it is not defined, just as if it were wrapped with C<@{}>.
+
+Calling C<keys> or C<values> directly on a reference gives a substantial
+performance improvement over explicit dereferencing.
+
+For C<keys>, C<values>, C<each>, when overloaded dereferencing is
+present, the overloaded dereference is used instead of dereferencing the
+underlying reftype.  Warnings are issued about assumptions made in the
+following three ambiguous cases:
+
+  (a) If both %{} and @{} overloading exists, %{} is used
+  (b) If %{} overloading exists on a blessed arrayref, %{} is used
+  (c) If @{} overloading exists on a blessed hashref, @{} is used
+
+=head2 y///r
+
+The C</r> flag, which was added to C<s///> in 5.13.2, has been extended to
+the C<y///> operator.
+
+It causes it to perform the substitution on a I<copy> of its operand,
+returning that copy instead of a character count.
+
 =head1 Security
 
 XXX Any security-related notices go here.  In particular, any security
@@ -76,6 +154,52 @@ XXX For a release on a stable branch, this section aspires to be:
 
 [ List each incompatible change as a =head2 entry ]
 
+=head2 Dereferencing typeglobs
+
+If you assign a typeglob to a scalar variable:
+
+    $glob = *foo;
+
+the glob that is copied to C<$glob> is marked with a special flag
+indicating that the glob is just a copy. This allows subsequent assignments
+to C<$glob> to overwrite the glob. The original glob, however, is
+immutable.
+
+Many Perl operators did not distinguish between these two types of globs.
+This would result in strange behaviour in edge cases: C<untie $scalar>
+would do nothing if the last thing assigned to the scalar was a glob
+(because it treated it as C<untie *$scalar>, which unties a handle).
+Assignment to a glob slot (e.g., C<(*$glob) = \@some_array>) would simply
+assign C<\@some_array> to C<$glob>.
+
+To fix this, the C<*{}> operator (including the C<*foo> and C<*$foo> forms)
+has been modified to make a new immutable glob if its operand is a glob
+copy. Various operators that make a distinction between globs and scalars
+have been modified to treat only immutable globs as globs.
+
+This causes an incompatible change in code that assigns a glob to the
+return value of C<*{}> when that operator was passed a glob copy. Take the
+following code, for instance:
+
+    $glob = *foo;
+    *$glob = *bar;
+
+The C<*$glob> on the second line returns a new immutable glob. That new
+glob is made an alias to C<*bar>. Then it is discarded. So the second
+assignment has no effect.
+
+The upside to this incompatible change is that bugs
+L<[perl #77496]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77496>,
+L<[perl #77502]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77502>,
+L<[perl #77508]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77508>,
+L<[perl #77688]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77688>,
+and
+L<[perl #77812]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77812>,
+and maybe others, too, have been fixed.
+
+See L<http://rt.perl.org/rt3/Public/Bug/Display.html?id=77810> for even
+more detail.
+
 =head1 Deprecations
 
 XXX Any deprecated features, syntax, modules etc. should be listed here.
@@ -117,7 +241,20 @@ cribbed.
 
 =item *
 
-XXX
+The following modules were added by the C<Unicode::Collate> 
+upgrade from 0.63 to 0.65. See below for details.
+
+C<Unicode::Collate::CJK::Big5>
+
+C<Unicode::Collate::CJK::GB2312>
+
+C<Unicode::Collate::CJK::JISX0208>
+
+C<Unicode::Collate::CJK::Korean>
+
+C<Unicode::Collate::CJK::Pinyin>
+
+C<Unicode::Collate::CJK::Stroke>
 
 =back
 
@@ -134,9 +271,14 @@ executable.
 
 =item *
 
-XXX What should the version be?
+C<B> has been upgraded from 1.24 to 1.25.
 
-C<B::Deparse> has been upgraded from 0.99 to ???.
+It no longer crashes when taking apart a C<y///> containing characters
+outside the octet range or compiled in a C<use utf8> scope.
+
+=item *
+
+C<B::Deparse> has been upgraded from 0.99 to 1.01.
 
 It fixes deparsing of C<our> followed by a variable with funny characters
 (as permitted under the C<utf8> pragma)
@@ -144,11 +286,13 @@ L<[perl #33752]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=33752>.
 
 =item *
 
-C<charnames> has been upgraded from 1.16 to 1.17.
+C<CGI> has been upgraded from 3.49 to 3.50
+
+This provides the following security fixes: the MIME boundary in 
+multipart_init is now random and improvements to the handling of 
+newlines embedded in header values.
 
-The algorithm used by C<charnames::viacode> to look up names has been
-rewritten to run faster
-L<[perl #75448]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75448>.
+The documentation for param_fetch() has been corrected and clarified.
 
 =item *
 
@@ -156,6 +300,27 @@ C<CPAN> has been upgraded from 1.94_61 to 1.94_62
 
 =item *
 
+C<CPANPLUS> has been upgraded from 0.9007 to 0.9010
+
+Fixes for the SQLite source engine and resolving of issues with the
+testsuite when run under local::lib and/or cpanminus
+
+=item *
+
+C<CPANPLUS::Dist::Build> has been upgraded from 0.48 to 0.50
+
+=item *
+
+C<Data::Dumper> has been upgraded from 2.129 to 2.130.
+
+=item *
+
+C<DynaLoader> has been upgraded from 1.10 to 1.11.
+
+It fixes a buffer overflow when passed a very long file name.
+
+=item *
+
 C<ExtUtils::Constant> has been upgraded from 0.22 to 0.23.
 
 =item *
@@ -164,10 +329,26 @@ C<Fcntl> has been upgraded from 1.09 to 1.10.
 
 =item *
 
+C<File::Fetch> has been upgraded from 0.24 to 0.28
+
+C<HTTP::Lite> is now supported for 'http' scheme.
+
+The C<fetch> utility is supported on FreeBSD, NetBSD and
+Dragonfly BSD for the C<http> and C<ftp> schemes.
+
+=item *
+
 C<File::Glob> has been upgraded from 1.09 to 1.10.
 
 =item *
 
+C<File::stat> has been upgraded from 1.03 to 1.04.
+
+The C<-x> and C<-X> file test operators now work correctly under the root
+user.
+
+=item *
+
 C<GDBM_File> has been upgraded from 1.11 to 1.12.
 
 This fixes a memory leak when DBM filters are used.
@@ -176,7 +357,9 @@ This fixes a memory leak when DBM filters are used.
 
 C<Hash::Util> has been upgraded from 0.09 to 0.10.
 
-This fixes a memory leak when DBM filters are used.
+=item *
+
+C<Hash::Util::FieldHash> has been upgraded from 1.05 to 1.06.
 
 =item *
 
@@ -184,7 +367,30 @@ C<I18N::Langinfo> has been upgraded from 0.06 to 0.07.
 
 =item *
 
-C<Locale::Maketext> has been upgraded from 1.16 to 1.17
+C<Locale::Maketext> has been upgraded from 1.16 to 1.17.
+
+=item *
+
+C<Math::BigInt> has been upgraded from 1.97 to 1.98.
+
+XXX Should the changes be listed here?
+
+=item *
+
+C<Math::BigInt::FastCalc> has been upgraded from 0.22 to 0.24.
+
+XXX Should the changes be listed here?
+
+=item *
+
+C<MIME::Base64> has been upgraded from 3.09 to 3.10
+
+Includes new functions to calculate the length of encoded and decoded
+base64 strings.
+
+=item *
+
+C<mro> has been upgraded from 1.04 to 1.05.
 
 =item *
 
@@ -200,6 +406,20 @@ This fixes a memory leak when DBM filters are used.
 
 =item *
 
+C<Opcode> has been upgraded from 1.16 to 1.17.
+
+=item *
+
+C<parent> has been upgraded from 0.223 to 0.224
+
+=item *
+
+C<Pod::Simple> has been upgraded from 3.14 to 3.15
+
+Includes various fixes to C<HTML> and C<XHTML> handling.
+
+=item *
+
 C<POSIX> has been upgraded from 1.21 to 1.22.
 
 =item *
@@ -209,12 +429,62 @@ C<use re "/flags"> pragma.
 
 =item *
 
+C<Safe> has been upgraded from 2.28 to 2.29.
+
+It adds C<&version::vxs::VCMP> to the default share.
+
+=item *
+
 C<SDBM_File> has been upgraded from 1.07 to 1.08.
 
 =item *
 
+C<SelfLoader> has been upgraded from 1.17 to 1.18.
+
+It now works in taint mode
+L<[perl #72062]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=72062>.
+
+=item *
+
 C<Socket> has been upgraded from 1.90 to 1.91.
 
+=item *
+
+C<Storable> has been upgraded from 2.22 to 2.24
+
+Includes performance improvement for overloaded classes.
+
+=item *
+
+C<Sys::Hostname> has been upgraded from 1.13 to 1.14.
+
+=item *
+
+C<Unicode::Collate> has been upgraded from 0.63 to 0.66
+
+This release newly adds locales C<ja> C<ko> and C<zh> and its variants 
+( C<zh__big5han>, C<zh__gb2312han>, C<zh__pinyin>, C<zh__stroke> ).
+
+The following modules have been added:
+
+C<Unicode::Collate::CJK::Big5> for C<zh__big5han> which makes 
+tailoring of CJK Unified Ideographs in the order of CLDR's big5han ordering.
+
+C<Unicode::Collate::CJK::GB2312> for C<zh__gb2312han> which makes
+tailoring of CJK Unified Ideographs in the order of CLDR's gb2312han ordering.
+
+C<Unicode::Collate::CJK::JISX0208> which makes tailoring of 6355 kanji 
+(CJK Unified Ideographs) in the JIS X 0208 order.
+
+C<Unicode::Collate::CJK::Korean> which makes tailoring of CJK Unified Ideographs 
+in the order of CLDR's Korean ordering.
+
+C<Unicode::Collate::CJK::Pinyin> for C<zh__pinyin> which makes
+tailoring of CJK Unified Ideographs in the order of CLDR's pinyin ordering.
+
+C<Unicode::Collate::CJK::Stroke> for C<zh__stroke> which makes
+tailoring of CJK Unified Ideographs in the order of CLDR's stroke ordering.
+
 =back
 
 =head2 Removed Modules and Pragmata
@@ -232,6 +502,11 @@ XXX
 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>.
 
+L<perlvar> reorders the variables and groups them by topic. Each variable
+introduced after Perl 5.000 notes the first version in which it is 
+available. L<perlvar> also has a new section for deprecated variables to
+note when they were removed.
+
 =head2 New Documentation
 
 XXX Changes which create B<new> files in F<pod/> go here.
@@ -250,8 +525,12 @@ section.
 
 =item *
 
-Array, hash and list slices in scalar context are now documented in
-L<perldata>.
+Array and hash slices in scalar context are now documented in L<perldata>.
+
+=item *
+
+L<perlform> and L<perllocale> have been corrected to state that
+C<use locale> affects formats.
 
 =back
 
@@ -284,7 +563,9 @@ XXX Newly added diagnostic messages go here
 
 =item *
 
-XXX
+"Using !~ with %s doesn't make sense": This message was actually added in
+5.13.2, but was omitted from perldelta. It now applies also to the C<y///>
+operator, and has been documented.
 
 =back
 
@@ -350,7 +631,14 @@ that they represent may be covered elsewhere.
 
 =item *
 
-XXX
+F<t/mro/isarev.t> has been added, which tests that C<PL_isarev> (accessible
+at the Perl level via C<mro::get_isarev>) is updated properly.
+
+=item
+
+F<t/run/switchd-78586.t> has been added, which tests that
+L<[perl #78586]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78586>
+has been fixed (related to line numbers in the debbuger).
 
 =back
 
@@ -397,9 +685,11 @@ L</Modules and Pragmata> section.
 
 =over 4
 
-=item XXX-some-platform
+=item Windows
 
-XXX
+Directory handles are now properly cloned when threads are created. In perl
+5.13.6, child threads simply stopped inheriting directory handles. In
+previous versions, threads would share handles, resulting in crashes.
 
 =back
 
@@ -428,6 +718,49 @@ A new, experimental API has been added for accessing the internal
 structure that Perl uses for C<%^H>. See the functions beginning with
 C<cophh_> in L<perlapi>.
 
+=item *
+
+A stash can now have a list of effective names in addition to its usual
+name. The first effective name can be accessed via the C<HvENAME> macro,
+which is now the recommended name to use in MRO linearisations (C<HvNAME>
+being a fallback if there is no C<HvENAME>).
+
+These names are added and deleted via C<hv_ename_add> and
+C<hv_ename_delete>. These two functions are I<not> part of the API.
+
+=item *
+
+The way the parser handles labels has been cleaned up and refactored. As a
+result, the C<newFOROP()> constructor function no longer takes a parameter
+stating what label is to go in the state op.
+
+=item *
+
+The C<newWHILEOP()> and C<newFOROP()> functions no longer accept a line
+number as a parameter.
+
+=item *
+
+A new C<parse_barestmt()> function has been added, for parsing a statement
+without a label.
+
+=item *
+
+A new C<parse_label()> function has been added, that parses a statement
+labels, separate from statements.
+
+=item *
+
+The C<CvSTASH()> macro can now only be used as an rvalue. C<CvSTASH_set()>
+has been added to replace assignment to C<CvSTASH()>. This is to ensure
+that backreferences are handled properly. These macros are not part of the
+API.
+
+=item *
+
+The C<op_scope()> and C<op_lvalue()> functions have been added to the API,
+but are considered experimental.
+
 =back
 
 =head1 Selected Bug Fixes
@@ -471,6 +804,136 @@ L<[perl #78508]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78508>.
 A memory leak in C<do "file">, introduced in perl 5.13.6, has been fixed
 L<[perl #78488]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78488>.
 
+=item *
+
+Various bugs related to typeglob dereferencing have been fixed. See
+L</Dereferencing typeglobs>, above.
+
+=item *
+
+The C<SvPVbyte> function available to XS modules now calls magic before
+downgrading the SV, to avoid warnings about wide characters
+L<[perl #72398]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=72398>.
+
+=item *
+
+The C<=> operator used to ignore magic (e.g., tie methods) on its
+right-hand side if the scalar happened to hold a typeglob. This could
+happen if a typeglob was the last thing returned from or assigned to a tied
+scalar
+L<[perl #77498]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77498>.
+
+=item *
+
+C<sprintf> was ignoring locales when called with constant arguments
+L<[perl #78632]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78632>.
+
+=item *
+
+A non-ASCII character in the Latin-1 range could match both a Posix
+class, such as C<[[:alnum:]]>, and its inverse C<[[:^alnum:]]>.  This is
+now fixed for regular expressions compiled under the C<"u"> modifier.
+See L</C<use feature "unicode_strings"> now applies to more regex matching>.
+L<[perl #18281]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=18281>.
+
+=item *
+
+Concatenating long strings under C<use encoding> no longer causes perl to
+crash
+L<[perl #78674]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78674>.
+
+=item *
+
+Typeglob assignments would crash if the glob's stash no longer existed, if
+the glob assigned to was named 'ISA' or the glob on either side of the
+assignment contained a subroutine.
+
+=item *
+
+Calling C<< ->import >> on a class lacking an import method could corrupt the stack result in strange behaviour. For instance,
+
+  push @a, "foo", $b = bar->import;
+
+would assign 'foo' to C<$b>
+L<[perl #63790]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=63790>.
+
+=item *
+
+Creating an alias to a package when that package had been detached from the
+symbol table would result in corrupted isa caches
+L<[perl #77358]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77358>.
+
+=item *
+
+C<.=> followed by C<< <> >> or C<readline> would leak memory if C<$/>
+contained characters beyond the octet range and the scalar assigned to
+happened to be encoded as UTF8 internally
+L<[perl #72246]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=72246>.
+
+=item *
+
+The C<recv> function could crash when called with the MSG_TRUNC flag
+L<[perl #75082]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75082>.
+
+=item *
+
+Evaluating a simple glob (like C<*a>) was calling get-magic on the glob,
+even when its contents were not being used
+L<[perl #78580]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78580>.
+
+This bug was introduced in 5.13.2 and did not affect earlier perl versions.
+
+=item *
+
+Matching a Unicode character against an alternation containing characters
+that happened to match continuation bytes in the former's UTF8
+representation (C<qq{\x{30ab}} =~ /\xab|\xa9/>) would cause erroneous
+warnings
+L<[perl #70998]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=70998>.
+
+=item *
+
+C<s///r> (added in 5.13.2) no longer leaks.
+
+=item *
+
+The trie optimisation was not taking empty groups into account, preventing
+'foo' from matching C</\A(?:(?:)foo|bar|zot)\z/>
+L<[perl #78356]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78356>.
+
+=item *
+
+A pattern containing a C<+> inside a lookahead would sometimes cause an
+incorrect match failure in a global match (e.g., C</(?=(\S+))/g>)
+L<[perl #68564]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=68564>.
+
+=item *
+
+Iterating with C<foreach> over an array returned by an lvalue sub now works
+L<[perl #23790]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=23790>.
+
+=item *
+
+C<$@> is now localised during calls to C<binmode> to prevent action at a
+distance
+L<[perl #78844]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78844>.
+
+=item *
+
+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
+causing a memory leak
+L<[perl #75176]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75176>.
+
+=item *
+
+C<undef *Foo::> and C<undef *Foo::ISA> used not to update the internal isa
+caches if the stash or array (respectively) had a reference elsewhere. In
+fact, C<undef *Foo::ISA> would stop a new C<@Foo::ISA> array from updating
+caches
+L<[perl #79024]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=79024>.
+
 =back
 
 =head1 Known Problems
@@ -497,6 +960,11 @@ XXX
 XXX If any significant core contributor has died, we've added a short obituary
 here.
 
+Randy Kobes, creator of the kobesearch alternative to search.cpan.org and
+contributor/maintainer to several core Perl toolchain modules, passed away
+on September 18, 2010 after a battle with lung cancer.  His contributions
+to the Perl community will be missed.
+
 =head1 Acknowledgements
 
 XXX The list of people to thank goes here.