This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update CPAN to CPAN version 1.94_62
[perl5.git] / pod / perldelta.pod
index 87a8592..3669450 100644 (file)
@@ -5,16 +5,16 @@
 [ 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.13.6
+perldelta - what is new for perl v5.13.7
 
 =head1 DESCRIPTION
 
-This document describes differences between the 5.13.5 release and
-the 5.13.6 release.
+This document describes differences between the 5.13.6 release and
+the 5.13.7 release.
 
-If you are upgrading from an earlier release such as 5.13.4, first read
-L<perl5135delta>, which describes differences between 5.13.4 and
-5.13.5.
+If you are upgrading from an earlier release such as 5.13.5, first read
+L<perl5136delta>, which describes differences between 5.13.5 and
+5.13.6.
 
 =head1 Notice
 
@@ -28,45 +28,31 @@ here, but most should go in the L</Performance Enhancements> section.
 
 [ List each enhancement as a =head2 entry ]
 
-=head2  C<(?^...)> regex construct added to signify default modifiers
+=head2 Single term prototype
 
-A caret (also called a "cirumflex accent") C<"^"> immediately following
-a C<"(?"> in a regular expression now means that the subexpression is to
-not inherit the surrounding modifiers such as C</i>, but to revert to the
-Perl defaults.  Any modifiers following the caret override the defaults.
+The C<+> prototype is a special alternative to C<$> that will act like
+C<\[@%]> when given a literal array or hash variable, but will otherwise
+force scalar context on the argument.  This is useful for functions which
+should accept either a literal array or an array reference as the argument:
 
-The stringification of regular expressions now uses this notation.  The
-main purpose of this is to allow tests that rely on the stringification
-to not have to change when new modifiers are added.  See
-L<perlre/Extended Patterns>.
+    sub smartpush (+@) {
+        my $aref = shift;
+        die "Not an array or arrayref" unless ref $aref eq 'ARRAY';
+        push @$aref, @_;
+    }
 
-=head2 C<"d">, C<"l">, and C<"u"> regex modifiers added
+When using the C<+> prototype, your function must check that the argument
+is of an acceptable type.
 
-These modifiers are currently only available within a C<(?...)> construct.
+=head2 C<use re '/flags';>
 
-The C<"l"> modifier says to compile the regular expression as if it were
-in the scope of C<use locale>, even if it is not.
+The C<re> pragma now has the ability to turn on regular expression flags
+till the end of the lexical scope:
 
-The C<"u"> modifier currently does nothing.
+    use re '/x';
+    "foo" =~ / (.+) /;  # /x implied
 
-The C<"d"> modifier is used in the scope of C<use locale> to compile the
-regular expression as if it were not in that scope.
-See L<perlre/(?dlupimsx-imsx)>.
-
-=head2 C<\N{...}> now handles Unicode named character sequences
-
-Unicode has a number of named character sequences, in which particular sequences
-of code points are given names.  C<\N{...}> now recognizes these.
-See L<charnames>.
-
-=head2 New function C<charnames::string_vianame()>
-
-This function is a run-time version of C<\N{...}>, returning the string
-of characters whose Unicode name is its parameter.  It can handle
-Unicode named character sequences, whereas the pre-existing
-C<charnames::vianame()> cannot, as the latter returns a single code
-point.
-See L<charnames>.
+See L<re/'/flags' mode> for details.
 
 =head1 Security
 
@@ -78,67 +64,13 @@ L</Selected Bug Fixes> section.
 
 =head1 Incompatible Changes
 
-=head2 Stringification of regexes has changed
-
-Default regular expression modifiers are now notated by using
-C<(?^...)>.  Code relying on the old stringification will fail.  The
-purpose of this is so that when new modifiers are added, such code will
-not have to change (after this one time), as the stringification will
-automatically incorporate the new modifiers.
-
-Code that needs to work properly with both old- and new-style regexes
-can avoid the whole issue by using (for Perls since 5.9.5):
-
- use re qw(regexp_pattern);
- my ($pat, $mods) = regexp_pattern($re_ref);
-
-where C<$re_ref> is a reference to a compiled regular expression.  Upon
-return, C<$mods> will be a string containing all the non-default
-modifiers used when the regular expression was compiled, and C<$pattern>
-the actual pattern.
-
-If the actual stringification is important, or older Perls need to be
-supported, you can use something like the following:
+XXX For a release on a stable branch, this section aspires to be:
 
-    # Accept both old and new-style stringification
-    my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism';
-
-And then use C<$modifiers> instead of C<-xism>.
-
-=head2 Regular expressions retain their localeness when interpolated
-
-Regular expressions compiled under C<"use locale"> now retain this when
-interpolated into a new regular expression compiled outside a
-C<"use locale">, and vice-versa.
-
-Previously, a regular expression interpolated into another one inherited
-the localeness of the surrounding one, losing whatever state it
-originally had.  This is considered a bug fix, but may trip up code that
-has come to rely on the incorrect behavior.
+    There are no changes intentionally incompatible with 5.XXX.XXX. If any
+    exist, they are bugs and reports are welcome.
 
 [ List each incompatible change as a =head2 entry ]
 
-=head2 Directory handles not copied to threads
-
-On systems that do not have a C<fchdir> function, newly-created threads no
-longer inherit directory handles from their parent threads. Such programs
-would probably have crashed anyway
-L<[perl #75154]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75154>.
-
-=head2 Negation treats strings differently from before
-
-The unary negation operator C<-> now treats strings that look like numbers
-as numbers
-L<[perl #57706]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=57706>.
-
-=head2 Negative zero
-
-Negative zero (-0.0), when converted to a string, now becomes "0" on all
-platforms. It used to become "-0" on some, but "0" on others.
-
-If you still need to determine whether a zero is negative, use
-C<sprintf("%g", $zero) =~ /^-/> or the L<Data::Float> module on CPAN.
-
 =head1 Deprecations
 
 XXX Any deprecated features, syntax, modules etc. should be listed here.
@@ -190,117 +122,34 @@ XXX
 
 =item *
 
-C<Archive::Extract> has been upgraded from version 0.42 to 0.44
-
-=item *
-
-C<Carp> has been upgraded from version 1.18 to 1.19.
-
-It no longer autovivifies the C<*CORE::GLOBAL::caller> glob, something it
-started doing in 1.18, which was released with perl 5.13.4
-L<[perl #78082]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=78082>
-
-=item *
-
-C<Data::Dumper> has been upgraded from version 2.128 to 2.129.
+XXX What should the version be?
 
-C<Dumpxs> no longer crashes with globs returned by C<*$io_ref>
-L<[perl #72332]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72332>.
+C<B::Deparse> has been upgraded from 0.99 to ???.
 
-=item *
-
-C<Digest::MD5> has been upgraded from version 2.40 to 2.51.
-
-It is now safe to use this module in combination with threads.
+It fixes deparsing of C<our> followed by a variable with funny characters
+(as permitted under the C<utf8> pragma)
+L<[perl #33752]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=33752>.
 
 =item *
 
-C<File::DosGlob> has been upgraded from version 1.02 to 1.03.
+C<charnames> has been upgraded from 1.16 to 1.17.
 
-It allows patterns containing literal parentheses (they no longer need to
-be escaped). On Windows, it no longer adds an extra F<./> to the file names
-returned when the pattern is a relative glob with a drive specification,
-like F<c:*.pl>
-L<[perl #71712]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71712>.
+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>.
 
 =item *
 
-C<File::Find> has been upgraded from version 1.17 to 1.18.
-
-It improves handling of backslashes on Windows, so that paths such as
-F<c:\dir\/file> are no longer generated
-L<[perl #71710]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71710>.
+C<CPAN> has been upgraded from 1.94_61 to 1.94_62
 
 =item *
 
-C<if> has been upgraded from version 0.05 to 0.06
+C<Locale::Maketext> has been upgraded from 1.16 to 1.17
 
 =item *
 
-C<IPC::Open3> has been upgraded from version 1.06 to 1.07.
-
-The internal C<xclose> routine now knows how to handle file descriptors, as
-documented, so duplicating STDIN in a child process using its file
-descriptor now works
-L<[perl #76474]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71710>.
-
-=item *
-
-C<Locale::Maketext> has been upgraded from version 1.15 to 1.16.
-
-It fixes an infinite loop in C<Locale::Maketext::Guts::_compile()> when
-working with tainted values
-(L<CPAN RT #40727|https://rt.cpan.org/Public/Bug/Display.html?id=40727>).
-
-C<< ->maketext >> calls will now backup and restore C<$@> so that error
-messages are not supressed
-(L<CPAN RT #34182|https://rt.cpan.org/Public/Bug/Display.html?id=34182>).
-
-=item *
-
-C<Math::BigInt> has been upgraded from version 1.95 to 1.97.
-
-This prevents C<sqrt($int)> from crashing under C<use bigrat;>
-L<[perl #73534]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=73534>.
-
-=item *
-
-C<NEXT> has been upgraded from version 0.64 to 0.65.
-
-=item *
-
-C<overload> has been upgraded from version 1.10 to 1.11.
-
-C<overload::Method> can now handle subroutines that are themselves blessed
-into overloaded classes
-L<[perl #71998]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71998>.
-
-=item *
-
-C<PathTools> has been upgraded from version 3.31_01 to 3.34.
-
-=item *
-
-C<sigtrap> has been upgraded from version 1.04 to 1.05.
-
-It no longer tries to modify read-only arguments when generating a
-backtrace
-L<[perl #72340]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72340>.
-
-=item *
-
-C<threads> has been upgrade from version 1.77_03 to 1.81
-
-=item *
-
-C<Unicode::Collate> has been upgraded from version 0.59 to 0.62
-
-U::C::Locale newly supports locales: ar, de__phonebook, hu, hy, nso, om, 
-tn, vi, hr, ig, sq, se to and uk
-
-=item *
-
-C<Unicode::Normalize> has been upgraded from version 1.06 to 1.07
+C<re> has been upgraded from 0.13 to 0.14, for the sake of the new
+C<use re "/flags"> pragma.
 
 =back
 
@@ -339,8 +188,7 @@ section.
 
 =item *
 
-The documentation for the C<SvTRUE> macro was simply wrong in stating that
-get-magic is not processed. It has been corrected.
+XXX Description of the change here
 
 =back
 
@@ -375,24 +223,7 @@ XXX Changes (i.e. rewording) of diagnostic messages go here
 
 =item *
 
-The 'Layer does not match this perl' error message has been replaced with
-these more helpful messages:
-
-=over 4
-
-=item *
-
-PerlIO layer function table size (%d) does not match size expected by this
-perl (%d)
-
-=item *
-
-PerlIO layer instance size (%d) does not match size expected by this perl
-(%d)
-
-=back
-
-L<[perl #73754]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=73754>
+XXX
 
 =back
 
@@ -446,8 +277,7 @@ that they represent may be covered elsewhere.
 
 =item *
 
-The script F<t/op/threads-dirh.t> has been added, which tests interaction
-of threads and directory handles.
+XXX
 
 =back
 
@@ -494,35 +324,9 @@ L</Modules and Pragmata> section.
 
 =over 4
 
-=item IRIX
-
-Conversion of strings to floating-point numbers is now more accurate on
-IRIX systems
-L<[perl #32380]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=32380>.
-
-=item Mac OS X
-
-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.
-
-These functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and
-higher, as they have been fixed
-L<[perl #72990]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72990>.
-
-=item OpenVOS
-
-perl now builds again with OpenVOS (formerly known as Stratus VOS)
-L<[perl #78132]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=78132>.
-
-=item Windows
-
-C<$Config{gccversion}> is now set correctly when perl is built using the
-mingw64 compiler from L<http://mingw64.org>
-L<[perl #73754]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=73754>.
+=item XXX-some-platform
 
-The build process proceeds more smoothly with mingw and dmake when
-F<C:\MSYS\bin> is in the PATH, due to a C<Cwd> fix.
+XXX
 
 =back
 
@@ -538,39 +342,18 @@ be noted as well.
 
 =item *
 
-See L</Regular expressions retain their localeness when interpolated>,
-above.
-
-=item *
-
-The C<sv_cmp_flags>, C<sv_cmp_locale_flags>, C<sv_eq_flags> and
-C<sv_collxfrm_flags> functions have been added. These are like their
-non-_flags counterparts, but allow one to specify whether get-magic is
-processed.
-
-The C<sv_cmp>, C<sv_cmp_locale>, C<sv_eq> and C<sv_collxfrm> functions have
-been replaced with wrappers around the new functions. 
+C<lex_start> has been added to the API, but is considered experimental.
 
 =item *
 
-A new C<sv_2bool_flags> function has been added.
-
-This is like C<sv_2bool>, but it lets the calling code decide whether
-get-magic is handled. C<sv_2bool> is now a macro that calls the new
-function.
+A new C<parse_block> function has been added to the API
+L<[perl #78222]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78222>.
 
 =item *
 
-A new macro, C<SvTRUE_nomg>, has been added.
-
-This is like C<SvTRUE>, except that it does not process magic. It uses the
-new C<sv_2bool_flags> function.
-
-=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
-now matches what the documentation says it does.
+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>.
 
 =back
 
@@ -586,118 +369,34 @@ L</Modules and Pragmata>.
 
 =item *
 
-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
-array or hash subscript is interpolated in the right-hand side, as in
-C<s|(.)|@a{ print($1), /./ }|g>
-L<[perl #19078]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=19078>.
-
-=item *
-
-Constant-folding used to cause
-
-  $text =~ ( 1 ? /phoo/ : /bear/)
-
-to turn into
-
-  $text =~ /phoo/
-
-at compile time. Now it correctly matches against C<$_>
-L<[perl #20444]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=20444>.
+The C<parse_stmt> C function added in earlier in the 5.13.x series has been
+fixed to work with statements ending with C<}>
+L<[perl #78222]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78222>.
 
 =item *
 
-Parsing Perl code (either with string C<eval> or by loading modules) from
-within a C<UNITCHECK> block no longer causes the interpreter to crash
-L<[perl #70614]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=70614>.
+The C<parse_fullstmt> C function added in 5.13.5 has been fixed to work
+when called while an expression is being parsed.
 
 =item *
 
-When C<-d> is used on the shebang (C<#!>) line, the debugger now has access
-to the lines of the main program. In the past, this sometimes worked and
-sometimes did not, depending on what order things happened to be arranged
-in memory
-L<[perl #71806]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71806>.
+Characters in the Latin-1 non-ASCII range (0x80 to 0xFF) used not to match
+themselves if the string happened to be UTF8-encoded internally, the
+regular expression was not, and the character in the regular expression was
+inside a repeated group (e.g.,
+C<Encode::decode_utf8("\303\200") =~ /(\xc0)+/>)
+L<[perl #78464]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78464>.
 
 =item *
 
-The C<y///> or C<tr///> operator now calls get-magic (e.g., the C<FETCH>
-method of a tie) on its left-hand side just once, not twice
-L<[perl #76814]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=76814>.
+The C<(?d)> regular expression construct now overrides a previous C<(?u)>
+or C<use feature "unicode_string">
+L<[perl #78508]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78508>.
 
 =item *
 
-String comparison (C<eq>, C<ne>, C<lt>, C<gt>, C<le>, C<ge> and
-C<cmp>) and logical not (C<not> and C<!>) operators no longer call magic
-(e.g., tie methods) twice on their operands
-L<[perl #76814]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=76814>.
-
-This bug was introduced in an earlier 5.13 release, and does not affect
-perl 5.12.
-
-=item *
-
-When a tied (or other magic) variable is used as, or in, a regular
-expression, it no longer has its C<FETCH> method called twice
-L<[perl #76814]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=76814>.
-
-This bug was introduced in an earlier 5.13 release, and does not affect
-perl 5.12.
-
-=item *
-
-The C<-C> command line option can now be followed by other options
-L<[perl #72434]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72434>.
-
-=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
-nonexistent hash or array element was passed to a subroutine:
-
-  sub { $_[0] = *foo }->($hash{key});
-  # $_[0] would have been the string "*main::foo"
-
-It also happened when a glob was assigned to, or returned from, an element
-of a tied array or hash
-L<[perl #36051]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=36051>.
-
-=item *
-
-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 properly, on systems that have a C<fchdir>
-function. On other systems, new threads simply do not inherit directory
-handles from their parent threads
-L<[perl #75154]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75154>.
-
-=item *
-
-The regular expression parser no longer hangs when parsing C<\18> and
-C<\88>.
-
-This bug was introduced in version 5.13.5 and did not affect earlier
-versions
-L<[perl #78058]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78058>.
-
-=item *
-
-Subroutine redefinition works once more in the debugger
-L<[perl #48332]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=48332>.
-
-=item *
-
-The C<&> C<|> C<^> bitwise operators no longer coerce read-only arguments
-L<[perl #20661]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=20661>.
-
-=item *
-
-Stringifying a scalar containing -0.0 no longer has the affect of turning
-false into true
-L<[perl #45133]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=45133>.
+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>.
 
 =back
 
@@ -725,16 +424,6 @@ XXX
 XXX If any significant core contributor has died, we've added a short obituary
 here.
 
-=head1 Errata
-
-=over 4
-
-=item *
-
-Fixed a typo in L<perl5135delta> regarding array slices and smart matching
-
-=back
-
 =head1 Acknowledgements
 
 XXX The list of people to thank goes here.