942bc66f2566b245637e9b05227bf90408833ff3
[p5sagit/p5-mst-13.2.git] / pod / perl5132delta.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 perldelta - what is new for perl v5.13.2
6
7 =head1 DESCRIPTION
8
9 This document describes differences between the 5.13.2 release and
10 the 5.13.1 release.
11
12 If you are upgrading from an earlier release such as 5.10, first read
13 L<perl5120delta>, which describes differences between 5.10 and
14 5.12.
15
16 =head1 Notice
17
18 XXX Any important notices here
19
20 =head1 Incompatible Changes
21
22 =head2 localised tied scalars are tied again.
23
24 The change in behaviour in 5.13.1 of localising tied scalar values has
25 been reverted to the existing 5.12.0 and earlier behaviour (the change for
26 arrays and hashes remains).
27
28 =head1 Core Enhancements
29
30 XXX New core language features go here. Summarise user-visible core language
31 enhancements. Particularly prominent performance optimisations could go
32 here, but most should go in the L</Performance Enhancements> section.
33
34 =head2 Non-destructive substitution
35
36 The substitution operator now supports a C</r> option that
37 copies the input variable, carries out the substitution on
38 the copy and returns the result.  The original remains unmodified.
39
40   my $old = 'cat';
41   my $new = $old =~ s/cat/dog/r;
42   # $old is 'cat' and $new is 'dog'
43
44 This is particularly useful with C<map>.  See L<perlop> for more examples
45 (4f4d75, 000c65).
46
47 =head2 package block syntax
48
49 A package declaration can now contain a code block, in which case the
50 declaration is in scope only inside that block.  So C<package Foo { ... }>
51 is precisely equivalent to C<{ package Foo; ... }>.  It also works with
52 a version number in the declaration, as in C<package Foo 1.2 { ... }>.
53 See L<perlfunc> (434da3..36f77d, 702646).
54
55 =head2 perl -h no longer recommends -w
56
57 perl -h used to mark the -w option as recommended; since this option is
58 far less useful than it used to be due to lexical 'use warnings' and since
59 perl -h is primary a list and brief explanation of the command line switches,
60 the recommendation has now been removed (60eaec).
61
62 =head1 New Platforms
63
64 XXX List any platforms that this version of perl compiles on, that previous
65 versions did not. These will either be enabled by new files in the F<hints/>
66 directories, or new subdirectories and F<README> files at the top level of the
67 source tree.
68
69 =head1 Modules and Pragmata
70
71 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
72 go here.  If Module::CoreList is updated, generate an initial draft of the
73 following sections using F<Porting/corelist-perldelta.pl>, which prints stub
74 entries to STDOUT.  Results can be pasted in place of the '=head2' entries
75 below.  A paragraph summary for important changes should then be added by hand.
76 In an ideal world, dual-life modules would have a F<Changes> file that could be
77 cribbed.
78
79 =head2 New Modules and Pragmata
80
81 =head2 Pragmata Changes
82
83 =head2 Updated Modules
84
85 Locale::Country, Locale::Language and Locale::Currency were updated from
86 3.12 to 3.13 of the Locale-Codes distribution to include locale code changes
87 (e1137b).
88
89 =head2 Removed Modules and Pragmata
90
91 =head1 Utility Changes
92
93 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
94 here. Most of these are built within the directories F<utils> and F<x2p>.
95
96 =over 4
97
98 =item F<XXX>
99
100 XXX
101
102 =back
103
104 =head1 New Documentation
105
106 XXX Changes which create B<new> files in F<pod/> go here.
107
108 =over 4
109
110 =item L<XXX>
111
112 XXX
113
114 =back
115
116 =head1 Changes to Existing Documentation
117
118 XXX Changes which significantly change existing files in F<pod/> go here.
119 Any changes to F<pod/perldiag.pod> should go in L</New or Changed Diagnostics>.
120
121 =head2 Replace wrong tr/// table in perlebcdic.pod
122
123 perlebcdic.pod contains a helpful table to use in tr/// to convert
124 between EBCDIC and Latin1/ASCII.  Unfortunately, the table was the
125 inverse of the one it describes, though the code that used the table
126 worked correctly for the specific example given.
127
128 The table has been changed to its inverse, and the sample code changed
129 to correspond, as this is easier for the person trying to follow the
130 instructions since deriving the old table is somewhat more complicated.
131
132 The table has also been changed to hex from octal, as that is more the norm
133 these days, and the recipes in the pod altered to print out leading
134 zeros to make all the values the same length, as the table that they can
135 generate has them (5f26d5).
136
137 =head2 Document tricks for user-defined casing
138
139 perlunicode.pod now contains an explanation of how to override, mangle
140 and otherwise tweak the way perl handles upper, lower and other case
141 conversions on unicode data, and how to provide scoped changes to alter
142 one's own code's behaviour without stomping on anybody else (71648f).
143
144 =head2 INSTALL explicitly states the requirement for C89
145
146 This was already true but it's now Officially Stated For The Record (51eec7).
147
148 =head2 No longer advertise Math::TrulyRandom
149
150 This module hasn't been updated since 1996 so we can't recommend it any more
151 (83918a).
152
153 =head1 Performance Enhancements
154
155 Only allocate entries for @_ on demand - this not only saves memory per
156 subroutine defined but should hopefully improve COW behaviour (77bac2).
157
158 Multiple small improvements to threads:
159
160 =over 4
161
162 =item *
163
164 Change the internal structured of thread->params from an SV (RV) to an AV
165 - so we now pass around and store the array directly, rather than creating,
166 holding and dereferencing a reference to it (78b7eff).
167
168 =item *
169
170 Change S_ithread_create() params from a single AV* to a pair of SV** pointers.
171 This saves creating, duplicating and freeing and AV, which is only ever used for
172 an internal calling convention (4cf5ea).
173
174 =item *
175
176 Remove redundant hv_exists() calls from ithread_create()'s spec parser (b1faab).
177
178 =item *
179
180 Skip unnecessary newAV() in ithread_create() (39f3f7).
181
182 =item *
183
184 Avoid duping pads created for recursion since there's no point pre-allocating
185 the same memory in the new thread (6de654).
186
187 =back
188
189 Eliminated xhv_fill from struct xpvhv: This saves 1 IV per hash and on some
190 systems will cause struct xpvhv to become cache aligned. To avoid this
191 memory saving causing a slowdown elsewhere, boolean use of HvFILL now
192 calls HvTOTALKEYS instead (which is equivalent) - so while the fill data when
193 actually required is now calculated on demand, the cases when this needs to
194 be done should be few and far between (f4431c .. fcd245).
195
196 The foldEQ_utf8 API function for case-insensitive comparison of strings (which
197 is used heavily by the regexp engine) was substantially refactored and
198 optimised - and its documentation much improved as a free bonus gift
199 (8b3587, e6226b).
200
201 =head1 Installation and Configuration Improvements
202
203 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
204 go here.
205
206 =head2 Configuration improvements
207
208 XXX
209
210 =head2 Compilation improvements
211
212 Fix CCINCDIR and CCLIBDIR for mingw64 cross compiler to correctly be under
213 $(CCHOME)\mingw\include and \lib rather than immediately below $(CCHOME).
214
215 This means the 'incpath', 'libpth', 'ldflags', 'lddlflags' and
216 'ldflags_nolargefiles' values in Config.pm and Config_heavy.pl are now
217 set correctly (23ae7f).
218
219 =head2 Platform Specific Changes
220
221 =over 4
222
223 =item XXX-some-platform
224
225 XXX
226
227 =back
228
229 =head1 Selected Bug Fixes
230
231 Timely cleanup of SVs that are cloned into a new thread but then discovered
232 to be orphaned (i.e. their owners are -not- cloned) (e42956)
233
234 Don't accidentally clone lexicals in scope within active stack frames in
235 the parent when creating a child thread (RT #73086) (05d04d).
236
237 Avoid loading feature.pm when 'no 5.13.2;' or similar is encountered (faee19).
238
239 Trap invalid use of SvIVX on SVt_REGEXP when assertions are on (e77da3)
240
241 Don't stamp on $DB::single, $DB::trace and $DB::signal if they already have
242 values when $^P is assigned to (RT #72422) (4c0f30).
243
244 chop now correctly handles perl's extended UTF-8 (RT #73246) (65ab92)
245
246 Defer signal handling when shared SV locks are held to avoid deadlocks
247 (RT #74868) (65c742).
248
249 glob() no longer crashes when %File::Glob:: is empty and CORE::GLOBAL::glob
250 isn't present (4984aa).
251
252 perlbug now always permits the sender address to be changed before sending
253 - if you were having trouble sending bug reports before now, this should
254 fix it, we hope (e6eb90).
255
256 =over 4
257
258 =item *
259
260 Overloading now works properly in conjunction with tied variables. What
261 formerly happened was that most ops checked their arguments for overloading
262 I<before> checking for magic, so for example an overloaded object returned
263 by a tied array access would usually be treated as not overloaded
264 (RT #57012) (6f1401, ed3b9b, 6a5f8c .. 24328f).
265
266 =back
267
268 Independently, a bug was fixed that prevented $tied->() from always calling
269 FETCH correctly (RT #8438) (7c7501)
270
271 =head1 New or Changed Diagnostics
272
273 XXX New or changed warnings emitted by the core's C<C> code go here.
274
275 =over 4
276
277 =item C<XXX>
278
279 XXX
280
281 =back
282
283 =head1 Changed Internals
284
285 XXX Changes which affect the interface available to C<XS> code go here.
286
287 =over 4
288
289 =item *
290
291 The C<find_rundefsvoffset> function has been deprecated. It appeared that
292 its design was insufficient to reliably get the lexical C<$_> at run-time.
293
294 Use the new C<find_rundefsv> function or the C<UNDERBAR> macro instead.
295 They directly return the right SV representing C<$_>, whether it's lexical
296 or dynamic (789bd8 .. 03d5bc).
297
298 =item *
299
300 The following new functions or macros have been added to the public API:
301 C<SvNV_nomg>,  C<sv_2nv_flags>, C<find_rundefsv>.
302
303 =item *
304
305 The C<UNDERBAR> macro now calls C<find_rundefsv>. C<dUNDERBAR> is now a
306 noop but should still be used to ensure past and future compatibility.
307
308 =item *
309
310 The ibcmp_* functions have been renamed and are now called foldEQ,
311 foldEQ_locale and foldEQ_utf8 (e6226b).
312
313 =item *
314
315 The ibcmp_* functions have been renamed and are now called foldEQ,
316 foldEQ_locale and foldEQ_utf8 (e6226b).
317
318 =back
319
320 =head1 New Tests
321
322 XXX Changes which create B<new> files in F<t/> go here. Changes to
323 existing files in F<t/> aren't worth summarising, although the bugs that
324 they represent may be.
325
326 =over 4
327
328 =item F<XXX>
329
330 XXX
331
332 =back
333
334 =head1 Known Problems
335
336 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
337 tests that had to be C<TODO>ed for the release would be noted here, unless
338 they were specific to a particular platform (see below).
339
340 This is a list of some significant unfixed bugs, which are regressions
341 from either 5.XXX.XXX or 5.XXX.XXX.
342
343 =over 4
344
345 =item *
346
347 XXX
348
349 =back
350
351 =head1 Deprecations
352
353 XXX Add any new known deprecations here.
354
355 The following items are now deprecated.
356
357 =over 4
358
359 =item *
360
361 Omitting a space between a regex pattern or pattern modifiers and the following
362 word is deprecated.  For example, C<< m/foo/sand $bar >> will still be parsed
363 as C<< m/foo/s and $bar >> but will issue a warning.
364
365 =back
366
367 =head1 Platform Specific Notes
368
369 XXX Any changes specific to a particular platform. VMS and Win32 are the usual
370 stars here. It's probably best to group changes under the same section layout
371 as the main perldelta
372
373 =head1 Obituary
374
375 XXX If any significant core contributor has died, we've added a short obituary
376 here.
377
378 =head1 Acknowledgements
379
380 XXX The list of people to thank goes here.
381
382 Your humble release manager would like to specifically call out
383 Karl Williamson for making the tests a better place to be, and Shlomi
384 Fish for a passel of tiny incremental docfixes of the sort that don't get
385 made often enough.
386
387 =head1 Reporting Bugs
388
389 If you find what you think is a bug, you might check the articles
390 recently posted to the comp.lang.perl.misc newsgroup and the perl
391 bug database at http://rt.perl.org/perlbug/ .  There may also be
392 information at http://www.perl.org/ , the Perl Home Page.
393
394 If you believe you have an unreported bug, please run the B<perlbug>
395 program included with your release.  Be sure to trim your bug down
396 to a tiny but sufficient test case.  Your bug report, along with the
397 output of C<perl -V>, will be sent off to perlbug@perl.org to be
398 analysed by the Perl porting team.
399
400 If the bug you are reporting has security implications, which make it
401 inappropriate to send to a publicly archived mailing list, then please send
402 it to perl5-security-report@perl.org. This points to a closed subscription
403 unarchived mailing list, which includes all the core committers, who be able
404 to help assess the impact of issues, figure out a resolution, and help
405 co-ordinate the release of patches to mitigate or fix the problem across all
406 platforms on which Perl is supported. Please only use this address for
407 security issues in the Perl core, not for modules independently
408 distributed on CPAN.
409
410 =head1 SEE ALSO
411
412 The F<Changes> file for an explanation of how to view exhaustive details
413 on what changed.
414
415 The F<INSTALL> file for how to build Perl.
416
417 The F<README> file for general stuff.
418
419 The F<Artistic> and F<Copying> files for copyright information.
420
421 =cut