This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
e6533fa646a3f44946909d0d3bcbedc1d6589b7e
[perl5.git] / pod / perl5134delta.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 perldelta - what is new for perl v5.13.4
6
7 =head1 DESCRIPTION
8
9 This document describes differences between the 5.13.4 release and
10 the 5.13.3 release.
11
12 If you are upgrading from an earlier release such as 5.13.2, first read
13 L<perl5133delta>, which describes differences between 5.13.2 and
14 5.13.3.
15
16 =head1 Core Enhancements
17
18 =head2 C<srand()> now returns the seed
19
20 This allows programs which need to have repeatable results to not have to come
21 up with their own seed generating mechanism.  Instead, they can use C<srand()>
22 and somehow stash the return for future use.  Typical is a test program which
23 has too many combinations to test comprehensively in the time available to it
24 each run.  It can test a random subset each time, and should there be a failure,
25 log the seed used for that run so that it can later be used to reproduce the
26 exact results.
27
28 =head2 Creating unary functions with prototypes
29
30 Calls to functions created with the following prototypes are now correctly parsed
31
32 Functions declared with the following prototypes now behave correctly as unary functions:
33
34 =over 4
35
36 =item *
37
38 *
39
40 =item *
41
42 \sigil
43
44 =item *
45
46 \[...]
47
48 =item *
49
50 ;$
51
52 =item *
53
54 ;*
55
56 =item *
57
58 ;\sigil
59
60 =item *
61
62 ;\[...]
63
64 =back
65
66 =head2 C<\N{I<name>}> and C<charnames> enhancements
67
68 C<\N{}>, C<charnames::vianame>, C<charnames::viacode> now know about every
69 character in Unicode.  Previously, they didn't know about the Hangul syllables
70 nor a number of CJK (Chinese/Japanese/Korean) characters.
71
72 =head1 Incompatible Changes
73
74 =head2 Declare API incompatibility between blead releases
75
76 Only stable releases (5.10.x, 5.12.x, 5.14.x, ...) guarantee binary
77 compatibility with each other, while blead releases (5.13.x, 5.15.x, ...) often
78 break this compatibility. However, prior to perl 5.13.4, all blead releases had
79 the same C<PERL_API_REVISION>, C<PERL_API_VERSION>, and C<PERL_API_SUBVERSION>,
80 effectively declaring them as binary compatible, which they weren't. From now
81 on, blead releases will have a C<PERL_API_SUBVERSION> equal to their
82 C<PERL_SUBVERSION>, explicitly marking them as incompatible with each other.
83
84 Maintainance releases of stable perl versions will continue to make no
85 intentionally incompatible API changes.
86
87 =head2 Check API compatibility when loading XS modules
88
89 When perl's API changes in incompatible ways (which usually happens between
90 every major release), XS modules compiled for previous versions of perl will not
91 work anymore. They will need to be recompiled against the new perl.
92
93 In order to ensure that modules are recompiled, and to prevent users from
94 accidentally loading modules compiled for old perls into newer ones, the
95 C<XS_APIVERSION_BOOTCHECK> macro has been added. That macro, which is called
96 when loading every newly compiled extension, compares the API version of the
97 running perl with the version a module has been compiled for and raises an
98 exception if they don't match.
99
100 =head2 Binary Incompatible with all previous Perls
101
102 Some bit fields have been reordered, hence this release will not be binary
103 compatible with any previous Perl release.
104
105 =head1 Deprecations
106
107 =head2 List assignment to C<$[>
108
109 After assignment to C<$[> has been deprecated and started to give warnings in
110 perl version 5.12.0, this version of perl also starts to emit a warning when
111 assigning to C<$[> in list context. This fixes an oversight in 5.12.0.
112
113 =head1 Performance Enhancements
114
115 =over 4
116
117 =item *
118
119 Make string appending 100 times faster
120
121 When doing a lot of string appending, perl could end up allocating a lot more
122 memory than needed in a very inefficient way, if perl was configured to use the
123 system's C<malloc> implementation instead of its own.
124
125 C<sv_grow>, which is what's being used to allocate more memory if necessary when
126 appending to a string, has now been teached how to round up the memory it
127 requests to a certain geometric progression, making it much faster on certain
128 platforms and configurations. On Win32, it's now about 100 times faster.
129
130 =item *
131
132 For weak references, the common case of just a single weak reference per
133 referent has been optimised to reduce the storage required. In this case it
134 saves the equivalent of one small perl array per referent.
135
136 =item *
137
138 C<XPV>, C<XPVIV>, and C<XPVNV> now only allocate the parts of the C<SV> body
139 they actually use, saving some space.
140
141 =back
142
143 =head1 Modules and Pragmata
144
145 =head2 New Modules and Pragmata
146
147 This release does not introduce any new modules or pragmata.
148
149 =head2 Updated Modules and Pragmata
150
151 =over 4
152
153 =item C<Archive::Tar>
154
155 Upgraded from version 1.64 to 1.68.
156
157 Among other things, the new version adds a new option to C<ptar> to allow safe
158 creation of tarballs without world-writable files on Windows, allowing those
159 archives to be uploaded to CPAN.
160
161 =item C<B::Lint>
162
163 Upgraded from version 1.11 to 1.12.
164
165 =item C<Carp>
166
167 Upgraded from version 1.16 to 1.18.
168
169 L<Carp> now detects incomplete L<caller()|perlfunc/"caller EXPR"> overrides and
170 avoids using bogus C<@DB::args>. To provide backtraces, Carp relies on
171 particular behaviour of the caller built-in. Carp now detects if other code has
172 overridden this with an incomplete implementation, and modifies its backtrace
173 accordingly. Previously incomplete overrides would cause incorrect values in
174 backtraces (best case), or obscure fatal errors (worst case)
175
176 This fixes certain cases of C<Bizarre copy of ARRAY> caused by modules
177 overriding C<caller()> incorrectly.
178
179 =item C<Compress::Raw::Bzip2>
180
181 Upgraded from version 2.027 to 2.030.
182
183 =item C<Compress::Raw::Zlib>
184
185 Upgraded from version 2.027 to 2.030.
186
187 =item C<File::Spec>
188
189 Upgraded from version 3.31 to 3.31_01.
190
191 Various issues in L<File::Spec::VMS> have been fixed.
192
193 =item C<I18N::Langinfo>
194
195 Upgraded from version 0.03 to 0.04.
196
197 C<langinfo()> now defaults to using C<$_> if there is no argument given, just
198 like the documentation always claimed it did.
199
200 =item C<IO::Compress>
201
202 Upgraded from version 2.027 to 2.030.
203
204 =item C<Module::CoreList>
205
206 Upgraded from version 2.36 to 2.37.
207
208 Besides listing the updated core modules of this release, it also stops listing
209 the C<Filespec> module. That module never existed in core. The scripts
210 generating C<Module::CoreList> confused it with C<VMS::Filespec>, which actually
211 is a core module, since the time of perl 5.8.7.
212
213 =item C<Test::Harness>
214
215 Upgraded from version 3.21 to 3.22.
216
217 =item C<Test::Simple>
218
219 Upgraded from version 0.94 to 0.96.
220
221 Among many other things, subtests without a C<plan> or C<no_plan> now have an
222 implicit C<done_testing()> added to them.
223
224 =item C<Unicode::Collate>
225
226 Upgraded from version 0.53 to 0.56.
227
228 Among other things, it is now using UCA Revision 20 (based on Unicode 5.2.0) and
229 supports a couple of new locales.
230
231 =item C<feature>
232
233 Upgraded from version 1.17 to 1.18.
234
235 =back
236
237 =head2 Removed Modules and Pragmata
238
239 This release does not remove any modules or pragmata.
240
241 =head1 Documentation
242
243 =head2 Changes to Existing Documentation
244
245 =head3 L<perldiag>
246
247 =over 4
248
249 =item *
250
251 The following existing diagnostics are now documented:
252
253 =over 4
254
255 =item *
256
257 L<Ambiguous use of %c resolved as operator %c|perldiag/"Ambiguous use of %c resolved as operator %c">
258
259 =item *
260
261 L<Ambiguous use of %c{%s} resolved to %c%s|perldiag/"Ambiguous use of %c{%s} resolved to %c%s">
262
263 =item *
264
265 L<Ambiguous use of %c{%s%s} resolved to %c%s%s|perldiag/"Ambiguous use of %c{%s%s} resolved to %c%s%s">
266
267 =item *
268
269 L<Ambiguous use of -%s resolved as -&%s()|perldiag/"Ambiguous use of -%s resolved as -&%s()">
270
271 =item *
272
273 L<Invalid strict version format (%s)|perldiag/"Invalid strict version format (%s)">
274
275 =item *
276
277 L<Invalid version format (%s)|perldiag/"Invalid version format (%s)">
278
279 =item *
280
281 L<Invalid version object|perldiag/"Invalid version object">
282
283 =back
284
285 =back
286
287 =head3 L<perlport>
288
289 =over 4
290
291 =item *
292
293 Documented a L<limitation|perlport/alarm> of L<alarm()|perlfunc/"alarm SECONDS">
294 on Win32.
295
296 =back
297
298 =head3 L<perlre>
299
300 =over 4
301
302 =item *
303
304 Minor fix to a multiple scalar match example.
305
306 =back
307
308 =head1 Configuration and Compilation
309
310 =over 4
311
312 =item *
313
314 Compatibility with C<C++> compilers has been improved.
315
316 =item *
317
318 On compilers that support it, C<-Wwrite-strings> is now added to cflags by
319 default.
320
321 =back
322
323 =head1 Testing
324
325 =over 4
326
327 =item *
328
329 F<t/op/print.t> has been added to test implicit printing of C<$_>.
330
331 =item *
332
333 F<t/io/errnosig.t> has been added to test for restoration of of C<$!> when
334 leaving signal handlers.
335
336 =item *
337
338 F<t/op/tie_fetch_count.t> has been added to see if C<FETCH> is only called once
339 on tied variables.
340
341 =item *
342
343 F<lib/Tie/ExtraHash.t> has been added to make sure the, previously untested,
344 L<Tie::ExtraHash> keeps working.
345
346 =back
347
348 =head1 Platform Support
349
350 =head2 Platform-Specific Notes
351
352 =over 4
353
354 =item Win32
355
356 =over 4
357
358 =item *
359
360 Fixed a possible hang in F<t/op/readline.t>.
361
362 =item *
363
364 Fixed build process for SDK2003SP1 compilers.
365
366 =item *
367
368 When using old 32-bit compilers, the define C<_USE_32BIT_TIME_T> will now be set
369 in C<$Config{ccflags}>. This improves portability when compiling XS extensions
370 using new compilers, but for a perl compiled with old 32-bit compilers.
371
372 =back
373
374 =back
375
376 =head1 Internal Changes
377
378 =over 4
379
380 =item Removed C<PERL_POLLUTE>
381
382 The option to define C<PERL_POLLUTE> to expose older 5.005 symbols for backwards
383 compatibility has been removed. It's use was always discouraged, and MakeMaker
384 contains a more specific escape hatch:
385
386     perl Makefile.PL POLLUTE=1
387
388 This can be used for modules that have not been upgraded to 5.6 naming
389 conventions (and really should be completely obsolete by now).
390
391 =item Added C<PERL_STATIC_INLINE>
392
393 The C<PERL_STATIC_INLINE> define has been added to provide the best-guess
394 incantation to use for static inline functions, if the C compiler supports
395 C99-style static inline. If it doesn't, it'll give a plain C<static>.
396
397 C<HAS_STATIC_INLINE> can be used to check if the compiler actually supports
398 inline functions.
399
400 =back
401
402 =head1 Selected Bug Fixes
403
404 =over 4
405
406 =item *
407
408 A possible memory leak when using L<caller()|perlfunc/"caller EXPR"> to set
409 C<@DB::args> has been fixed.
410
411 =item *
412
413 Several memory leaks when loading XS modules were fixed.
414
415 =item *
416
417 A panic in the regular expression optimizer has been fixed (RT#75762).
418
419 =item *
420
421 Assignments to lvalue subroutines now honor copy-on-write behavior again, which
422 has been broken since version 5.10.0 (RT#75656).
423
424 =item *
425
426 Assignments to glob copies now behave just like assignments to regular globs
427 (RT#1804).
428
429 =item *
430
431 Within signal handlers, C<$!> is now implicitly localized.
432
433 =item *
434
435 L<readline|perlfunc/"readline EXPR"> now honors C<< <> >> overloading on tied
436 arguments.
437
438 =item *
439
440 L<substr()|perlfunc/"substr EXPR,OFFSET,LENGTH,REPLACEMENT">,
441 L<pos()|perlfunc/"index STR,SUBSTR,POSITION">, L<keys()|perlfunc/"keys HASH">,
442 and L<vec()|perlfunc/"vec EXPR,OFFSET,BITS"> could, when used in combination
443 with lvalues, result in leaking the scalar value they operate on, and cause its
444 destruction to happen too late. This has now been fixed.
445
446 =item *
447
448 Building with C<PERL_GLOBAL_STRUCT>, which has been broken accidentally in
449 5.13.3, now works again.
450
451 =back
452
453 =head1 Known Problems
454
455 =over 4
456
457 =item *
458
459 The changes in L<substr()|perlfunc/"substr EXPR,OFFSET,LENGTH,REPLACEMENT">
460 break L<HTML::Parser>. A patch has already been applied to its git repository
461 and will hopefully be released shortly.
462
463 =back
464
465 =head1 Acknowledgements
466
467 Perl 5.13.4 represents approximately one month of development since Perl 5.13.3,
468 and contains XXX lines of changes across XXX files from XXX authors and
469 committers.
470
471 Thank you to the following for contributing to this release:
472
473 XXX The list of people to thank goes here.
474
475 =head1 Reporting Bugs
476
477 If you find what you think is a bug, you might check the articles recently
478 posted to the comp.lang.perl.misc newsgroup and the perl bug database at
479 http://rt.perl.org/perlbug/ .  There may also be information at
480 http://www.perl.org/ , the Perl Home Page.
481
482 If you believe you have an unreported bug, please run the B<perlbug> program
483 included with your release.  Be sure to trim your bug down to a tiny but
484 sufficient test case.  Your bug report, along with the output of C<perl -V>,
485 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
486
487 If the bug you are reporting has security implications, which make it
488 inappropriate to send to a publicly archived mailing list, then please send it
489 to perl5-security-report@perl.org. This points to a closed subscription
490 unarchived mailing list, which includes all the core committers, who be able to
491 help assess the impact of issues, figure out a resolution, and help co-ordinate
492 the release of patches to mitigate or fix the problem across all platforms on
493 which Perl is supported. Please only use this address for security issues in the
494 Perl core, not for modules independently distributed on CPAN.
495
496 =head1 SEE ALSO
497
498 The F<Changes> file for an explanation of how to view exhaustive details
499 on what changed.
500
501 The F<INSTALL> file for how to build Perl.
502
503 The F<README> file for general stuff.
504
505 The F<Artistic> and F<Copying> files for copyright information.
506
507 =cut