This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add perldelta for 517bb5c6f8
[perl5.git] / pod / perldelta.pod
1 =encoding utf8
2
3 =for todo
4 ba593ad davem    clone() wasn't cloning the whole stack
5 7dc8663 demerphq Hash Function Change - Murmur hash and true per process...
6
7 =head1 NAME
8
9 [ this is a template for a new perldelta file.  Any text flagged as XXX needs
10 to be processed before release. ]
11
12 perldelta - what is new for perl v5.17.6
13
14 =head1 DESCRIPTION
15
16 This document describes differences between the 5.17.5 release and the 5.17.6
17 release.
18
19 If you are upgrading from an earlier release such as 5.17.4, first read
20 L<perl5175delta>, which describes differences between 5.17.4 and 5.17.5.
21
22 =head1 Notice
23
24 XXX Any important notices here
25
26 =head1 Core Enhancements
27
28 XXX New core language features go here.  Summarize user-visible core language
29 enhancements.  Particularly prominent performance optimisations could go
30 here, but most should go in the L</Performance Enhancements> section.
31
32 [ List each enhancement as a =head2 entry ]
33
34 =head2 Character name aliases may now include non-Latin1-range characters
35
36 It is possible to define your own names for characters for use in
37 C<\N{...}>, C<charnames::vianame()>, etc.  These names can now be
38 comprised of characters from the whole Unicode range.  This allows for
39 names to be in your native language, and not just English.  Certain
40 restrictions apply to the characters that may be used (you can't define
41 a name that has punctuation in it, for example).  See L<charnames/CUSTOM
42 ALIASES>.
43
44 =head2 New hash function Murmurhash-32 (v3)
45
46 We have switched perls hash function to use Murmurhash-32 and added build
47 support for several other hash functions. This new function is expected to
48 performance equivalent for shorter strings and is faster, potentially
49 twice as fast, for hashing longer strings.
50
51 =head1 Security
52
53 XXX Any security-related notices go here.  In particular, any security
54 vulnerabilities closed should be noted here rather than in the
55 L</Selected Bug Fixes> section.
56
57 [ List each security issue as a =head2 entry ]
58
59 =head1 Incompatible Changes
60
61 XXX For a release on a stable branch, this section aspires to be:
62
63     There are no changes intentionally incompatible with 5.XXX.XXX
64     If any exist, they are bugs, and we request that you submit a
65     report.  See L</Reporting Bugs> below.
66
67 [ List each incompatible change as a =head2 entry ]
68
69 =head2 An unknown character name in C<\N{...}> is now a syntax error
70
71 Previously, it warned, and the Unicode REPLACEMENT CHARACTER was
72 substituted.  Unicode now recommends that this situation be a syntax
73 error.  Also, the previous behavior led to some confusing warnings and
74 behaviors, and since the REPLACEMENT CHARACTER has no use other than as
75 a stand-in for some unknown character, any code that has this problem is
76 buggy.
77
78 =head2 Formerly deprecated characters in C<\N{}> character name aliases are now errors.
79
80 Since v5.12.0, it has been deprecated to use certain characters in
81 user-defined C<\N{...}> character names.  These now cause a syntax
82 error.  For example, it is now an error to begin a name with a digit,
83 such as in
84
85  my $undraftable = "\N{4F}";    # Syntax error!
86
87 or to have commas anywhere in the name.  See L<charnames/CUSTOM ALIASES>
88
89 =head2 Per process hash randomization
90
91 The seed used by perls hash function is now random. This means that the
92 order which keys/values will be returned from functions like keys(),
93 values(), and each() will differ from run to run.
94
95 This change was introduced to make perls hashes more robust to algorithmic
96 complexity attacks and also because we discovered that it exposes hash
97 ordering dependency bugs and make them easier to track down.
98
99 Toolchain maintainers might want to invest in additional infrastructure to
100 test for things like this. Running tests several times in a row and then
101 comparing results will make it easier to spot hash order dependencies in
102 code. Author are strongly encouraged not to expose the key order of perls
103 hashes to insecure audiences.
104
105 =head2 PERL_HASH_SEED enviornment variable now takes a hex value
106
107 PERL_HASH_SEED no longer accepts an integer as a parameter, instead the
108 value is expected to be a binary string encoded in hex. This is to make
109 the infrastructure support hash seeds of arbitrary lengths which might
110 exceed that of an integer. (SipHash uses a 16 byte seed).
111
112 =head2 Hash::Util::hash_seed() now returns a string
113
114 Hash::Util::hash_seed() now returns a string instead of an integer. This
115 is to make the infrastructure support hash seeds of arbitrary lengths
116 which might exceed that of an integer. (SipHash uses a 16 byte seed).
117
118 =head2 Output of PERL_HASH_SEED_DEBUG has been changed
119
120 The environment variable PERL_HASH_SEED_DEBUG now shows both the hash
121 function perl was built with AND the seed, in hex in use for that process.
122 Code parsing this output, should it exist, must change to accomodate the
123 new format. Example of the new format:
124
125     $ PERL_HASH_SEED_DEBUG=1 ./perl -e1
126     HASH_FUNCTION = MURMUR3 HASH_SEED = 0x1476bb9f
127
128 =head1 Deprecations
129
130 XXX Any deprecated features, syntax, modules etc. should be listed here.  In
131 particular, deprecated modules should be listed here even if they are listed as
132 an updated module in the L</Modules and Pragmata> section.
133
134 [ List each deprecation as a =head2 entry ]
135
136 =head1 Performance Enhancements
137
138 XXX Changes which enhance performance without changing behaviour go here.
139 There may well be none in a stable release.
140
141 [ List each enhancement as a =item entry ]
142
143 =over 4
144
145 =item *
146
147 Lists of lexical variable declarations (C<my($x, $y)>) are now optimised
148 down to a single op, and are hence faster than before.
149
150 =item *
151
152 A new C preprocessor define NO_TAINT_SUPPORT was added that, if set, disables
153 Perl's taint support altogether. Using the -T or -t command line flags will
154 cause a fatal error. Beware that both core tests as well as many a CPAN
155 distribution's tests will fail with this change. On the upside, it provides
156 a small performance benefit due to reduced branching.
157 Do not enable this unless you know exactly what you are getting yourself into.
158
159 =back
160
161 =head1 Modules and Pragmata
162
163 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
164 go here.  If Module::CoreList is updated, generate an initial draft of the
165 following sections using F<Porting/corelist-perldelta.pl>, which prints stub
166 entries to STDOUT.  Results can be pasted in place of the '=head2' entries
167 below.  A paragraph summary for important changes should then be added by hand.
168 In an ideal world, dual-life modules would have a F<Changes> file that could be
169 cribbed.
170
171 [ Within each section, list entries as a =item entry ]
172
173 =head2 New Modules and Pragmata
174
175 =over 4
176
177 =item *
178
179 XXX
180
181 =back
182
183 =head2 Updated Modules and Pragmata
184
185 =over 4
186
187 =item *
188
189 L<Carp> has been upgraded from version 1.27 to 1.28.
190
191 Carp is no longer confused when C<caller> returns undef for a package that
192 has been deleted.
193
194 =item *
195
196 L<CPAN> has been upgraded from version 1.98 to 1.99_51.
197
198 =item *
199
200 L<DynaLoader> has been upgraded from version 1.16 to 1.17.
201
202 =item *
203
204 L<Env> has been upgraded from version 1.03 to 1.04.
205
206 Its SPLICE implementation no longer misbehaves in list context.
207
208 =item *
209
210 L<Tie::Hash::NamedCapture> has been upgraded from version 0.08 to 0.09.
211
212 =back
213
214 =head2 Removed Modules and Pragmata
215
216 =over 4
217
218 =item *
219
220 XXX
221
222 =back
223
224 =head1 Documentation
225
226 XXX Changes to files in F<pod/> go here.  Consider grouping entries by
227 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
228
229 =head2 New Documentation
230
231 XXX Changes which create B<new> files in F<pod/> go here.
232
233 =head3 L<XXX>
234
235 XXX Description of the purpose of the new file here
236
237 =head2 Changes to Existing Documentation
238
239 XXX Changes which significantly change existing files in F<pod/> go here.
240 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
241 section.
242
243 =head3 L<perlref>
244
245 =over 4
246
247 =item *
248
249 C<*foo{NAME}> and C<*foo{PACKAGE}>, which have existed since perl 5.005,
250 are now documented.
251
252 =back
253
254 =head1 Diagnostics
255
256 The following additions or changes have been made to diagnostic output,
257 including warnings and fatal error messages.  For the complete list of
258 diagnostic messages, see L<perldiag>.
259
260 XXX New or changed warnings emitted by the core's C<C> code go here.  Also
261 include any changes in L<perldiag> that reconcile it to the C<C> code.
262
263 =head2 New Diagnostics
264
265 XXX Newly added diagnostic messages go under here, separated into New Errors
266 and New Warnings
267
268 =head3 New Errors
269
270 =over 4
271
272 =item *
273
274 XXX L<message|perldiag/"message">
275
276 =back
277
278 =head3 New Warnings
279
280 =over 4
281
282 =item *
283
284 XXX L<message|perldiag/"message">
285
286 =back
287
288 =head2 Changes to Existing Diagnostics
289
290 XXX Changes (i.e. rewording) of diagnostic messages go here
291
292 =over 4
293
294 =item *
295
296 XXX Describe change here
297
298 =back
299
300 =head1 Utility Changes
301
302 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
303 Most of these are built within the directories F<utils> and F<x2p>.
304
305 [ List utility changes as a =head3 entry for each utility and =item
306 entries for each change
307 Use L<XXX> with program names to get proper documentation linking. ]
308
309 =head3 L<XXX>
310
311 =over 4
312
313 =item *
314
315 XXX
316
317 =back
318
319 =head1 Configuration and Compilation
320
321 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
322 go here.  Any other changes to the Perl build process should be listed here.
323 However, any platform-specific changes should be listed in the
324 L</Platform Support> section, instead.
325
326 [ List changes as a =item entry ].
327
328 =over 4
329
330 =item *
331
332 XXX
333
334 =back
335
336 =head1 Testing
337
338 XXX Any significant changes to the testing of a freshly built perl should be
339 listed here.  Changes which create B<new> files in F<t/> go here as do any
340 large changes to the testing harness (e.g. when parallel testing was added).
341 Changes to existing files in F<t/> aren't worth summarizing, although the bugs
342 that they represent may be covered elsewhere.
343
344 [ List each test improvement as a =item entry ]
345
346 =over 4
347
348 =item *
349
350 XXX
351
352 =back
353
354 =head1 Platform Support
355
356 XXX Any changes to platform support should be listed in the sections below.
357
358 [ Within the sections, list each platform as a =item entry with specific
359 changes as paragraphs below it. ]
360
361 =head2 New Platforms
362
363 XXX List any platforms that this version of perl compiles on, that previous
364 versions did not.  These will either be enabled by new files in the F<hints/>
365 directories, or new subdirectories and F<README> files at the top level of the
366 source tree.
367
368 =over 4
369
370 =item XXX-some-platform
371
372 XXX
373
374 =back
375
376 =head2 Discontinued Platforms
377
378 =over 4
379
380 =item EPOC
381
382 Support code relating to EPOC has been removed.  EPOC was a family of
383 operating systems developed by Psion for mobile devices.  It was the
384 predecessor of Symbian.  The port was last updated in April 2002.
385
386 =back
387
388 =head2 Platform-Specific Notes
389
390 XXX List any changes for specific platforms.  This could include configuration
391 and compilation changes or changes in portability/compatibility.  However,
392 changes within modules for platforms should generally be listed in the
393 L</Modules and Pragmata> section.
394
395 =over 4
396
397 =item WinCE
398
399 Building on WinCE is now possible once again, although more work is required
400 to fully restore a clean build.
401
402 =back
403
404 =head1 Internal Changes
405
406 XXX Changes which affect the interface available to C<XS> code go here.  Other
407 significant internal changes for future core maintainers should be noted as
408 well.
409
410 [ List each change as a =item entry ]
411
412 =over 4
413
414 =item *
415
416 The private Perl_croak_no_modify has had its context parameter removed. It is
417 now has a void prototype. Users of the public API croak_no_modify remain
418 unaffected.
419
420 =item *
421
422 Copy-on-write (shared hash key) scalars are no longer marked read-only.
423 C<SvREADONLY> returns false on such an SV, but C<SvIsCOW> still returns
424 true.
425
426 =item *
427
428 A new op type, C<OP_PADRANGE> has been introduced. The perl peephole
429 optimiser will, where possible, substitute a single padrange op for a
430 pushmark followed by one or more pad ops, and possibly also skipping list
431 and nextstate ops. In addition, the op can carry out the tasks associated
432 with the RHS of a my(...) = @_ assignment, so those ops may be optimised
433 away too.
434
435 =back
436
437 =head1 Selected Bug Fixes
438
439 XXX Important bug fixes in the core language are summarized here.  Bug fixes in
440 files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
441
442 [ List each fix as a =item entry ]
443
444 =over 4
445
446 =item *
447
448 Uninitialized warnings mentioning hash elements would only mention the
449 element name if it was not in the first bucket of the hash, due to an
450 off-by-one error.
451
452 =item *
453
454 A regular expression optimizer bug could cause multiline "^" to behave
455 incorrectly in the presence of line breaks, such that
456 C<"/\n\n" =~ m#\A(?:^/$)#im> would not match [perl #115242].
457
458 =item *
459
460 Failed C<fork> in list context no longer currupts the stack.
461 C<@a = (1, 2, fork, 3)> used to gobble up the 2 and assign C<(1, undef, 3)>
462 if the C<fork> call failed.
463
464 =item *
465
466 Numerous memory leaks have been fixed, mostly involving tied variables that
467 die, regular expression character classes and code blocks, and syntax
468 errors.
469
470 =item *
471
472 Assigning a regular expression (C<${qr//}>) to a variable that happens to
473 hold a floating point number no longer causes assertion failures on
474 debugging builds.
475
476 =item *
477
478 Assigning a regular expression to a scalar containing a number no longer
479 causes subsequent nummification to produce random numbers.
480
481 =item *
482
483 Assigning a regular expression to a magic variable no longer wipes away the
484 magic.  This is a regression from 5.10.
485
486 =item *
487
488 Assigning a regular expression to a blessed scalar no longer results in
489 crashes.  This is also a regression from 5.10.
490
491 =item *
492
493 Regular expression can now be assigned to tied hash and array elements with
494 flattening into strings.
495
496 =item *
497
498 Nummifying a regular expression no longer results in an uninitialized
499 warning.
500
501 =item *
502
503 Negative array indices no longer cause EXISTS methods of tied variables to
504 be ignored.  This is a regression from 5.12.
505
506 =item *
507
508 Negative array indices no longer result in crashes on arrays tied to
509 non-objects.
510
511 =item *
512
513 C<$x = "(?{})"; /a++(?{})+$x/x> no longer erroneous produces an error (just
514 a warning, as expected).  This was broken in 5.17.1.
515
516 =item *
517
518 C<$byte_overload .= $utf8> no longer results in doubly-encoded UTF8 if the
519 left-hand scalar happened to have produced a UTF8 string the last time
520 overloading was invoked.
521
522 =item *
523
524 C<goto &sub> now uses the current value of @_, instead of using the array
525 the subroutine was originally called with.  This means
526 C<local @_ = (...); goto &sub> now works [perl #43077].
527
528 =item *
529
530 If a debugger is invoked recursively, it no longer stomps on its own
531 lexical variables.  Formerly under recursion all calls would share the same
532 set of lexical variables [perl #115742].
533
534 =item *
535
536 C<*_{ARRAY}> returned from a subroutine no longer spontaneously
537 becomes empty.
538
539 =back
540
541 =head1 Known Problems
542
543 XXX Descriptions of platform agnostic bugs we know we can't fix go here.  Any
544 tests that had to be C<TODO>ed for the release would be noted here.  Unfixed
545 platform specific bugs also go here.
546
547 [ List each fix as a =item entry ]
548
549 =over 4
550
551 =item *
552
553 XXX
554
555 =back
556
557 =head1 Obituary
558
559 XXX If any significant core contributor has died, we've added a short obituary
560 here.
561
562 =head1 Acknowledgements
563
564 XXX Generate this with:
565
566   perl Porting/acknowledgements.pl v5.17.5..HEAD
567
568 =head1 Reporting Bugs
569
570 If you find what you think is a bug, you might check the articles recently
571 posted to the comp.lang.perl.misc newsgroup and the perl bug database at
572 http://rt.perl.org/perlbug/ .  There may also be information at
573 http://www.perl.org/ , the Perl Home Page.
574
575 If you believe you have an unreported bug, please run the L<perlbug> program
576 included with your release.  Be sure to trim your bug down to a tiny but
577 sufficient test case.  Your bug report, along with the output of C<perl -V>,
578 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
579
580 If the bug you are reporting has security implications, which make it
581 inappropriate to send to a publicly archived mailing list, then please send it
582 to perl5-security-report@perl.org.  This points to a closed subscription
583 unarchived mailing list, which includes all the core committers, who will be
584 able to help assess the impact of issues, figure out a resolution, and help
585 co-ordinate the release of patches to mitigate or fix the problem across all
586 platforms on which Perl is supported.  Please only use this address for
587 security issues in the Perl core, not for modules independently distributed on
588 CPAN.
589
590 =head1 SEE ALSO
591
592 The F<Changes> file for an explanation of how to view exhaustive details on
593 what changed.
594
595 The F<INSTALL> file for how to build Perl.
596
597 The F<README> file for general stuff.
598
599 The F<Artistic> and F<Copying> files for copyright information.
600
601 =cut