=encoding utf8

=head1 NAME

perl5132delta - what is new for perl v5.13.2

=head1 DESCRIPTION

This document describes differences between the 5.13.2 release and
the 5.13.1 release.

If you are upgrading from an earlier release such as 5.10, first read
L<perl5120delta>, which describes differences between 5.10 and
5.12.

=head1 Incompatible Changes

=head2 localised tied scalars are tied again.

The change in behaviour in 5.13.1 of localising tied scalar values has
been reverted to the existing 5.12.0 and earlier behaviour (the change for
arrays and hashes remains).

=head2 Naming fixes in Policy_sh.SH may invalidate Policy.sh

Several long-standing typos and naming confusions in Policy_sh.SH have
been fixed, standardizing on the variable names used in config.sh.

This will change the behavior of Policy.sh if you happen to have been
accidentally relying on the Policy.sh incorrect behavior. We'd appreciate
feedback from anyone using Policy.sh to be sure nothing is broken by
this change (c1bd23).

=head2 Stashes are now always defined

C<defined %Foo::> now always returns true, even when no symbols have yet been
defined in that package.

This is a side effect of removing a special case kludge in the tokeniser,
added for 5.10.0, to hide side effects of changes to the internal storage of
hashes that to drastically reduce their memory usage overhead.

Calling defined on a stash has been deprecated since 5.6.0, warned on
lexicals since 5.6.0, and has warned for stashes (and other package
variables) since 5.12.0. C<defined %hash> has always exposed an
implementation detail - emptying a hash by deleting all entries from it does
not make C<defined %hash> false, hence C<defined %hash> is not valid code to
determine whether an arbitrary hash is empty. Instead, use the behaviour
that an empty C<%hash> always returns false in a scalar context.

=head1 Core Enhancements

=head2 Non-destructive substitution

The substitution operator now supports a C</r> option that
copies the input variable, carries out the substitution on
the copy and returns the result.  The original remains unmodified.

  my $old = 'cat';
  my $new = $old =~ s/cat/dog/r;
  # $old is 'cat' and $new is 'dog'

This is particularly useful with C<map>.  See L<perlop> for more examples
(4f4d75, 000c65).

=head2 package block syntax

A package declaration can now contain a code block, in which case the
declaration is in scope only inside that block.  So C<package Foo { ... }>
is precisely equivalent to C<{ package Foo; ... }>.  It also works with
a version number in the declaration, as in C<package Foo 1.2 { ... }>.
See L<perlfunc> (434da3..36f77d, 702646).

=head2 CLONE_PARAMS structure added to ease correct thread creation

Modules that create threads should now create C<CLONE_PARAMS> structures
by calling the new function C<Perl_clone_params_new()>, and free them with
C<Perl_clone_params_del()>. This will ensure compatibility with any future
changes to the internals of the C<CLONE_PARAMS> structure layout, and that
it is correctly allocated and initialised.

=head2 perl -h no longer recommends -w

perl -h used to mark the -w option as recommended; since this option is
far less useful than it used to be due to lexical 'use warnings' and since
perl -h is primary a list and brief explanation of the command line switches,
the recommendation has now been removed (60eaec).

=head1 Modules and Pragmata

=head2 Updated Modules

=head3 Locale-Codes 3.13

Locale::Country, Locale::Language and Locale::Currency were updated from
3.12 to 3.13 of the Locale-Codes distribution to include locale code changes
(e1137b).

=head3 Thread-Semaphore 2.11

Added new methods -E<gt>down_nb() and -E<gt>down_force() at the suggestion
of Rick Garlick.

Refactored methods to skip argument validation when no argument is supplied.

(04febe, f06daa)

=head3 CPAN.pm 1.94_57

=over 4

=item * release 1.94_57

=item * bugfix: treat modules correctly that are deprecated in perl 5.12.

=item * bugfix: RT #57482 and #57788 revealed that configure_requires
implicitly assumed build_requires instead of normal requires. (Reported
by Andrew Whatson and Father Chrysostomos respectively)

=item * testfix: solaris should run the tests without expect because (some?)
solaris have a broken expect 

=item * testfix: run tests with cache_metadata off to prevent spill over
effects from previous test runs

=back

(742adb)

=head3 Hash::Util warning fix

Hash::Util now enables "no warnings 'uninitialized'" to suppress spurious
warnings from undefined hash values (RT #74280).

=head3 B::Deparse now handles 'no VERSION'

The 'no 5.13.2' or similar form is now correctly handled by B::Deparse.

=head3 IO::Socket doc additions

getsockopt and setsockopt are now documented.

=head3 B::Concise updated for OPpDEREF

B::Concise marks rv2sv, rv2av and rv2hv ops with the new OPpDEREF flag
as "DREFed".

=head3 File::Copy doc clarification

An extra stanza was added explaining behaviours when the copy destination
already exists and is a directory.

=head3 Multiple POD spelling fixes.

Fixes were made to VMS::DCLsym, mro, Search::Dist, B::t::OptreeCheck
and UNIVERSAL.

=head1 Changes to Existing Documentation

=head2 Replace wrong tr/// table in perlebcdic.pod

perlebcdic.pod contains a helpful table to use in tr/// to convert
between EBCDIC and Latin1/ASCII.  Unfortunately, the table was the
inverse of the one it describes, though the code that used the table
worked correctly for the specific example given.

The table has been changed to its inverse, and the sample code changed
to correspond, as this is easier for the person trying to follow the
instructions since deriving the old table is somewhat more complicated.

The table has also been changed to hex from octal, as that is more the norm
these days, and the recipes in the pod altered to print out leading
zeros to make all the values the same length, as the table that they can
generate has them (5f26d5).

=head2 Document tricks for user-defined casing

perlunicode.pod now contains an explanation of how to override, mangle
and otherwise tweak the way perl handles upper, lower and other case
conversions on unicode data, and how to provide scoped changes to alter
one's own code's behaviour without stomping on anybody else (71648f).

=head2 Document $# and $* as removed and clarify $#array usage

$# and $* were both disabled as of perl5 version 10; this release adds
documentation to that effect, a description of the results of continuing
to try and use them, and a note explaining that $# can also function as a
sigil in the $#array form (7f315d2).

=head2 INSTALL explicitly states the requirement for C89

This was already true but it's now Officially Stated For The Record (51eec7).

=head2 No longer advertise Math::TrulyRandom

This module hasn't been updated since 1996 so we can't recommend it any more
(83918a).

=head2 perlfaq synchronised to upstream

The FAQ has been updated to commit
37550b8f812e591bcd0dd869d61677dac5bda92c from the perlfaq repository
at git@github.com:briandfoy/perlfaq.git

=head1 Performance Enhancements

Only allocate entries for @_ on demand - this not only saves memory per
subroutine defined but should hopefully improve COW behaviour (77bac2).

=head2 Multiple small improvements to threads

The internal structures of threading now make fewer API calls and fewer
allocations, resulting in noticeably smaller object code. Additionally,
many thread context checks have been deferred so that they're only done
when required (although this is only possible for non-debugging builds).

=head2 Size optimisations to SV and HV structures

xhv_fill has been eliminated from struct xpvhv, saving 1 IV per hash and
on some systems will cause struct xpvhv to become cache aligned. To avoid
this memory saving causing a slowdown elsewhere, boolean use of HvFILL
now calls HvTOTALKEYS instead (which is equivalent) - so while the fill
data when actually required is now calculated on demand, the cases when
this needs to be done should be few and far between (f4431c .. fcd245).

The order of structure elements in SV bodies has changed. Effectively,
the NV slot has swapped location with STASH and MAGIC. As all access to
SV members is via macros, this should be completely transparent. This
change allows the space saving for PVHVs documented above, and may reduce
the memory allocation needed for PVIVs on some architectures.

=head2 Optimisation of regexp engine string comparison work

The foldEQ_utf8 API function for case-insensitive comparison of strings (which
is used heavily by the regexp engine) was substantially refactored and
optimised - and its documentation much improved as a free bonus gift
(8b3587, e6226b).

=head2 Memory consumption improvements to Exporter

The @EXPORT_FAIL AV is no longer created unless required, hence neither is
the typeglob backing it - this saves about 200 bytes per Exporter using
package that doesn't use this functionality.

=head1 Installation and Configuration Improvements

=head2 Compilation improvements

Fix CCINCDIR and CCLIBDIR for mingw64 cross compiler to correctly be under
$(CCHOME)\mingw\include and \lib rather than immediately below $(CCHOME).

This means the 'incpath', 'libpth', 'ldflags', 'lddlflags' and
'ldflags_nolargefiles' values in Config.pm and Config_heavy.pl are now
set correctly (23ae7f).

=head1 Selected Bug Fixes

=over 4

=item * Timely cleanup of SVs that are cloned into a new thread but then
discovered to be orphaned (i.e. their owners are -not- cloned) (e42956)

=item * Don't accidentally clone lexicals in scope within active stack frames in
the parent when creating a child thread (RT #73086) (05d04d).

=item * Avoid loading feature.pm when 'no 5.13.2;' or similar is
encountered (faee19).

=item * Trap invalid use of SvIVX on SVt_REGEXP when assertions are on
(e77da3)

=item * Don't stamp on $DB::single, $DB::trace and $DB::signal if they
already have values when $^P is assigned to (RT #72422) (4c0f30).

=item * chop now correctly handles perl's extended UTF-8 (RT #73246) (65ab92)

=item * Defer signal handling when shared SV locks are held to avoid
deadlocks (RT #74868) (65c742).

=item * glob() no longer crashes when %File::Glob:: is empty and
CORE::GLOBAL::glob isn't present (4984aa).

=item * perlbug now always permits the sender address to be changed
before sending - if you were having trouble sending bug reports before
now, this should fix it, we hope (e6eb90).

=item * Overloading now works properly in conjunction with tied
variables. What formerly happened was that most ops checked their
arguments for overloading I<before> checking for magic, so for example
an overloaded object returned by a tied array access would usually be
treated as not overloaded (RT #57012) (6f1401, ed3b9b, 6a5f8c .. 24328f).

=item * Independently, a bug was fixed that prevented $tied-E<gt>() from
always calling FETCH correctly (RT #8438) (7c7501)

=back

=head1 Changed Internals

=over 4

=item * The implementation of sv_dup_inc() has changed from a macro to a function.

=item *

The C<find_rundefsvoffset> function has been deprecated. It appeared that
its design was insufficient to reliably get the lexical C<$_> at run-time.

Use the new C<find_rundefsv> function or the C<UNDERBAR> macro instead.
They directly return the right SV representing C<$_>, whether it's lexical
or dynamic (789bd8 .. 03d5bc).

=item *

The following new functions or macros have been added to the public API:
C<SvNV_nomg>,  C<sv_2nv_flags>, C<find_rundefsv>.

=item *

The C<UNDERBAR> macro now calls C<find_rundefsv>. C<dUNDERBAR> is now a
noop but should still be used to ensure past and future compatibility.

=item *

The ibcmp_* functions have been renamed and are now called foldEQ,
foldEQ_locale and foldEQ_utf8 (e6226b).

=back

=head1 Deprecations

The following items are now deprecated.

=over 4

=item *

Omitting a space between a regex pattern or pattern modifiers and the following
word is deprecated.  For example, C<< m/foo/sand $bar >> will still be parsed
as C<< m/foo/s and $bar >> but will issue a warning.

=back

=head1 Platform Specific Notes

=head2 Recent OpenBSDs now use perl's malloc

OpenBSD E<gt> 3.7 has a new malloc implementation which is mmap based
and as such can release memory back to the OS; however for perl using
this malloc causes a substantial slowdown so we now default to using
perl's malloc instead (RT #75742) (9b58b5).

=head1 Acknowledgements

Perl 5.13.2 represents thirty days of development since Perl 5.13.1 (and
two days of waiting around while the release manager remembered where he
left his brain) and contains 3685 lines of changes across 194 files from
30 authors and committers.

Thank you to the following for contributing to this release:

Abigail, Andreas J. Koenig, Chas. Owens, Chris 'BinGOs' Williams,
Craig A. Berry, David Caldwell, David Golden, David Mitchell,
Father Chrysostomos, George Greer, H.Merijn Brand, Jerry D. Hedden,
Karl Williamson, Maik Hentsche, Matt S Trout, Nicholas Clark, Rafael
Garcia-Suarez, Ricardo Signes, Salvador Fandino, Salvador Ortiz Garcia,
Shlomi Fish, Sinan Unur, Sisyphus, Slaven Rezic, Sullivan Beck, Tony Cook,
Vincent Pit, Zefram, brian d foy, Ævar Arnfjörð Bjarmason

Your humble release manager would like to specifically call out
Karl Williamson for making the tests a better place to be, and Shlomi
Fish for a passel of tiny incremental docfixes of the sort that don't get
made often enough.

=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 http://rt.perl.org/perlbug/ .  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 B<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 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
