This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
David changelogged this
[perl5.git] / pod / perldelta.pod
index b3e05a2..d8036fb 100644 (file)
@@ -1,20 +1,28 @@
 =encoding utf8
 
+=for comment
+This has been completed up to c19fd8b40, except for:
+d9018cbe5b480ba29cc6151aba8f5102a7e009c4 (Eric Brine)
+    -- while I (use git blame to find out who) see how this change within
+       lex_read_unichar is correct, I cannot tell at a glance what visible
+       effects this bug has at the Perl level or through the lexer API.
+be48bbe8d671b6841c3ec7cb734b98071afe3cd9 (Chip)
+
 =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.15.3
+perldelta - what is new for perl v5.15.4
 
 =head1 DESCRIPTION
 
-This document describes differences between the 5.15.2 release and
-the 5.15.3 release.
+This document describes differences between the 5.15.3 release and
+the 5.15.4 release.
 
-If you are upgrading from an earlier release such as 5.15.1, first read
-L<perl5152delta>, which describes differences between 5.15.1 and
-5.15.2.
+If you are upgrading from an earlier release such as 5.15.3, first read
+L<perl5153delta>, which describes differences between 5.15.3 and
+5.15.4.
 
 =head1 Notice
 
@@ -22,11 +30,167 @@ XXX Any important notices here
 
 =head1 Core Enhancements
 
-XXX New core language features go here. Summarise user-visible core language
-enhancements. Particularly prominent performance optimisations could go
-here, but most should go in the L</Performance Enhancements> section.
+=head2 $^X converted to an absolute path on FreeBSD, OS X and Solaris
+
+C<$^X> is now converted to an absolute path on OS X, FreeBSD (without
+needing F</proc> mounted) and Solaris 10 and 11. This augments the
+previous approach of using F</proc> on Linux, FreeBSD and NetBSD
+(in all cases, where mounted).
+
+This makes relocatable perl installations more useful on these platforms.
+(See "Relocatable @INC" in F<INSTALL>)
+
+=head2 Unicode Symbol Names
+
+Perl now has proper support for Unicode in symbol names.  It used to be
+that C<*{$foo}> would ignore the internal UTF8 flag and use the bytes of
+the underlying representation to look up the symbol.  That meant that
+C<*{"\x{100}"}> and C<*{"\xc4\x80"}> would return the same thing.  All
+these parts of Perl have been fixed to account for Unicode:
+
+=over
+
+=item *
+
+Method names (including those passed to C<use overload>)
+
+=item *
+
+Typeglob names (including names of variables, subroutines and filehandles)
+
+=item *
+
+Package names
+
+=item *
+
+Constant subroutine names (not null-clean yet)
+
+=item *
+
+C<goto>
+
+=item *
+
+Symbolic dereferencing
+
+=item *
+
+Second argument to C<bless()> and C<tie()>
+
+=item *
+
+Return value of C<ref()>
+
+=item *
+
+Package names returned by C<caller()>
+
+=item *
+
+Subroutine prototypes
+
+=item *
+
+Attributes
+
+=item *
+
+Various warnings and error messages that mention variable names or values,
+methods, etc.
+
+=back
+
+In addition, a parsing bug has been fixed that prevented C<*{é}> from
+implicitly quoting the name, but instead interpreted it as C<*{+é}>, which
+would cause a strict violation.
+
+C<*{"*a::b"}> automatically strips off the * if it is followed by an ASCII
+letter.  That has been extended to all Unicode identifier characters.
+
+C<$é> is now subject to "Used only once" warnings.  It used to be exempt,
+as it was treated as a punctuation variable.
+
+Also, single-character Unicode punctuation variables (like $‰) are now
+supported [perl #69032].  They are also supported with C<our> and C<my>,
+but that is a mistake that will be fixed before 5.16.
+
+=head2 Support for Embedded Nulls
 
-[ List each enhancement as a =head2 entry ]
+Some parts of Perl did not work correctly with nulls (C<chr 0>) embedded in
+strings.  That meant that, for instance, C<< $m = "a\0b"; foo->$m >> would
+call the "a" method, instead of the actual method name contained in $m.
+These parts of perl have been fixed to support nulls:
+
+=over
+
+=item *
+
+Method names
+
+=item *
+
+Typeglob names (including filehandle names)
+
+=item *
+
+Package names
+
+=item *
+
+Autoloading
+
+=item *
+
+Return value of C<ref()>
+
+=item *
+
+Package names returned by C<caller()>
+
+=item *
+
+Filehandle warnings
+
+=item *
+
+Typeglob elements (C<*foo{"THING\0stuff"}>)
+
+=item *
+
+Signal names
+
+=item *
+
+Various warnings and error messages that mention variable names or values,
+methods, etc.
+
+=back
+
+One side effect of these changes is that blessing into "\0" no longer
+causes C<ref()> to return false.
+
+=head2 Autoloaded sort Subroutines
+
+Custom sort subroutines can now be autoloaded [perl #30661]:
+
+    sub AUTOLOAD { ... }
+    @sorted = sort foo @list; # uses AUTOLOAD
+
+=head2 Improved typemaps for Some Builtin Types
+
+Most XS authors will be aware that there is a longstanding bug
+in the OUTPUT typemap for T_AVREF (C<AV*>), T_HVREF (C<HV*>),
+T_CVREF (C<CV*>), and T_SVREF (C<SVREF> or C<\$foo>) that requires
+manually decrementing the reference count of the return value
+instead of the typemap taking care of this. For
+backwards-compatibility, this cannot be changed in the default
+typemaps. But we now provide additional typemaps
+C<T_AVREF_REFCOUNT_FIXED>, etc. that do not exhibit this bug.
+Using them in your extension is as simple as having one line
+in your C<TYPEMAP> section:
+
+  HV*  T_HVREF_REFCOUNT_FIXED
 
 =head1 Security
 
@@ -38,22 +202,12 @@ L</Selected Bug Fixes> section.
 
 =head1 Incompatible Changes
 
-=head2 User-defined case changing operations.
+XXX For a release on a stable branch, this section aspires to be:
 
-This feature was deprecated in Perl 5.14, and has now been removed.
-The CPAN module L<Unicode::Casing> provides better functionality without
-the drawbacks that this feature had, as are detailed in the 5.14
-documentation:
-L<http://perldoc.perl.org/5.14.0/perlunicode.html#User-Defined-Case-Mappings-%28for-serious-hackers-only%29>
+    There are no changes intentionally incompatible with 5.XXX.XXX
+    If any exist, they are bugs and reports are welcome.
 
-=head2 XSUBs are now 'static'
-
-XSUB C functions are now 'static', that is, they are not visible from
-outside the compilation unit. For the exceedingly rare case where
-this is not desired, a new public macro C<XS_EXTERNAL(name)> can be
-used in place of C<XS(name)>. C<ExtUtils::ParseXS> (C<xsubpp>)
-can be made to declare XSUBs with C<XS_EXTERNAL> using the
-C<EXPORT_XSUB_SYMBOLS> keyword, see L<perlxs> for details.
+[ List each incompatible change as a =head2 entry ]
 
 =head1 Deprecations
 
@@ -74,7 +228,8 @@ may well be none in a stable release.
 
 =item *
 
-XXX
+C<substr> no longer calculates a value to return when called in void
+context.
 
 =back
 
@@ -106,22 +261,57 @@ XXX
 
 =item *
 
-L<Archive::Extract> has been upgraded from version 0.52 to version 0.56
+L<Archive::Tar> has been upgraded from version 1.78 to version 1.80.
+
+=item *
+
+L<base> has been upgraded from version 2.17 to version 2.18.
+
+C<base> no longer sets a module's C<$VERSION> to "-1" when a module it loads
+does not define a C<$VERSION>.  This change has been made because "-1" is not
+a valid version number under the new "lax" criteria used internally by
+C<UNIVERSAL::VERSION>.  (See L<version> for more on "lax" version criteria.)
+
+C<base> no longer internally skips loading modules it has already loaded and
+instead relies on C<require> to inspect C<%INC>.  This fixes a bug when C<base>
+is used with code that clear C<%INC> to force a module to be reloaded.
+
+=item *
 
-Resolved an issue where C<unzip> executable was present in C<PATH> on MSWin32
+L<Digest> has been upgraded from version 1.16 to version 1.17.
 
 =item *
 
-L<Math::BigRat> has been upgraded from version 0.2602 to 0.2603.
+L<DynaLoader> has been upgraded from version 1.13 to 1.14.
 
-C<int()> on a Math::BigRat object containing -1/2 now creates a
-Math::BigInt containing 0, rather than -0.  L<Math::BigInt> does not even
-support negative zero, so the resulting object was actually malformed
-[perl #95530].
+It stopped exporting its symbols with the ExtUtils::ParseXS changes in
+5.15.2.  Now it exports them once more.
 
 =item *
 
-L<Pod::Simple> has been upgraded from version 3.18 to 3.19.
+L<ExtUtils::MakeMaker> has been upgraded from version 6.59 to version 6.61_01.
+
+=item *
+
+L<ExtUtils::ParseXS> has been upgraded from version 3.04_04 to version 3.05.
+
+=item *
+
+L<Module::Load> has been upgraded from version 0.20 to version 0.22.
+
+Resolve possible security problem [http://goo.gl/YzHRU] where a '::' prefixed
+module can 'jump' out of @INC
+
+=item *
+
+L<perlfaq> has been upgraded from version 5.0150034 to version 5.0150035.
+
+=item *
+
+L<Unicode::Collate> has been upgraded from version 0.78 to version 0.80.
+
+Locales updated to CLDR 2.0: ar, be, bg, ha, hr, kk, lt.
+Newly supported locales: as, fi__phonebook, gu, hi, kn, kok and ln.
 
 =back
 
@@ -154,13 +344,39 @@ 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<XXX>
+=head3 L<perlfunc>, L<open>
+
+=over 4
+
+=item *
+
+As an accident of history, C<open $fh, "<:", ...> applies the default
+layers for the platform (C<:raw> on Unix, C<:crlf> on Windows), ignoring
+whatever is declared by L<open.pm|open>.  This seems such a useful feature
+it has been documented in L<perlfunc|perlfunc/open> and L<open>.
+
+=back
+
+=head3 L<perlapi>
 
 =over 4
 
 =item *
 
-XXX Description of the change here
+The HV API has long accepted negative lengths to indicate that the key is
+in UTF8.  Now this is documented.
+
+=back
+
+=head3 L<perlguts>
+
+=over 4
+
+=item *
+
+A new section, L<Autoloading with XSUBs|perlguts/Autoloading with XSUBs>,
+has been added, which explains the two APIs for accessing the name of the
+autoloaded sub.
 
 =back
 
@@ -213,7 +429,11 @@ XXX Changes (i.e. rewording) of diagnostic messages go here
 
 =item *
 
-XXX Describe change here
+The message,
+"Code point 0x%X is not Unicode, no properties match it; all inverse
+prop erties do" has been changed to "Code point 0x%X is not Unicode, all
+\p{} matches fail; all \P{} matches succeed"
+
 
 =back
 
@@ -267,7 +487,9 @@ that they represent may be covered elsewhere.
 
 =item *
 
-XXX
+F<t/porting/checkcfgvar.t> now tests that all config.sh-style files are
+complete. These are used by the various non-*nix to generate their
+F<config.h>, and an incomplete input file will generate invalid output.
 
 =back
 
@@ -332,7 +554,79 @@ be noted as well.
 
 =item *
 
-XXX
+These new functions have been added as part of the work on Unicode symbols:
+
+    HvNAMELEN
+    HvNAMEUTF8
+    HvENAMELEN
+    HvENAMEUTF8
+    gv_init_pv
+    gv_init_pvn
+    gv_init_pvsv
+    gv_fetchmeth_pv
+    gv_fetchmeth_pvn
+    gv_fetchmeth_sv
+    gv_fetchmeth_pv_autoload
+    gv_fetchmeth_pvn_autoload
+    gv_fetchmeth_sv_autoload
+    gv_fetchmethod_pv_flags
+    gv_fetchmethod_pvn_flags
+    gv_fetchmethod_sv_flags
+    gv_autoload_pv
+    gv_autoload_pvn
+    gv_autoload_sv
+    newGVgen_flags
+    sv_derived_from_pv
+    sv_derived_from_pvn
+    sv_derived_from_sv
+    sv_does_pv
+    sv_does_pvn
+    sv_does_sv
+    whichsig_pv
+    whichsig_pvn
+    whichsig_sv
+
+The gv_fetchmethod_*_flags functions, like gv_fetchmethod_flags, are
+experimental and may change in a future release.
+
+=item *
+
+The following functions were added.  These are I<not> part of the API:
+
+    GvNAMEUTF8
+    GvENAMELEN
+    GvENAME_HEK
+    CopSTASH_flags
+    CopSTASH_flags_set
+    PmopSTASH_flags
+    PmopSTASH_flags_set
+    sv_sethek
+    HEKfARG
+
+There is also a C<HEKf> macro corresponding to C<SVf>, for
+interpolating HEKs in formatted strings.
+
+=item *
+
+C<sv_catpvn_flags> takes a couple of new internal-only flags,
+C<SV_CATBYTES> and C<SV_CATUTF8>, which tell it whether the char array to
+be concatenated is UTF8.  This allows for more efficient concatenation than
+creating temporary SVs to pass to C<sv_catsv>.
+
+=item *
+
+For XS AUTOLOAD subs, $AUTOLOAD is set once more, as it was in 5.6.0.  This
+is in addition to setting C<SvPVX(cv)>, for compatibility with 5.8 to 5.14.
+See L<perlguts/Autoloading with XSUBs>.
+
+=item *
+
+Perl now checks whether the array (the linearised isa) returned by a MRO
+plugin begins with the name of the class itself, for which the array was
+created, instead of assuming that it does.  This prevents the first element
+from being skipped during method lookup.  It also means that
+C<mro::get_linear_isa> may return an array with one more element than the
+MRO plugin provided [perl #94306].
 
 =back
 
@@ -348,10 +642,99 @@ L</Modules and Pragmata>.
 
 =item *
 
-F<t/porting/globvar.t> has been added, to run a sanity check on F<globar.sym>.
-F<globar.sym> is not needed on most *nix platforms, but is for Win32, hence
-previously was it was possible to inadvertently commit changes that worked
-perfectly locally, but broke the build on Win32.
+In Perl 5.14.0, C<$tainted ~~ @array> stopped working properly.  Sometimes
+it would erroneously fail (when C<$tainted> contained a string that occurs
+in the array I<after> the first element) or erroneously succeed (when
+C<undef> occurred after the first element) [perl #93590].
+
+=item *
+
+Perl 5.15.0 introduced a minor regression, in that an object referenced by
+a deleted hash element would be able to access the freed element from its
+DESTROY method, causing panic errors [perl #99660].
+
+=item *
+
+Functions in the CORE package can now be called as methods.  That used to
+work only when they had been called or referenced already.  So
+C<< "foo"->CORE::ucfirst >> returns Foo.
+
+=item *
+
+C<use> and C<require> are no longer affected by the I/O layers active in
+the caller's scope (enabled by L<open.pm|open>) [perl #96008].
+
+=item *
+
+Errors that occur when methods cannot be found during overloading now
+mention the correct package name, as they did in 5.8.x, instead of
+erroneously mentioning the "overload" package, as they have since 5.10.0.
+
+=item *
+
+Undefining C<%overload::> no longer causes a crash.
+
+=item *
+
+C<our $::é; $é> (which is invalid) no longer produces the "Compilation
+error at lib/utf8_heavy.pl..." error message, which it started emitting in
+5.10.0 [perl #99984].
+
+=item *
+
+A minor regression, introduced Perl 5.15.0, has been fixed in which some
+regular expression Unicode property matches (C<\p{...}>) matched
+non-Unicode code points.
+
+=item *
+
+In case-insensitive regular expression pattern matching, no longer on
+UTF-8 encoded strings does the scan for the start of match only look at
+the first possible position.  This caused matches such as
+C<"f\x{FB00}" =~ /ff/i> to fail.
+
+=item *
+
+On 64-bit systems, C<read()> now understands large string offsets beyond
+the 32-bit range.
+
+=item *
+
+Errors that occur when processing subroutine attributes no longer cause the
+subroutine's op tree to leak.
+
+=item *
+
+C<sort> now works once more with custom sort routines that are XSUBs.  It
+stopped working in 5.10.0.
+
+=item *
+
+C<sort> with a constant for a custom sort routine, although it produces
+unsorted results, no longer crashes.  It started crashing in 5.10.0.
+
+=item *
+
+Warnings produced when a custom sort routine returns a non-numeric value
+now contain "in sort"; e.g., "Use of uninitialized value in sort".
+
+=item *
+
+C<< sort { $a <=> $b } >>, which is optimised internally, now produces
+"uninitialized" warnings for NaNs (not-a-number values), since C<< <=> >>
+returns C<undef> for those.  This brings it in line with
+S<C<< sort { 1; $a <=> $b } >>> and other more complex cases, which are not
+optimised [perl #94390].
+
+=item *
+
+C<..> and C<...> in list context now call FETCH only once on tied
+arguments, instead of three or four times [perl #53554].
+
+=item *
+
+C<..> and C<...> in list context now mention the name of the variable in
+"uninitialized" warnings for string (as opposed to numeric) ranges.
 
 =back
 
@@ -370,7 +753,8 @@ from either 5.XXX.XXX or 5.XXX.XXX.
 
 =item *
 
-XXX
+XXX A couple of modules were broken by stdbool.h changes, or was that in
+5.15.3?
 
 =back
 
@@ -383,7 +767,7 @@ here.
 
 XXX Generate this with:
 
-  perl Porting/acknowledgements.pl v5.15.2..HEAD
+  perl Porting/acknowledgements.pl v5.15.3..HEAD
 
 =head1 Reporting Bugs