This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldiag: rewording
[perl5.git] / pod / perl5132delta.pod
CommitLineData
f83c51e5
DG
1=encoding utf8
2
3=head1 NAME
4
e19a038c 5perl5132delta - what is new for perl v5.13.2
f83c51e5
DG
6
7=head1 DESCRIPTION
8
9This document describes differences between the 5.13.2 release and
10the 5.13.1 release.
11
12If you are upgrading from an earlier release such as 5.10, first read
13L<perl5120delta>, which describes differences between 5.10 and
145.12.
15
f83c51e5
DG
16=head1 Incompatible Changes
17
5f3e44b6 18=head2 localised tied scalars are tied again.
f83c51e5 19
5f3e44b6
DM
20The change in behaviour in 5.13.1 of localising tied scalar values has
21been reverted to the existing 5.12.0 and earlier behaviour (the change for
22arrays and hashes remains).
f83c51e5 23
e2d012a1
MT
24=head2 Naming fixes in Policy_sh.SH may invalidate Policy.sh
25
26Several long-standing typos and naming confusions in Policy_sh.SH have
27been fixed, standardizing on the variable names used in config.sh.
f83c51e5 28
e2d012a1
MT
29This will change the behavior of Policy.sh if you happen to have been
30accidentally relying on the Policy.sh incorrect behavior. We'd appreciate
31feedback from anyone using Policy.sh to be sure nothing is broken by
32this change (c1bd23).
33
34=head2 Stashes are now always defined
35
fca02b31
NC
36C<defined %Foo::> now always returns true, even when no symbols have yet been
37defined in that package.
38
39This is a side effect of removing a special case kludge in the tokeniser,
40added for 5.10.0, to hide side effects of changes to the internal storage of
41hashes that to drastically reduce their memory usage overhead.
42
43Calling defined on a stash has been deprecated since 5.6.0, warned on
44lexicals since 5.6.0, and has warned for stashes (and other package
45variables) since 5.12.0. C<defined %hash> has always exposed an
46implementation detail - emptying a hash by deleting all entries from it does
47not make C<defined %hash> false, hence C<defined %hash> is not valid code to
48determine whether an arbitrary hash is empty. Instead, use the behaviour
ad775c25 49that an empty C<%hash> always returns false in a scalar context.
e2d012a1
MT
50
51=head1 Core Enhancements
f83c51e5 52
c4a65341
DG
53=head2 Non-destructive substitution
54
55The substitution operator now supports a C</r> option that
56copies the input variable, carries out the substitution on
57the copy and returns the result. The original remains unmodified.
58
59 my $old = 'cat';
60 my $new = $old =~ s/cat/dog/r;
61 # $old is 'cat' and $new is 'dog'
62
e2d012a1
MT
63This is particularly useful with C<map>. See L<perlop> for more examples
64(4f4d75, 000c65).
c4a65341 65
f5d8aca1
Z
66=head2 package block syntax
67
68A package declaration can now contain a code block, in which case the
69declaration is in scope only inside that block. So C<package Foo { ... }>
70is precisely equivalent to C<{ package Foo; ... }>. It also works with
71a version number in the declaration, as in C<package Foo 1.2 { ... }>.
e2d012a1 72See L<perlfunc> (434da3..36f77d, 702646).
f5d8aca1 73
e2d012a1 74=head2 CLONE_PARAMS structure added to ease correct thread creation
f83c51e5 75
e2d012a1
MT
76Modules that create threads should now create C<CLONE_PARAMS> structures
77by calling the new function C<Perl_clone_params_new()>, and free them with
78C<Perl_clone_params_del()>. This will ensure compatibility with any future
79changes to the internals of the C<CLONE_PARAMS> structure layout, and that
80it is correctly allocated and initialised.
81
82=head2 perl -h no longer recommends -w
83
84perl -h used to mark the -w option as recommended; since this option is
85far less useful than it used to be due to lexical 'use warnings' and since
86perl -h is primary a list and brief explanation of the command line switches,
87the recommendation has now been removed (60eaec).
f83c51e5
DG
88
89=head1 Modules and Pragmata
90
e2d012a1 91=head2 Updated Modules
f83c51e5 92
e2d012a1 93=head3 Locale-Codes 3.13
f83c51e5 94
e2d012a1
MT
95Locale::Country, Locale::Language and Locale::Currency were updated from
963.12 to 3.13 of the Locale-Codes distribution to include locale code changes
97(e1137b).
f83c51e5 98
e2d012a1 99=head3 Thread-Semaphore 2.11
f83c51e5 100
958e98f0
MT
101Added new methods -E<gt>down_nb() and -E<gt>down_force() at the suggestion
102of Rick Garlick.
f83c51e5 103
e2d012a1 104Refactored methods to skip argument validation when no argument is supplied.
f83c51e5 105
e2d012a1
MT
106(04febe, f06daa)
107
108=head3 CPAN.pm 1.94_57
f83c51e5
DG
109
110=over 4
958e98f0 111
e2d012a1 112=item * release 1.94_57
958e98f0 113
e2d012a1 114=item * bugfix: treat modules correctly that are deprecated in perl 5.12.
958e98f0 115
e2d012a1
MT
116=item * bugfix: RT #57482 and #57788 revealed that configure_requires
117implicitly assumed build_requires instead of normal requires. (Reported
118by Andrew Whatson and Father Chrysostomos respectively)
958e98f0 119
e2d012a1
MT
120=item * testfix: solaris should run the tests without expect because (some?)
121solaris have a broken expect
122
123=item * testfix: run tests with cache_metadata off to prevent spill over
124effects from previous test runs
f83c51e5 125
e2d012a1 126=back
f83c51e5 127
e2d012a1 128(742adb)
f83c51e5 129
e2d012a1 130=head3 Hash::Util warning fix
f83c51e5 131
e2d012a1
MT
132Hash::Util now enables "no warnings 'uninitialized'" to suppress spurious
133warnings from undefined hash values (RT #74280).
f83c51e5 134
38966ae2
MT
135=head3 B::Deparse now handles 'no VERSION'
136
137The 'no 5.13.2' or similar form is now correctly handled by B::Deparse.
138
2792c8bf
MT
139=head3 IO::Socket doc additions
140
141getsockopt and setsockopt are now documented.
142
c6e505a8
MT
143=head3 B::Concise updated for OPpDEREF
144
145B::Concise marks rv2sv, rv2av and rv2hv ops with the new OPpDEREF flag
146as "DREFed".
147
70ce9532
MT
148=head3 File::Copy doc clarification
149
150An extra stanza was added explaining behaviours when the copy destination
151already exists and is a directory.
152
8a365628
MT
153=head3 Multiple POD spelling fixes.
154
b3b1f4cb
MT
155Fixes were made to VMS::DCLsym, mro, Search::Dist, B::t::OptreeCheck
156and UNIVERSAL.
8a365628 157
e2d012a1 158=head1 Changes to Existing Documentation
f83c51e5 159
e2d012a1 160=head2 Replace wrong tr/// table in perlebcdic.pod
f83c51e5 161
e2d012a1
MT
162perlebcdic.pod contains a helpful table to use in tr/// to convert
163between EBCDIC and Latin1/ASCII. Unfortunately, the table was the
164inverse of the one it describes, though the code that used the table
165worked correctly for the specific example given.
f83c51e5 166
e2d012a1
MT
167The table has been changed to its inverse, and the sample code changed
168to correspond, as this is easier for the person trying to follow the
169instructions since deriving the old table is somewhat more complicated.
f83c51e5 170
e2d012a1
MT
171The table has also been changed to hex from octal, as that is more the norm
172these days, and the recipes in the pod altered to print out leading
173zeros to make all the values the same length, as the table that they can
174generate has them (5f26d5).
f83c51e5 175
e2d012a1 176=head2 Document tricks for user-defined casing
f83c51e5 177
e2d012a1
MT
178perlunicode.pod now contains an explanation of how to override, mangle
179and otherwise tweak the way perl handles upper, lower and other case
180conversions on unicode data, and how to provide scoped changes to alter
181one's own code's behaviour without stomping on anybody else (71648f).
f83c51e5 182
e2d012a1 183=head2 Document $# and $* as removed and clarify $#array usage
f83c51e5 184
e2d012a1
MT
185$# and $* were both disabled as of perl5 version 10; this release adds
186documentation to that effect, a description of the results of continuing
187to try and use them, and a note explaining that $# can also function as a
188sigil in the $#array form (7f315d2).
f83c51e5 189
e2d012a1 190=head2 INSTALL explicitly states the requirement for C89
f83c51e5 191
e2d012a1 192This was already true but it's now Officially Stated For The Record (51eec7).
f83c51e5 193
e2d012a1 194=head2 No longer advertise Math::TrulyRandom
f83c51e5 195
e2d012a1
MT
196This module hasn't been updated since 1996 so we can't recommend it any more
197(83918a).
f83c51e5 198
e2d012a1 199=head2 perlfaq synchronised to upstream
f83c51e5 200
e2d012a1
MT
201The FAQ has been updated to commit
20237550b8f812e591bcd0dd869d61677dac5bda92c from the perlfaq repository
203at git@github.com:briandfoy/perlfaq.git
f83c51e5 204
e2d012a1 205=head1 Performance Enhancements
f83c51e5 206
e2d012a1
MT
207Only allocate entries for @_ on demand - this not only saves memory per
208subroutine defined but should hopefully improve COW behaviour (77bac2).
f83c51e5 209
e2d012a1 210=head2 Multiple small improvements to threads
f83c51e5 211
e2d012a1
MT
212The internal structures of threading now make fewer API calls and fewer
213allocations, resulting in noticeably smaller object code. Additionally,
214many thread context checks have been deferred so that they're only done
215when required (although this is only possible for non-debugging builds).
f83c51e5 216
e2d012a1 217=head2 Size optimisations to SV and HV structures
f83c51e5 218
e2d012a1
MT
219xhv_fill has been eliminated from struct xpvhv, saving 1 IV per hash and
220on some systems will cause struct xpvhv to become cache aligned. To avoid
221this memory saving causing a slowdown elsewhere, boolean use of HvFILL
222now calls HvTOTALKEYS instead (which is equivalent) - so while the fill
223data when actually required is now calculated on demand, the cases when
224this needs to be done should be few and far between (f4431c .. fcd245).
f83c51e5 225
e2d012a1
MT
226The order of structure elements in SV bodies has changed. Effectively,
227the NV slot has swapped location with STASH and MAGIC. As all access to
228SV members is via macros, this should be completely transparent. This
229change allows the space saving for PVHVs documented above, and may reduce
230the memory allocation needed for PVIVs on some architectures.
f83c51e5 231
e2d012a1 232=head2 Optimisation of regexp engine string comparison work
f83c51e5 233
e2d012a1
MT
234The foldEQ_utf8 API function for case-insensitive comparison of strings (which
235is used heavily by the regexp engine) was substantially refactored and
236optimised - and its documentation much improved as a free bonus gift
237(8b3587, e6226b).
f83c51e5 238
e2d012a1 239=head2 Memory consumption improvements to Exporter
f83c51e5 240
e2d012a1
MT
241The @EXPORT_FAIL AV is no longer created unless required, hence neither is
242the typeglob backing it - this saves about 200 bytes per Exporter using
243package that doesn't use this functionality.
244
245=head1 Installation and Configuration Improvements
246
247=head2 Compilation improvements
248
249Fix CCINCDIR and CCLIBDIR for mingw64 cross compiler to correctly be under
250$(CCHOME)\mingw\include and \lib rather than immediately below $(CCHOME).
f83c51e5 251
e2d012a1
MT
252This means the 'incpath', 'libpth', 'ldflags', 'lddlflags' and
253'ldflags_nolargefiles' values in Config.pm and Config_heavy.pl are now
254set correctly (23ae7f).
255
256=head1 Selected Bug Fixes
f83c51e5
DG
257
258=over 4
259
e2d012a1
MT
260=item * Timely cleanup of SVs that are cloned into a new thread but then
261discovered to be orphaned (i.e. their owners are -not- cloned) (e42956)
f83c51e5 262
e2d012a1
MT
263=item * Don't accidentally clone lexicals in scope within active stack frames in
264the parent when creating a child thread (RT #73086) (05d04d).
f83c51e5 265
e2d012a1
MT
266=item * Avoid loading feature.pm when 'no 5.13.2;' or similar is
267encountered (faee19).
f83c51e5 268
e2d012a1
MT
269=item * Trap invalid use of SvIVX on SVt_REGEXP when assertions are on
270(e77da3)
f83c51e5 271
e2d012a1
MT
272=item * Don't stamp on $DB::single, $DB::trace and $DB::signal if they
273already have values when $^P is assigned to (RT #72422) (4c0f30).
f83c51e5 274
e2d012a1
MT
275=item * chop now correctly handles perl's extended UTF-8 (RT #73246) (65ab92)
276
277=item * Defer signal handling when shared SV locks are held to avoid
278deadlocks (RT #74868) (65c742).
279
280=item * glob() no longer crashes when %File::Glob:: is empty and
281CORE::GLOBAL::glob isn't present (4984aa).
282
283=item * perlbug now always permits the sender address to be changed
284before sending - if you were having trouble sending bug reports before
285now, this should fix it, we hope (e6eb90).
f83c51e5 286
e2d012a1
MT
287=item * Overloading now works properly in conjunction with tied
288variables. What formerly happened was that most ops checked their
289arguments for overloading I<before> checking for magic, so for example
290an overloaded object returned by a tied array access would usually be
291treated as not overloaded (RT #57012) (6f1401, ed3b9b, 6a5f8c .. 24328f).
f83c51e5 292
958e98f0 293=item * Independently, a bug was fixed that prevented $tied-E<gt>() from
e2d012a1 294always calling FETCH correctly (RT #8438) (7c7501)
f83c51e5
DG
295
296=back
297
298=head1 Changed Internals
299
f83c51e5
DG
300=over 4
301
e2d012a1
MT
302=item * The implementation of sv_dup_inc() has changed from a macro to a function.
303
f83c51e5
DG
304=item *
305
e2d012a1 306The C<find_rundefsvoffset> function has been deprecated. It appeared that
03d5bcf8
VP
307its design was insufficient to reliably get the lexical C<$_> at run-time.
308
309Use the new C<find_rundefsv> function or the C<UNDERBAR> macro instead.
310They directly return the right SV representing C<$_>, whether it's lexical
e2d012a1 311or dynamic (789bd8 .. 03d5bc).
03d5bcf8
VP
312
313=item *
314
ebe8e111 315The following new functions or macros have been added to the public API:
789bd863 316C<SvNV_nomg>, C<sv_2nv_flags>, C<find_rundefsv>.
f83c51e5 317
483ce06a
VP
318=item *
319
320The C<UNDERBAR> macro now calls C<find_rundefsv>. C<dUNDERBAR> is now a
321noop but should still be used to ensure past and future compatibility.
322
e2d012a1 323=item *
f83c51e5 324
e2d012a1
MT
325The ibcmp_* functions have been renamed and are now called foldEQ,
326foldEQ_locale and foldEQ_utf8 (e6226b).
f83c51e5 327
f83c51e5
DG
328=back
329
330=head1 Deprecations
331
f83c51e5
DG
332The following items are now deprecated.
333
334=over 4
335
336=item *
337
7c8a36d1
DG
338Omitting a space between a regex pattern or pattern modifiers and the following
339word is deprecated. For example, C<< m/foo/sand $bar >> will still be parsed
340as C<< m/foo/s and $bar >> but will issue a warning.
f83c51e5
DG
341
342=back
343
344=head1 Platform Specific Notes
345
e2d012a1 346=head2 Recent OpenBSDs now use perl's malloc
f83c51e5 347
958e98f0
MT
348OpenBSD E<gt> 3.7 has a new malloc implementation which is mmap based
349and as such can release memory back to the OS; however for perl using
350this malloc causes a substantial slowdown so we now default to using
351perl's malloc instead (RT #75742) (9b58b5).
f83c51e5
DG
352
353=head1 Acknowledgements
354
d1e2db0b
MT
355Perl 5.13.2 represents thirty days of development since Perl 5.13.1 (and
356two days of waiting around while the release manager remembered where he
357left his brain) and contains 3685 lines of changes across 194 files from
35830 authors and committers.
359
360Thank you to the following for contributing to this release:
361
362Abigail, Andreas J. Koenig, Chas. Owens, Chris 'BinGOs' Williams,
363Craig A. Berry, David Caldwell, David Golden, David Mitchell,
364Father Chrysostomos, George Greer, H.Merijn Brand, Jerry D. Hedden,
365Karl Williamson, Maik Hentsche, Matt S Trout, Nicholas Clark, Rafael
366Garcia-Suarez, Ricardo Signes, Salvador Fandino, Salvador Ortiz Garcia,
367Shlomi Fish, Sinan Unur, Sisyphus, Slaven Rezic, Sullivan Beck, Tony Cook,
368Vincent Pit, Zefram, brian d foy, Ævar Arnfjörð Bjarmason
f83c51e5 369
e2d012a1
MT
370Your humble release manager would like to specifically call out
371Karl Williamson for making the tests a better place to be, and Shlomi
372Fish for a passel of tiny incremental docfixes of the sort that don't get
373made often enough.
f83c51e5
DG
374
375=head1 Reporting Bugs
376
377If you find what you think is a bug, you might check the articles
378recently posted to the comp.lang.perl.misc newsgroup and the perl
379bug database at http://rt.perl.org/perlbug/ . There may also be
380information at http://www.perl.org/ , the Perl Home Page.
381
382If you believe you have an unreported bug, please run the B<perlbug>
383program included with your release. Be sure to trim your bug down
384to a tiny but sufficient test case. Your bug report, along with the
385output of C<perl -V>, will be sent off to perlbug@perl.org to be
386analysed by the Perl porting team.
387
388If the bug you are reporting has security implications, which make it
389inappropriate to send to a publicly archived mailing list, then please send
390it to perl5-security-report@perl.org. This points to a closed subscription
391unarchived mailing list, which includes all the core committers, who be able
392to help assess the impact of issues, figure out a resolution, and help
393co-ordinate the release of patches to mitigate or fix the problem across all
394platforms on which Perl is supported. Please only use this address for
395security issues in the Perl core, not for modules independently
396distributed on CPAN.
397
398=head1 SEE ALSO
399
400The F<Changes> file for an explanation of how to view exhaustive details
401on what changed.
402
403The F<INSTALL> file for how to build Perl.
404
405The F<README> file for general stuff.
406
407The F<Artistic> and F<Copying> files for copyright information.
408
409=cut