=encoding utf8

=head1 NAME

perldelta - what is new for perl v5.19.9

=head1 DESCRIPTION

This document describes differences between the 5.19.8 release and the 5.19.9
release.

If you are upgrading from an earlier release such as 5.19.7, first read
L<perl5198delta>, which describes differences between 5.19.7 and 5.19.8.

=head1 Core Enhancements

=head2 UTF-8 locales now supported better under C<S<use locale>>

A UTF-8 locale is one in which the character set is Unicode and the
encoding is UTF-8.  Now, the POSIX C<LC_CTYPE> category operations under
such a locale (within the scope of C<S<use locale>>), which include case
changing (like C<lc()>, C<"\U">), and character classification (C<\w>,
C<\D>, C<qr/[[:punct:]]/> work just as if not under locale, except taint
rules are followed.  Prior to this, Perl only handled single-byte
locales.  This resolves [perl #56820].

=head2 C<S<use locale>> now compiles on systems without locale ability

Previously doing this caused the program to not compile.  Within its
scope the program behaves as if in the "C" locale.  Thus programs
written for platforms that support locales can run on locale-less
platforms without change.  Attempts to change the locale away from the
"C" locale will, of course, fail.

=head2 PERL_DEBUG_READONLY_COW

On some operating systems Perl can be compiled in such a way that any
attempt to modify string buffers shared by multiple SVs will crash.  This
way XS authors can test that their modules handle copy-on-write scalars
correctly.  See L<perlguts/"Copy on Write"> for detail.

This feature was actually added in 5.19.8, but was unintentionally omitted
from its delta document.

=head2 C<-DL> runtime option now added for tracing locale setting

This is designed for Perl core developers to aid in field debugging bugs
regarding locales.

=head2 Subroutine signatures

Declarative syntax to unwrap argument list into lexical variables.
C<sub foo ($a,$b) {...}> checks the number of arguments and puts the
arguments into lexical variables.  Signatures are not equivalent to
the existing idiom of C<sub foo { my($a,$b) = @_; ... }>.  Signatures
are only available by enabling a non-default feature, and generate
warnings about being experimental.  The syntactic clash with
prototypes is managed by disabling the short prototype syntax when
signatures are enabled.

See L<perlsub/Signatures> for details.

=head2 More locale initialization fallback options

If there was an error with locales during Perl start-up, it immediately
gave up and tried to use the C<"C"> locale.  Now it first tries using
other locales given by the environment variables, as detailed in
L<perllocale/ENVIRONMENT>.  For example, if C<LC_ALL> and C<LANG> are
both set, and using the C<LC_ALL> locale fails, Perl will now try the
C<LANG> locale, and only if that fails, will it fall back to C<"C">.  On
Windows machines, Perl will try, ahead of using C<"C">, the system
default locale if all the locales given by environment variables fail.

=head1 Incompatible Changes

=head2 Tainting happens under more circumstances; now conforms to documentation

This affects regular expression matching and changing the case of a
string (C<lc>, C<"\U">, I<etc>.) within the scope of C<use locale>.
The result is now tainted based on the operation, no matter what the
contents of the string were, as the documentation (L<perlsec>,
L<perllocale/SECURITY>) indicates it should.  Previously, for the case
change operation, if the string contained no characters whose case
change could be affected by the locale, the result would not be tainted.
For example, the result of C<uc()> on an empty string or one containing
only above-Latin1 code points is now tainted, and wasn't before.  This
leads to more consistent tainting results.  Regular expression patterns
taint their non-binary results (like C<$&>, C<$2>) if and only if the
pattern contains elements whose matching depends on the current
(potentially tainted) locale.  Like the case changing functions, the
actual contents of the string being matched now do not matter, whereas
formerly it did.  For example, if the pattern contains a C<\w>, the
results will be tainted even if the match did not have to use that
portion of the pattern to succeed or fail, because what a C<\w> matches
depends on locale.  However, for example, a C<.> in a pattern will not
enable tainting, because the dot matches any single character, and what
the current locale is doesn't change in any way what matches and what
doesn't.

=head2 Quote-like escape changes

The character after C<\c> in a double-quoted string ("..." or qq(...))
or regular expression must now be a printable character and may not be
C<{>.

A literal C<{> after C<\B> or C<\b> is now fatal.

These were deprecated in perl v5.14.

=head1 Deprecations

=over 4

=item *

Setting C<$/> to a reference to zero or a reference to a negative integer is
now deprecated, and will behave B<exactly> as though it was set to C<undef>.
If you want slurp behavior set C<$/> to C<undef> explicitly.

=item *

Setting C<$/> to a reference to a non integer is now forbidden and will
throw an error. Perl has never documented what would happen in this
context and while it used to behave the same as setting C<$/> to
the address of the references in future it may behave differently, so we
have forbidden this usage.

=item *

Use of any of these functions in the C<POSIX> module is now deprecated:
C<isalnum>, C<isalpha>, C<iscntrl>, C<isdigit>, C<isgraph>, C<islower>,
C<isprint>, C<ispunct>, C<isspace>, C<isupper>, and C<isxdigit>.  The
functions are buggy and don't work on UTF-8 encoded strings.  See their
entries in L<POSIX> for more information.

A warning is raised on the first call to any of them from each place in
the code that they are called.  (Hence a repeated statement in a loop
will raise just the one warning.)

=back

=head1 Performance Enhancements

=over 4

=item *

Code like:

  my $x; # or @x, %x
  my $y;

is now optimized to:

  my ($x, $y);

In combination with the padrange optimization, this means longer
uninitialized my variable statements are also optimized, so:

  my $x; my @y; my %z;

becomes:

  my ($x, @y, %z);

[perl #121077]

=back

=head1 Modules and Pragmata

=head2 Updated Modules and Pragmata

=over 4

=item *

L<autodie> has been upgraded from version 2.22 to 2.23.

C<autodie> no longer weakens strict by allowing undeclared variables
with the same name as built-ins.  [cpan #74246]

C<use autodie qw( foo ! foo);> now correctly insists that we have
hints for foo.

=item *

L<B> has been upgraded from version 1.47 to 1.48.

Remove the obsolete C<DEREFed> flag from L<B::Concise>.

=item *

L<B::Deparse> has been upgraded from version 1.24 to 1.25.

It now knows how to handle whitespace in prototypes.  Previously, it could
loop infinitely.  [perl #121050]

=item *

L<CGI> has been upgraded from version 3.64 to 3.65.

=item *

L<Compress::Raw::Bzip2> has been upgraded from version 2.063 to 2.064.

Handle non-PVs better.  [cpan #91558]

=item *

L<Compress::Raw::Zlib> has been upgraded from version 2.063 to 2.065.

Handle non-PVs better.  [cpan #91558]

Z_OK instead of Z_BUF_ERROR.  [cpan #92521]

Resolve a C++ build failure in core.  [cpan #92657]

=item *

L<Config::Perl::V> has been upgraded from version 0.19 to 0.20.

Synchronize with blead (bincompat options)

=item *

L<CPAN::Meta::YAML> has been upgraded from version 0.010 to 0.011.

=item *

L<Devel::Peek> has been upgraded from version 1.15 to 1.16.

Devel::Peek::SvREFCNT() now ensures it has been passed a reference, as
specified by its prototype.

=item *

L<diagnostics> has been upgraded from version 1.33 to 1.34.

=item *

L<Digest::SHA> has been upgraded from version 5.85 to 5.87.

Improved the performance of hexadecimal output functions and simplified capture
of intermediate SHA states, which can now be done via strings (see
C<L<getstate()|Digest::SHA/getstate>>/C<L<putstate()|Digest::SHA/putstate($str)>>).

=item *

L<DynaLoader> has been upgraded from version 1.24 to 1.25.

Android support.

=item *

L<English> has been upgraded from version 1.08 to 1.09.

Added C<$OLD_PERL_VERSION> as an alias for C<$]>.

=item *

L<ExtUtils::CBuilder> has been upgraded from version 0.280213 to 0.280216.

Android support.

=item *

L<ExtUtils::Embed> has been upgraded from version 1.31 to 1.32.

Skip tests when cross-compiling and $Config{cc} isn't available.

=item *

L<ExtUtils::Install> has been upgraded from version 1.61 to 1.62.

Skip tests when cross-compiler and make isn't available.

=item *

L<ExtUtils::MakeMaker> has been upgraded from version 6.86 to 6.88.

Improved support for Android and other minor changes.

=item *

L<feature> has been upgraded from version 1.34 to 1.35.

=item *

L<File::Fetch> has been upgraded from version 0.46 to 0.48.

Force curl to be IPv4 only during testing on NetBSD.

=item *

L<HTTP::Tiny> has been upgraded from version 0.039 to 0.042.

Added support for keep-alive connections.

If L<IO::Socket::IP> 0.25 or later is available, use that for
transparent IPv4 or IPv6 support.

=item *

L<inc::latest> has been upgraded from version 0.4204 to 0.4205.

NOTE: L<inc::latest> is deprecated and may be removed from a future version of Perl.

=item *

The IO-Compress module collection has been upgraded from version 2.063
to 2.064.

Android support.

=item *

L<IO::Socket::IP>, tentatively introduced in L<Perl 5.19.8|perl5198delta>,
has been upgraded from 0.26 to 0.28.

=item *

L<IPC::Cmd> has been upgraded from version 0.90 to 0.92.

=item *

The libnet module collection has been upgraded from version 1.24 to 1.25.

The creation of L<Net::FTP> dataconnections now honour the requested timeout,
errors from C<Net::Cmd::response()> are now handled in C<Net::FTP::pasv_wait()>
and a warning from C<Net::Domain::domainname()> on Android is now stopped.

=item *

L<locale> has been upgraded from version 1.02 to 1.03.

Allow C<use locale;> on systems without locales, such as Android.

=item *

L<Locale::Codes> has been upgraded from version 3.28 to 3.29.

=item *

L<Module::Build> has been upgraded from version 0.4204 to 0.4205.

Fix license code regression for artistic license.

Don't swallow ExtUtils::CBuilder loading errors.

Handle testing on cross-compile builds.

Protect against platforms without getpw{nam,uid}.

=item *

L<Module::CoreList> has been upgraded from version 3.04 to 3.06.

=item *

L<Module::Load> has been upgraded from version 0.28 to 0.30.

Prevent uninitialized warnings during testing.

=item *

L<Module::Load::Conditional> has been upgraded from version 0.60 to 0.62.

=item *

L<mro> has been upgraded from version 1.14 to 1.15.

Use HEKfARG() instead of creating and throwing away SVs.

=item *

L<Net::Ping> has been upgraded from version 2.42 to 2.43.

Handle getprotobyname() or getprotobynumber() not being available.

=item *

L<Parse::CPAN::Meta> has been upgraded from version 1.4409 to 1.4413.

Invalid UTF-8 encoding in YAML files are now replaced with "PERLQQ"
quoting from the Encode module and without warnings.

Removed legacy test modifications for testing with the perl core.

=item *

The PathTools module collection has been upgraded from version 3.45 to
3.46.

Improved support for Android.

C<< File::Spec::Unix->tmpdir >> now consistently returns an absolute
path, unless in taint mode.  [perl #120593]

=item *

L<Pod::Escapes> has been upgraded from version 1.04 to 1.06.

Now strict and warning clean.  Several minor documentation updates.

e2charnum() no longer treats non-ASCII Unicode digits as suitable for
an escape.  [cpan #70246]

=item *

L<Pod::Parser> has been upgraded from version 1.61 to 1.62.

=item *

L<POSIX> has been upgraded from version 1.38_01 to 1.38_02.

Deprecate use of isfoo() functions.

=item *

L<Scalar::Util> has been upgraded from version 1.36 to 1.38.

A backwards-compatibility issue with older perls has been fixed.  [cpan #92363]

=item *

L<threads> has been upgraded from version 1.91 to 1.92.

Synchronization with CPAN release.

=item *

L<version> has been upgraded from version 0.9907 to 0.9908.

=item *

L<warnings> has been upgraded from version 1.21 to 1.22.

C<< use warnings "FATAL"; >> now implies C<< "all" >>, and similarly
for C<< use warnings "NONFATAL" >>.  [perl #120977]

=back

=head1 Documentation

=head2 Changes to Existing Documentation

=head3 L<perlfunc>

=over 4

=item *

L<perlfunc/exec>'s handling of arguments is now more clearly
documented.

=back

=head3 L<perlguts>

=over 4

=item *

New sections on L<Read-Only Values|perlguts/"Read-Only Values"> and
L<Copy on Write|perlguts/"Copy on Write"> have been added.  They were
actually added in 5.19.8 but accidentally omitted from its delta document.

=back

=head1 Diagnostics

The following additions or changes have been made to diagnostic output,
including warnings and fatal error messages.  For the complete list of
diagnostic messages, see L<perldiag>.

=head2 New Diagnostics

=head3 New Errors

=over 4

=item *

Added L<Setting $E<sol> to a %s reference is forbidden|perldiag/"Setting $E<sol> to a %s reference is forbidden">

=back

=head3 New Warnings

=over 4

=item *

Added L<Setting $E<sol> to a reference to %s as a form of slurp is deprecated, treating as undef|perldiag/"Setting $E<sol> to a reference to %s as a form of slurp is deprecated, treating as undef">

=back

=head1 Configuration and Compilation

=over 4

=item *

The cross-compilation model has been renovated.
There's several new options, and some backwards-incompatible changes:

We now build binaries for miniperl and generate_uudmap to be used on the host, rather than running
every miniperl call on the target; this means that, short of 'make test',
we no longer need access to the target system once Configure is done.
You can provide already-built binaries through the C<hostperl> and
C<hostgenerate> options to Configure.

Additionally, if targeting an EBCDIC platform from an ASCII host,
or viceversa, you'll need to run Configure with C<-Uhostgenerate>, to
indicate that generate_uudmap should be run on the target.

Finally, there's also a way of having Configure end early, right after
building the host binaries, by cross-compiling without specifying a
C<targethost>.

The incompatible changes include no longer using xconfig.h, xlib, or
Cross.pm, so canned config files and Makefiles will have to be updated.

=item *

Related to the above, there is now a way of specifying the location of sh
(or equivalent) on the target system: C<targetsh>.

For example, Android has its sh in /system/bin/sh, so if cross-compiling
from a more normal Unixy system with sh in /bin/sh, "targetsh" would end
up as /system/bin/sh, and "sh" as /bin/sh.

=back

=head1 Platform Support

=head2 New Platforms

=over 4

=item Android

Perl can now be built for Android, either natively or through
cross-compilation, for all three currently available architectures (ARM,
MIPS, and x86), on a wide range of versions.

=back

=head2 Platform-Specific Notes

=over 4

=item VMS

Skip access checks on remotes in opendir().  [perl #121002]

=item Cygwin

Fixed a build error in cygwin.c on Cygwin 1.7.28.

Tests now handle the errors that occur when C<cygserver> isn't
running.

=back

=head1 Internal Changes

=over 4

=item Regexp Engine Changes That Affect The Pluggable Regex Engine Interface

Many flags that used to be exposed via regexp.h and used to populate the
extflags member of struct regexp have been removed. These fields were
technically private to Perl's own regexp engine and should not have been
exposed there in the first place.

The affected flags are:

    RXf_NOSCAN
    RXf_CANY_SEEN
    RXf_GPOS_SEEN
    RXf_GPOS_FLOAT
    RXf_ANCH_BOL
    RXf_ANCH_MBOL
    RXf_ANCH_SBOL
    RXf_ANCH_GPOS

As well as the follow flag masks:

    RXf_ANCH_SINGLE
    RXf_ANCH

All have been renamed to PREGf_ equivalents and moved to regcomp.h.

The behavior previously achieved by setting one or more of the RXf_ANCH_
flags (via the RXf_ANCH mask) have now been replaced by a *single* flag bit
in extflags:

    RXf_IS_ANCHORED

pluggable regex engines which previously used to set these flags should
now set this flag ALONE.

=back

=head1 Selected Bug Fixes

=over 4

=item *

Backticks (C< `` > or C< qx// >) combined with multiple threads on
Win32 could result in output sent to stdout on one thread being
captured by backticks of an external command in another thread.

This could occur for pseudo-forked processes too, as Win32's
pseudo-fork is implemented in terms of threads.  [perl #77672]

=item *

C<< open $fh, ">+", undef >> no longer leaks memory when TMPDIR is set
but points to a directory a temporary file cannot be created in.  [perl
#120951]

=item *

C<$^R> wasn't available outside of the regular expression that
initialized it.  [perl #121070]

=item *

Fixed a regular expression bug introduced in 5.19.5 where \S, \W etc
could fail for above ASCII.  [perl #121144]

=item *

A large set of fixes and refactoring for re_intuit_start() was merged,
the highlights are:

=over

=item *

Fixed a panic when compiling the regular expression
C</\x{100}[xy]\x{100}{2}/>.

=item *

Fixed a performance regression when performing a global pattern match
against a UTF-8 string.  [perl #120692]

=item *

Fixed another performance issue where matching a regular expression
like C</ab.{1,2}x/> against a long UTF-8 string would unnecessarily
calculate byte offsets for a large portion of the string. [perl
#120692]

=back

=item *

C< for ( $h{k} || '' ) > no longer auto-vivifies C<$h{k}>.  [perl
#120374]

=item *

On Windows machines, Perl now emulates the POSIX use of the environment
for locale initialization.  Previously, the environment was ignored.
See L<perllocale/ENVIRONMENT>.

=item *

Fixed a crash when destroying a self-referencing GLOB.  [perl #121242]

=item *

Call set-magic when setting $DB::sub.  [perl #121255]

=item *

Fixed an alignment error when compiling regular expressions when built
with GCC on HP-UX 64-bit.

=back

=head1 Known Problems

=over 4

=item *

The F<lib/locale.t> test may fail rarely.

=back

=head1 Errata From Previous Releases

=over 4

=item perl5180delta.pod

This pod file contains a statement saying that C<RXf_SPLIT> (and its alias
C<RXf_PMf_SPLIT>) and C<RXf_SKIPWHITE> were no longer used and #defined
to 0. This was the case for a short period, but the change was reverted
before Perl 5.18 was released. As such it was not true in Perl 5.18.x,
and is also not true now. Both flags continue to be used. The incorrect
entry has been removed from C<perl5180delta.pod> in this release.

=back

=head1 Acknowledgements

Perl 5.19.9 represents approximately 4 weeks of development since Perl 5.19.8
and contains approximately 47,000 lines of changes across 610 files from 32
authors.

Excluding auto-generated files, documentation and release tools, there were
approximately 34,000 lines of changes to 420 .pm, .t, .c and .h files.

Perl continues to flourish into its third decade thanks to a vibrant community
of users and developers. The following people are known to have contributed the
improvements that became Perl 5.19.9:

Abigail, Alan Haggai Alavi, Brad Gilbert, Brian Fraser, Chris 'BinGOs'
Williams, Craig A. Berry, Daniel Dragan, David Golden, David Mitchell, Father
Chrysostomos, Gavin Shelley, H.Merijn Brand, Hauke D, James E Keenan, Jerry D.
Hedden, Jess Robinson, John Peacock, Karl Williamson, Matthew Horsfall, Neil
Williams, Peter Martini, Piotr Roszatycki, Rafael Garcia-Suarez, Reini Urban,
Ricardo Signes, Steffen Müller, Steve Hay, Sullivan Beck, Tom Hukins, Tony
Cook, Yves Orton, Zefram.

The list above is almost certainly incomplete as it is automatically generated
from version control history. In particular, it does not include the names of
the (very much appreciated) contributors who reported issues to the Perl bug
tracker.

Many of the changes included in this version originated in the CPAN modules
included in Perl's core. We're grateful to the entire CPAN community for
helping Perl to flourish.

For a more complete list of all of Perl's historical contributors, please see
the F<AUTHORS> file in the Perl source distribution.

=head1 Reporting Bugs

If you find what you think is a bug, you might check the articles recently
posted to the comp.lang.perl.misc newsgroup and the perl bug database at
https://rt.perl.org/ .  There may also be information at
http://www.perl.org/ , the Perl Home Page.

If you believe you have an unreported bug, please run the L<perlbug> program
included with your release.  Be sure to trim your bug down to a tiny but
sufficient test case.  Your bug report, along with the output of C<perl -V>,
will be sent off to perlbug@perl.org to be 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 will be
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
security issues in the Perl core, not for modules independently distributed on
CPAN.

=head1 SEE ALSO

The F<Changes> file for an explanation of how to view exhaustive details on
what changed.

The F<INSTALL> file for how to build Perl.

The F<README> file for general stuff.

The F<Artistic> and F<Copying> files for copyright information.

=cut
