This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix stack corruption by unsupported filetests
[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 that 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 Maintenance 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; therefore, 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 taught 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 =item *
347
348 F<t/re/overload.t> has been added to test against string corruption in pattern
349 matches on overloaded objects. This is a TODO test.
350
351 =back
352
353 =head1 Platform Support
354
355 =head2 Platform-Specific Notes
356
357 =over 4
358
359 =item Win32
360
361 =over 4
362
363 =item *
364
365 Fixed a possible hang in F<t/op/readline.t>.
366
367 =item *
368
369 Fixed build process for SDK2003SP1 compilers.
370
371 =item *
372
373 When using old 32-bit compilers, the define C<_USE_32BIT_TIME_T> will now be set
374 in C<$Config{ccflags}>. This improves portability when compiling XS extensions
375 using new compilers, but for a perl compiled with old 32-bit compilers.
376
377 =back
378
379 =back
380
381 =head1 Internal Changes
382
383 =over 4
384
385 =item Removed C<PERL_POLLUTE>
386
387 The option to define C<PERL_POLLUTE> to expose older 5.005 symbols for backwards
388 compatibility has been removed. It's use was always discouraged, and MakeMaker
389 contains a more specific escape hatch:
390
391     perl Makefile.PL POLLUTE=1
392
393 This can be used for modules that have not been upgraded to 5.6 naming
394 conventions (and really should be completely obsolete by now).
395
396 =item Added C<PERL_STATIC_INLINE>
397
398 The C<PERL_STATIC_INLINE> define has been added to provide the best-guess
399 incantation to use for static inline functions, if the C compiler supports
400 C99-style static inline. If it doesn't, it'll give a plain C<static>.
401
402 C<HAS_STATIC_INLINE> can be used to check if the compiler actually supports
403 inline functions.
404
405 =back
406
407 =head1 Selected Bug Fixes
408
409 =over 4
410
411 =item *
412
413 A possible memory leak when using L<caller()|perlfunc/"caller EXPR"> to set
414 C<@DB::args> has been fixed.
415
416 =item *
417
418 Several memory leaks when loading XS modules were fixed.
419
420 =item *
421
422 A panic in the regular expression optimizer has been fixed (RT#75762).
423
424 =item *
425
426 Assignments to lvalue subroutines now honor copy-on-write behavior again, which
427 has been broken since version 5.10.0 (RT#75656).
428
429 =item *
430
431 Assignments to glob copies now behave just like assignments to regular globs
432 (RT#1804).
433
434 =item *
435
436 Within signal handlers, C<$!> is now implicitly localized.
437
438 =item *
439
440 L<readline|perlfunc/"readline EXPR"> now honors C<< <> >> overloading on tied
441 arguments.
442
443 =item *
444
445 L<substr()|perlfunc/"substr EXPR,OFFSET,LENGTH,REPLACEMENT">,
446 L<pos()|perlfunc/"index STR,SUBSTR,POSITION">, L<keys()|perlfunc/"keys HASH">,
447 and L<vec()|perlfunc/"vec EXPR,OFFSET,BITS"> could, when used in combination
448 with lvalues, result in leaking the scalar value they operate on, and cause its
449 destruction to happen too late. This has now been fixed.
450
451 =item *
452
453 Building with C<PERL_GLOBAL_STRUCT>, which has been broken accidentally in
454 5.13.3, now works again.
455
456 =back
457
458 =head1 Known Problems
459
460 =over 4
461
462 =item *
463
464 The changes in L<substr()|perlfunc/"substr EXPR,OFFSET,LENGTH,REPLACEMENT">
465 broke C<HTML::Parser> <= 3.66. A fixed C<HTML::Parser> is available as version
466 3.67 on CPAN.
467
468 =item *
469
470 The changes in prototype handling break C<Switch>. A patch has been sent
471 upstream and will hopefully appear on CPAN soon.
472
473 =back
474
475 =head1 Acknowledgements
476
477 Perl 5.13.4 represents approximately one month of development since Perl 5.13.3,
478 and contains XXX lines of changes across XXX files from XXX authors and
479 committers.
480
481 Thank you to the following for contributing to this release:
482
483 XXX The list of people to thank goes here.
484
485 =head1 Reporting Bugs
486
487 If you find what you think is a bug, you might check the articles recently
488 posted to the comp.lang.perl.misc newsgroup and the perl bug database at
489 http://rt.perl.org/perlbug/ .  There may also be information at
490 http://www.perl.org/ , the Perl Home Page.
491
492 If you believe you have an unreported bug, please run the B<perlbug> program
493 included with your release.  Be sure to trim your bug down to a tiny but
494 sufficient test case.  Your bug report, along with the output of C<perl -V>,
495 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
496
497 If the bug you are reporting has security implications, which make it
498 inappropriate to send to a publicly archived mailing list, then please send it
499 to perl5-security-report@perl.org. This points to a closed subscription
500 unarchived mailing list, which includes all the core committers, who be able to
501 help assess the impact of issues, figure out a resolution, and help co-ordinate
502 the release of patches to mitigate or fix the problem across all platforms on
503 which Perl is supported. Please only use this address for security issues in the
504 Perl core, not for modules independently distributed on CPAN.
505
506 =head1 SEE ALSO
507
508 The F<Changes> file for an explanation of how to view exhaustive details
509 on what changed.
510
511 The F<INSTALL> file for how to build Perl.
512
513 The F<README> file for general stuff.
514
515 The F<Artistic> and F<Copying> files for copyright information.
516
517 =cut