doc f7abe7
[p5sagit/p5-mst-13.2.git] / pod / perl5132delta.pod
CommitLineData
f83c51e5 1=encoding utf8
2
3=head1 NAME
4
5perldelta - what is new for perl v5.13.2
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
16=head1 Notice
17
18XXX Any important notices here
19
20=head1 Incompatible Changes
21
5f3e44b6 22=head2 localised tied scalars are tied again.
f83c51e5 23
5f3e44b6 24The change in behaviour in 5.13.1 of localising tied scalar values has
25been reverted to the existing 5.12.0 and earlier behaviour (the change for
26arrays and hashes remains).
f83c51e5 27
811a7589 28=head2 Naming fixes in Policy_sh.SH may invalidate Policy.sh
29
30Several long-standing typos and naming confusions in Policy_sh.SH have
31been fixed, standardizing on the variable names used in config.sh.
32
33This will change the behavior of Policy.sh if you happen to have been
34accidentally relying on the Policy.sh incorrect behavior. We'd appreciate
35feedback from anyone using Policy.sh to be sure nothing is broken by
36this change (c1bd23).
37
a2d05ff5 38=head2 Stashes are now always defined
39
40%stash:: is now autovivified so 'defined %Foo::' always returns true
41- although calling defined on a stash is now deprecated.
42
f83c51e5 43=head1 Core Enhancements
44
c4a65341 45=head2 Non-destructive substitution
46
47The substitution operator now supports a C</r> option that
48copies the input variable, carries out the substitution on
49the copy and returns the result. The original remains unmodified.
50
51 my $old = 'cat';
52 my $new = $old =~ s/cat/dog/r;
53 # $old is 'cat' and $new is 'dog'
54
224aa572 55This is particularly useful with C<map>. See L<perlop> for more examples
56(4f4d75, 000c65).
c4a65341 57
f5d8aca1 58=head2 package block syntax
59
60A package declaration can now contain a code block, in which case the
61declaration is in scope only inside that block. So C<package Foo { ... }>
62is precisely equivalent to C<{ package Foo; ... }>. It also works with
63a version number in the declaration, as in C<package Foo 1.2 { ... }>.
4baddafe 64See L<perlfunc> (434da3..36f77d, 702646).
f5d8aca1 65
33f49dfa 66=head2 CLONE_PARAMS structure added to ease correct thread creation
67
68Modules that create threads should now create C<CLONE_PARAMS> structures
69by calling the new function C<Perl_clone_params_new()>, and free them with
70C<Perl_clone_params_del()>. This will ensure compatibility with any future
71changes to the internals of the C<CLONE_PARAMS> structure layout, and that
72it is correctly allocated and initialised.
73
01f12797 74=head2 perl -h no longer recommends -w
75
76perl -h used to mark the -w option as recommended; since this option is
77far less useful than it used to be due to lexical 'use warnings' and since
78perl -h is primary a list and brief explanation of the command line switches,
79the recommendation has now been removed (60eaec).
80
f83c51e5 81=head1 New Platforms
82
83XXX List any platforms that this version of perl compiles on, that previous
84versions did not. These will either be enabled by new files in the F<hints/>
85directories, or new subdirectories and F<README> files at the top level of the
86source tree.
87
88=head1 Modules and Pragmata
89
90XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
91go here. If Module::CoreList is updated, generate an initial draft of the
92following sections using F<Porting/corelist-perldelta.pl>, which prints stub
93entries to STDOUT. Results can be pasted in place of the '=head2' entries
94below. A paragraph summary for important changes should then be added by hand.
95In an ideal world, dual-life modules would have a F<Changes> file that could be
96cribbed.
97
98=head2 New Modules and Pragmata
99
100=head2 Pragmata Changes
101
102=head2 Updated Modules
103
c7e77c70 104=head2 Locale-Codes 3.13
105
14b2fa3d 106Locale::Country, Locale::Language and Locale::Currency were updated from
1073.12 to 3.13 of the Locale-Codes distribution to include locale code changes
108(e1137b).
109
c7e77c70 110=head2 Thread-Semaphore 2.11
111
112Added new methods ->down_nb() and ->down_force() at the suggestion of Rick
113Garlick.
114
115Refactored methods to skip argument validation when no argument is supplied.
116
117(04febe, f06daa)
118
64525257 119=head2 CPAN.pm 1.94_57
120
121 * release 1.94_57
122
123 * bugfix: treat modules correctly that are deprecated in perl 5.12.
124
125 * bugfix: RT #57482 and #57788 revealed that configure_requires
126 implicitly assumed build_requires instead of normal requires. (Reported
127 by Andrew Whatson and Father Chrysostomos respectively)
128
129 * testfix: solaris should run the tests without expect because (some?)
130 solaris have a broken expect
131
132 * testfix: run tests with cache_metadata off to prevent spill over
133 effects from previous test runs
134
135(742adb)
136
01bb9b74 137=head2 Hash::Util warning fix
138
139Hash::Util now enables "no warnings 'uninitialized'" to suppress spurious
140warnings from undefined hash values (RT #74280).
141
f83c51e5 142=head2 Removed Modules and Pragmata
143
144=head1 Utility Changes
145
146XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
147here. Most of these are built within the directories F<utils> and F<x2p>.
148
149=over 4
150
151=item F<XXX>
152
153XXX
154
155=back
156
157=head1 New Documentation
158
159XXX Changes which create B<new> files in F<pod/> go here.
160
161=over 4
162
163=item L<XXX>
164
165XXX
166
167=back
168
169=head1 Changes to Existing Documentation
170
171XXX Changes which significantly change existing files in F<pod/> go here.
172Any changes to F<pod/perldiag.pod> should go in L</New or Changed Diagnostics>.
173
8e026cac 174=head2 Replace wrong tr/// table in perlebcdic.pod
175
176perlebcdic.pod contains a helpful table to use in tr/// to convert
177between EBCDIC and Latin1/ASCII. Unfortunately, the table was the
178inverse of the one it describes, though the code that used the table
179worked correctly for the specific example given.
180
181The table has been changed to its inverse, and the sample code changed
182to correspond, as this is easier for the person trying to follow the
183instructions since deriving the old table is somewhat more complicated.
184
185The table has also been changed to hex from octal, as that is more the norm
186these days, and the recipes in the pod altered to print out leading
187zeros to make all the values the same length, as the table that they can
09954a6c 188generate has them (5f26d5).
f83c51e5 189
14ae36e9 190=head2 Document tricks for user-defined casing
191
192perlunicode.pod now contains an explanation of how to override, mangle
193and otherwise tweak the way perl handles upper, lower and other case
194conversions on unicode data, and how to provide scoped changes to alter
195one's own code's behaviour without stomping on anybody else (71648f).
196
cd0d4ee5 197=head2 Document $# and $* as removed and clarify $#array usage
198
199$# and $* were both disabled as of perl5 version 10; this release adds
200documentation to that effect, a description of the results of continuing
201to try and use them, and a note explaining that $# can also function as a
c7e77c70 202sigil in the $#array form (7f315d2).
cd0d4ee5 203
1ed4d812 204=head2 INSTALL explicitly states the requirement for C89
205
f68a1e6d 206This was already true but it's now Officially Stated For The Record (51eec7).
207
208=head2 No longer advertise Math::TrulyRandom
209
210This module hasn't been updated since 1996 so we can't recommend it any more
211(83918a).
1ed4d812 212
34d2a8a8 213=head2 perlfaq synchronised to upstream
214
215The FAQ has been updated to commit
21637550b8f812e591bcd0dd869d61677dac5bda92c from the perlfaq repository
217at git@github.com:briandfoy/perlfaq.git
218
f83c51e5 219=head1 Performance Enhancements
220
77d7e37b 221Only allocate entries for @_ on demand - this not only saves memory per
222subroutine defined but should hopefully improve COW behaviour (77bac2).
223
2d157b07 224=head2 Multiple small improvements to threads
bd0a6a63 225
2d157b07 226The internal structures of threading now make fewer API calls and fewer
227allocations, resulting in noticeably smaller object code. Additionally,
228many thread context checks have been deferred so that they're only done
229when required (although this is only possible for non-debugging builds).
f83c51e5 230
f3497341 231=head2 Size optimisations to SV and HV structures
f83c51e5 232
f3497341 233xhv_fill has been eliminated from struct xpvhv, saving 1 IV per hash and
234on some systems will cause struct xpvhv to become cache aligned. To avoid
235this memory saving causing a slowdown elsewhere, boolean use of HvFILL
236now calls HvTOTALKEYS instead (which is equivalent) - so while the fill
237data when actually required is now calculated on demand, the cases when
238this needs to be done should be few and far between (f4431c .. fcd245).
239
240The order of structure elements in SV bodies has changed. Effectively,
241the NV slot has swapped location with STASH and MAGIC. As all access to
242SV members is via macros, this should be completely transparent. This
243change allows the space saving for PVHVs documented above, and may reduce
244the memory allocation needed for PVIVs on some architectures.
f83c51e5 245
2d157b07 246=head2 Optimisation of regexp engine string comparison work
20566cce 247
8afd3607 248The foldEQ_utf8 API function for case-insensitive comparison of strings (which
e454e0e8 249is used heavily by the regexp engine) was substantially refactored and
8afd3607 250optimised - and its documentation much improved as a free bonus gift
251(8b3587, e6226b).
e454e0e8 252
52d772cb 253=head2 Memory consumption improvements to Exporter
f3497341 254
52d772cb 255The @EXPORT_FAIL AV is no longer created unless required, hence neither is
256the typeglob backing it - this saves about 200 bytes per Exporter using
257package that doesn't use this functionality.
f3497341 258
f83c51e5 259=head1 Installation and Configuration Improvements
260
261XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
262go here.
263
264=head2 Configuration improvements
265
266XXX
267
268=head2 Compilation improvements
269
738540bd 270Fix CCINCDIR and CCLIBDIR for mingw64 cross compiler to correctly be under
271$(CCHOME)\mingw\include and \lib rather than immediately below $(CCHOME).
272
273This means the 'incpath', 'libpth', 'ldflags', 'lddlflags' and
274'ldflags_nolargefiles' values in Config.pm and Config_heavy.pl are now
275set correctly (23ae7f).
f83c51e5 276
277=head2 Platform Specific Changes
278
279=over 4
280
281=item XXX-some-platform
282
283XXX
284
285=back
286
287=head1 Selected Bug Fixes
288
b9272e1a 289Timely cleanup of SVs that are cloned into a new thread but then discovered
290to be orphaned (i.e. their owners are -not- cloned) (e42956)
291
ee6b5366 292Don't accidentally clone lexicals in scope within active stack frames in
293the parent when creating a child thread (RT #73086) (05d04d).
294
76125158 295Avoid loading feature.pm when 'no 5.13.2;' or similar is encountered (faee19).
296
5266dd11 297Trap invalid use of SvIVX on SVt_REGEXP when assertions are on (e77da3)
298
4ad89ae2 299Don't stamp on $DB::single, $DB::trace and $DB::signal if they already have
300values when $^P is assigned to (RT #72422) (4c0f30).
301
34735175 302chop now correctly handles perl's extended UTF-8 (RT #73246) (65ab92)
303
6cabea21 304Defer signal handling when shared SV locks are held to avoid deadlocks
305(RT #74868) (65c742).
306
2c690f30 307glob() no longer crashes when %File::Glob:: is empty and CORE::GLOBAL::glob
308isn't present (4984aa).
309
8dd1f707 310perlbug now always permits the sender address to be changed before sending
311- if you were having trouble sending bug reports before now, this should
312fix it, we hope (e6eb90).
313
f83c51e5 314=over 4
315
316=item *
317
ebe8e111 318Overloading now works properly in conjunction with tied variables. What
319formerly happened was that most ops checked their arguments for overloading
320I<before> checking for magic, so for example an overloaded object returned
321by a tied array access would usually be treated as not overloaded
f4541293 322(RT #57012) (6f1401, ed3b9b, 6a5f8c .. 24328f).
f83c51e5 323
324=back
325
968e95e0 326Independently, a bug was fixed that prevented $tied->() from always calling
327FETCH correctly (RT #8438) (7c7501)
328
f83c51e5 329=head1 New or Changed Diagnostics
330
331XXX New or changed warnings emitted by the core's C<C> code go here.
332
333=over 4
334
335=item C<XXX>
336
337XXX
338
339=back
340
341=head1 Changed Internals
342
33f49dfa 343The implementation of sv_dup_inc() has changed from a macro to a function.
f83c51e5 344
345=over 4
346
347=item *
348
f4b91f50 349The C<find_rundefsvoffset> function has been deprecated. It appeared that
03d5bcf8 350its design was insufficient to reliably get the lexical C<$_> at run-time.
351
352Use the new C<find_rundefsv> function or the C<UNDERBAR> macro instead.
353They directly return the right SV representing C<$_>, whether it's lexical
75b14b67 354or dynamic (789bd8 .. 03d5bc).
03d5bcf8 355
356=item *
357
ebe8e111 358The following new functions or macros have been added to the public API:
789bd863 359C<SvNV_nomg>, C<sv_2nv_flags>, C<find_rundefsv>.
f83c51e5 360
483ce06a 361=item *
362
363The C<UNDERBAR> macro now calls C<find_rundefsv>. C<dUNDERBAR> is now a
364noop but should still be used to ensure past and future compatibility.
365
8afd3607 366=item *
367
368The ibcmp_* functions have been renamed and are now called foldEQ,
369foldEQ_locale and foldEQ_utf8 (e6226b).
370
371=item *
372
373The ibcmp_* functions have been renamed and are now called foldEQ,
374foldEQ_locale and foldEQ_utf8 (e6226b).
375
f83c51e5 376=back
377
378=head1 New Tests
379
380XXX Changes which create B<new> files in F<t/> go here. Changes to
381existing files in F<t/> aren't worth summarising, although the bugs that
382they represent may be.
383
384=over 4
385
386=item F<XXX>
387
388XXX
389
390=back
391
392=head1 Known Problems
393
394XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
395tests that had to be C<TODO>ed for the release would be noted here, unless
396they were specific to a particular platform (see below).
397
398This is a list of some significant unfixed bugs, which are regressions
399from either 5.XXX.XXX or 5.XXX.XXX.
400
401=over 4
402
403=item *
404
405XXX
406
407=back
408
409=head1 Deprecations
410
411XXX Add any new known deprecations here.
412
413The following items are now deprecated.
414
415=over 4
416
417=item *
418
7c8a36d1 419Omitting a space between a regex pattern or pattern modifiers and the following
420word is deprecated. For example, C<< m/foo/sand $bar >> will still be parsed
421as C<< m/foo/s and $bar >> but will issue a warning.
f83c51e5 422
423=back
424
425=head1 Platform Specific Notes
426
ca700cb9 427=head2 Recent OpenBSDs now use perl's malloc
428
429OpenBSD > 3.7 has a new malloc implementation which is mmap based and as such
430can release memory back to the OS; however for perl using this malloc causes
431a substantial slowdown so we now default to using perl's malloc instead
432(RT #75742) (9b58b5).
f83c51e5 433
434=head1 Obituary
435
436XXX If any significant core contributor has died, we've added a short obituary
437here.
438
439=head1 Acknowledgements
440
441XXX The list of people to thank goes here.
442
d7fb9c4b 443Your humble release manager would like to specifically call out
444Karl Williamson for making the tests a better place to be, and Shlomi
445Fish for a passel of tiny incremental docfixes of the sort that don't get
446made often enough.
f83c51e5 447
448=head1 Reporting Bugs
449
450If you find what you think is a bug, you might check the articles
451recently posted to the comp.lang.perl.misc newsgroup and the perl
452bug database at http://rt.perl.org/perlbug/ . There may also be
453information at http://www.perl.org/ , the Perl Home Page.
454
455If you believe you have an unreported bug, please run the B<perlbug>
456program included with your release. Be sure to trim your bug down
457to a tiny but sufficient test case. Your bug report, along with the
458output of C<perl -V>, will be sent off to perlbug@perl.org to be
459analysed by the Perl porting team.
460
461If the bug you are reporting has security implications, which make it
462inappropriate to send to a publicly archived mailing list, then please send
463it to perl5-security-report@perl.org. This points to a closed subscription
464unarchived mailing list, which includes all the core committers, who be able
465to help assess the impact of issues, figure out a resolution, and help
466co-ordinate the release of patches to mitigate or fix the problem across all
467platforms on which Perl is supported. Please only use this address for
468security issues in the Perl core, not for modules independently
469distributed on CPAN.
470
471=head1 SEE ALSO
472
473The F<Changes> file for an explanation of how to view exhaustive details
474on what changed.
475
476The F<INSTALL> file for how to build Perl.
477
478The F<README> file for general stuff.
479
480The F<Artistic> and F<Copying> files for copyright information.
481
482=cut