This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta recent module upgrades
[perl5.git] / pod / perldelta.pod
1 =encoding utf8
2
3 =for release_engineer
4 * changelogged up to 45a6a02
5
6 =head1 NAME
7
8 [ this is a template for a new perldelta file. Any text flagged as
9 XXX needs to be processed before release. ]
10
11 perldelta - what is new for perl v5.13.5
12
13 =head1 DESCRIPTION
14
15 This document describes differences between the 5.13.4 release and
16 the 5.13.5 release.
17
18 If you are upgrading from an earlier release such as 5.13.3, first read
19 L<perl5134delta>, which describes differences between 5.13.3 and
20 5.13.4.
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. Summarise 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 =head2 Adjacent pairs of nextstate opcodes are now optimized away
33
34 Previously, in code such as
35
36     use constant DEBUG => 0;
37
38     sub GAK {
39         warn if DEBUG;
40         print "stuff\n";
41     }
42
43 the ops for C<warn if DEBUG;> would be folded to a C<null> op (C<ex-const>), but
44 the C<nextstate> op would remain, resulting in a runtime op dispatch of
45 C<nextstate>, C<nextstate>, ...
46
47 The execution of a sequence of C<nexstate> ops is indistinguishable from just
48 the last C<nextstate> op, so teach the peephole optimiser to eliminate the first
49 of a pair of C<nextstate> ops. (Except where the first carries a label, as
50 labels mustn't be eliminated by the optimiser, and label usage isn't
51 conclusively known at compile time.)
52
53 =head2 API function to parse statements
54
55 The C<parse_fullstmt> function has been added to allow parsing of a single
56 complete Perl statement. See L<perlapi> for details.
57
58 =head2 API functions for accessing the runtime hinthash
59
60 A new C API for introspecting the hinthash C<%^H> at runtime has been added. See
61 C<cop_hints_2hv>, C<cop_hints_fetchpvn>, C<cop_hints_fetchpvs>,
62 C<cop_hints_fetchsv>, and C<hv_copy_hints_hv> in L<perlapi> for details.
63
64 =head2 C interface to C<caller()>
65
66 The C<caller_cx> function has been added as an XSUB-writer's equivalent of
67 C<caller()>. See L<perlapi> for details.
68
69 =head1 Security
70
71 XXX Any security-related notices go here.  In particular, any security
72 vulnerabilities closed should be noted here rather than in the
73 L</Selected Bug Fixes> section.
74
75 [ List each security issue as a =head2 entry ]
76
77 =head1 Incompatible Changes
78
79 =head2 Magic Variables Outside the Main Package
80
81 In previous versions of perl, magic variables like C<$!>, C<%SIG>, etc.  would
82 'leak' into other packages. So C<%foo::SIG> could be used to access signals,
83 C<${"foo::!"}> (with strict mode off) to access C's C<errno>, etc.
84
85 This was a bug, or an 'unintentional' feature, which caused various ill
86 effects, such as signal handlers being wiped when modules were loaded, etc.
87
88 This has been fixed (or the feature has been removed, depending on how you
89 see it).
90
91 =head2 Smart-matching against array slices
92
93 Previously, the following code resulted in a successful match:
94
95     my @a = qw(a y0 z);
96     my @b = qw(a x0 z);
97     $a[0 .. $#b] ~~ @b;
98
99 This odd behaviour has now been fixed [perl #77468].
100
101 =head2 C API changes
102
103 The first argument of the C API function C<Perl_fetch_cop_label> has changed
104 from C<struct refcounted he *> to C<COP *>, to better insulate the user from
105 implementation details.
106
107 This API function was marked as "may change", and likely isn't in use outside
108 the core. (Neither an unpacked CPAN, nor Google's codesearch, finds any other
109 references to it.)
110
111 =head1 Deprecations
112
113 XXX Any deprecated features, syntax, modules etc. should be listed here.
114 In particular, deprecated modules should be listed here even if they are
115 listed as an updated module in the L</Modules and Pragmata> section.
116
117 =head2 Use of qw(...) as parentheses
118
119 Historically the parser fooled itself into thinking that C<qw(...)> literals
120 were always enclosed in parentheses, and as a result you could sometimes omit
121 parentheses around them:
122
123     for $x qw(a b c) { ... }
124
125 The parser no longer lies to itself in this way.  Wrap the list literal in
126 parentheses, like:
127
128     for $x (qw(a b c)) { ... }
129
130 =head1 Performance Enhancements
131
132 XXX Changes which enhance performance without changing behaviour go here. There
133 may well be none in a stable release.
134
135 [ List each enhancement as a =item entry ]
136
137 =over 4
138
139 =item *
140
141 Scalars containing regular expressions now only allocate the part of the C<SV>
142 body they actually use, saving some space.
143
144 =item *
145
146 Compiling regular expressions has been made faster for the case where upgrading
147 the regex to utf8 is necessary, but that isn't known when the compilation
148 begins.
149
150 =back
151
152 =head1 Modules and Pragmata
153
154 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
155 go here.  If Module::CoreList is updated, generate an initial draft of the
156 following sections using F<Porting/corelist-perldelta.pl>, which prints stub
157 entries to STDOUT.  Results can be pasted in place of the '=head2' entries
158 below.  A paragraph summary for important changes should then be added by hand.
159 In an ideal world, dual-life modules would have a F<Changes> file that could be
160 cribbed.
161
162 [ Within each section, list entries as a =item entry ]
163
164 =head2 New Modules and Pragmata
165
166 =over 4
167
168 =item *
169
170 XXX
171
172 =back
173
174 =head2 Updated Modules and Pragmata
175
176 =over 4
177
178 =item *
179
180 C<blib> has been upgraded from version 1.05 to 1.06.
181
182 =item *
183
184 C<bignum>, C<bigint>, and C<bigrat> have been upgraded from version 0.23 to
185 0.25.
186
187 =item *
188
189 C<open> has been upgraded from version 1.07 to 1.08.
190
191 =item *
192
193 C<warnings> has been upgraded from version 1.10 to 1.11.
194
195 C<warnings::register> has been upgraded from version 1.01 to 1.02.
196
197 It is now possible to register warning categories other than the names of
198 packages using warnings::register.  See L<perllexwarn> for more information.
199
200 =item *
201
202 C<B::Debug> has been upgraded from version 1.12 to 1.16.
203
204 =item *
205
206 C<Data::Dumper> has been upgraded from version 2.126 to 2.128.
207
208 This fixes a crash when using custom sort functions that might cause the stack
209 to change.
210
211 =item *
212
213 C<Encode> has been upgraded from version 2.39 to 2.40.
214
215 =item *
216
217 C<Errno> has been upgraded from version 1.12 to 1.13.
218
219 On some platforms with unusual header files, like Win32/gcc using mingw64
220 headers, some constants which weren't actually error numbers have been exposed
221 by C<Errno>. This has been fixed (RT#77416).
222
223 =item *
224
225 C<ExtUtils::MakeMaker> has been upgraded from version 6.56 to 6.57_05.
226
227 =item *
228
229 C<Filter::Simple> has been upgraded from version 0.84 to 0.85.
230
231 =item *
232
233 C<Hash::Util> has been upgraded from version 0.08 to 0.09.
234
235 =item *
236
237 C<Math::BigInt> has been upgraded from version 1.89_01 to 1.95.
238 C<Math::BigInt::Calc> has been upgraded from version 0.52 to 0.54.
239
240 This fixes, among other things, incorrect results when computing binomial
241 coefficients (RT#77640).
242
243 =item *
244
245 C<Math::BigInt::FastCalc> has been upgraded from version 0.19 to 0.22.
246
247 =item *
248
249 C<Math::BigRat> has been upgraded from version 0.24 to 0.26.
250
251 =item *
252
253 C<Module::CoreList> has been upgraded from version 2.37 to 2.38.
254
255 =item *
256
257 C<POSIX> has been upgraded from version 1.19 to 1.20.
258
259 It now includes constants for POSIX signal constants.
260
261 =item *
262
263 C<Safe> has been upgraded from version 2.27 to 2.28.
264
265 This fixes a possible infinite loop when looking for coderefs.
266
267 =item *
268
269 C<Tie::Hash> has been upgraded from version 1.03 to 1.04.
270
271 Calling C<< Tie::Hash->TIEHASH() >> used to loop forever. Now it C<croak>s.
272
273 =item *
274
275 C<Unicode::Collate> has been upgraded from version 0.56 to 0.59.
276
277 =item *
278
279 C<XSLoader> has been upgraded from version 0.10 to 0.11.
280
281 =back
282
283 =head2 Removed Modules and Pragmata
284
285 =over 4
286
287 =item *
288
289 XXX
290
291 =back
292
293 =head1 Documentation
294
295 XXX Changes to files in F<pod/> go here.  Consider grouping entries by
296 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
297
298 =head2 New Documentation
299
300 XXX Changes which create B<new> files in F<pod/> go here.
301
302 =head3 L<XXX>
303
304 XXX Description of the purpose of the new file here
305
306 =head2 Changes to Existing Documentation
307
308 XXX Changes which significantly change existing files in F<pod/> go here.
309 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
310 section.
311
312 =head3 L<perlapi>
313
314 =over 4
315
316 =item *
317
318 Many of the optree construction functions are now documented.
319
320 =back
321
322 =head3 L<perlfaq>
323
324 L<perlfaq>, L<perlfaq2>, L<perlfaq4>, L<perlfaq5>, L<perlfaq6>, L<perlfaq8>, and
325 L<perlfaq9> have seen various updates and modernisations.
326
327 =head1 Diagnostics
328
329 The following additions or changes have been made to diagnostic output,
330 including warnings and fatal error messages.  For the complete list of
331 diagnostic messages, see L<perldiag>.
332
333 XXX New or changed warnings emitted by the core's C<C> code go here. Also
334 include any changes in L<perldiag> that reconcile it to the C<C> code.
335
336 [ Within each section, list entries as a =item entry ]
337
338 =head2 New Diagnostics
339
340 XXX Newly added diagnostic messages go here
341
342 =over 4
343
344 =item *
345
346 Use of qw(...) as parentheses is deprecated
347
348 =back
349
350 =head2 Changes to Existing Diagnostics
351
352 XXX Changes (i.e. rewording) of diagnostic messages go here
353
354 =over 4
355
356 =item *
357
358 XXX
359
360 =back
361
362 =head1 Utility Changes
363
364 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
365 here. Most of these are built within the directories F<utils> and F<x2p>.
366
367 [ List utility changes as a =head3 entry for each utility and =item
368 entries for each change
369 Use L<XXX> with program names to get proper documentation linking. ]
370
371 =head3 L<h2ph>
372
373 =over 4
374
375 =item *
376
377 The use of a deprecated C<goto> construct has been removed (RT#74404).
378
379 =back
380
381 =head1 Configuration and Compilation
382
383 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
384 go here.  Any other changes to the Perl build process should be listed here.
385 However, any platform-specific changes should be listed in the
386 L</Platform Support> section, instead.
387
388 [ List changes as a =item entry ].
389
390 =over 4
391
392 =item *
393
394 XXX
395
396 =back
397
398 =head1 Testing
399
400 XXX Any significant changes to the testing of a freshly built perl should be
401 listed here.  Changes which create B<new> files in F<t/> go here as do any
402 large changes to the testing harness (e.g. when parallel testing was added).
403 Changes to existing files in F<t/> aren't worth summarising, although the bugs
404 that they represent may be covered elsewhere.
405
406 [ List each test improvement as a =item entry ]
407
408 =over 4
409
410 =item *
411
412 A rare race condition in F<t/op/while_readdir.t> has been fixed, stopping it
413 from failing randomly when running tests in parallel.
414
415 =item *
416
417 The new F<t/op/leaky-magic.t> script tests that magic applied to variables in
418 the main packages does not affect other packages.
419
420 =back
421
422 =head1 Platform Support
423
424 XXX Any changes to platform support should be listed in the sections below.
425
426 [ Within the sections, list each platform as a =item entry with specific
427 changes as paragraphs below it. ]
428
429 =head2 New Platforms
430
431 XXX List any platforms that this version of perl compiles on, that previous
432 versions did not. These will either be enabled by new files in the F<hints/>
433 directories, or new subdirectories and F<README> files at the top level of the
434 source tree.
435
436 =over 4
437
438 =item XXX-some-platform
439
440 XXX
441
442 =back
443
444 =head2 Discontinued Platforms
445
446 XXX List any platforms that this version of perl no longer compiles on.
447
448 =over 4
449
450 =item XXX-some-platform
451
452 XXX
453
454 =back
455
456 =head2 Platform-Specific Notes
457
458 XXX List any changes for specific platforms. This could include configuration
459 and compilation changes or changes in portability/compatibility.  However,
460 changes within modules for platforms should generally be listed in the
461 L</Modules and Pragmata> section.
462
463 =over 4
464
465 =item VMS
466
467 =over 4
468
469 =item *
470
471 Make PerlIOUnix_open honor default permissions on VMS.
472
473 When perlio became the default and unixio became the default bottom layer, the
474 most common path for creating files from Perl became C<PerlIOUnix_open>, which
475 has always explicitly used C<0666> as the permission mask.
476
477 To avoid this, C<0777> is now passed as the permissions to C<open()>. In the VMS
478 CRTL, C<0777> has a special meaning over and above intersecting with the current
479 umask; specifically, it allows Unix syscalls to preserve native default
480 permissions.
481
482 =back
483
484 =back
485
486 =head1 Internal Changes
487
488 XXX Changes which affect the interface available to C<XS> code go here.
489 Other significant internal changes for future core maintainers should
490 be noted as well.
491
492 [ List each test improvement as a =item entry ]
493
494 =over 4
495
496 =item *
497
498 C<CALL_FPTR> and C<CPERLscope> have been removed deprecated.
499
500 Those are left from an old implementation of C<MULTIPLICITY> using C++ objects,
501 which has been removed in 5.8. Nowadays these macros do exactly nothing, so they
502 shouldn't be used anymore.
503
504 For compatibility, they are still defined for external C<XS> code. Only
505 extensions defining C<PERL_CORE> must be updated now.
506
507 =item *
508
509 C<lex_stuff_pvs()> has been added as a convenience macro wrapping
510 C<lex_stuff_pvn()> for literal strings.
511
512 =item *
513
514 The recursive part of the peephole optimizer is how hookable.
515
516 In addition to C<PL_peepp>, for hooking into the toplevel peephole optimizer, a
517 C<PL_rpeepp> is now available to hook into the optimizer recursing into
518 side-chains of the optree.
519
520 =back
521
522 =head1 Selected Bug Fixes
523
524 XXX Important bug fixes in the core language are summarised here.
525 Bug fixes in files in F<ext/> and F<lib/> are best summarised in
526 L</Modules and Pragmata>.
527
528 [ List each fix as a =item entry ]
529
530 =over 4
531
532 =item *
533
534 A regression introduced in perl 5.12.0, making
535 C<< my $x = 3; $x = length(undef) >> result in C<$x> set to C<3> has been
536 fixed. C<$x> will now be C<undef>.
537
538 =item *
539
540 A fatal error in regular expressions when processing UTF-8 data has been fixed
541 (RT#75680).
542
543 =item *
544
545 An erroneous regular expression engine optimization, that caused regex verbs
546 like C<*COMMIT> to sometimes be ignored, has been removed.
547
548 =item *
549
550 The perl debugger now also works in taint mode (RT#76872).
551
552 =item *
553
554 Several memory leaks in cloning and freeing threaded perl interpreters have been
555 fixed (RT#77352).
556
557 =item *
558
559 A possible string corruption when doing regular expression matches on overloaded
560 objects has been fixed (RT#77084).
561
562 =item *
563
564 Magic applied to variables in the main package no longer affects other
565 packages. See L</Magic Variables Outside the Main Package>, above [perl #76138].
566
567 =item *
568
569 Opening a glob reference via C<< open $fh, ">", \*glob >> will no longer cause
570 the glob to be corrupted when the file handle is printed to. This would cause
571 perl to crash whenever the glob's contents were accessed [perl #77492].
572
573 =item *
574
575 The postincrement and postdecrement operators, C<++> and C<--> used to cause
576 leaks when being used on references. This has now been fixed.
577
578 =item *
579
580 A bug when replacing the glob of a loop variable within the loop has been
581 fixed [perl #21469]. This means the following code will no longer crash:
582
583     for $x (...) {
584         *x = *y;
585     }
586
587 =item *
588
589 Perl would segfault if the undocumented C<Internals> functions that
590 used reference prototypes were called with the C<&foo()> syntax,
591 e.g. C<&Internals::SvREADONLY(undef)> [perl #77776].
592
593 These functions now call C<SvROK> on their arguments before
594 dereferencing them with C<SvRV>, and we test for this case in
595 F<t/lib/universal.t>.
596
597 =item *
598
599 When assigning a list with duplicated keys to a hash, the assignment used to
600 return garbage and/or freed values:
601
602    @a = %h = (list with some duplicate keys);
603
604 This has now been fixed [perl #31865].
605
606 =item *
607
608 An earlier release of the 5.13 series of perl changed the semantics of opening a
609 reference to a copy of a glob:
610
611     my $var = *STDOUT;
612     open my $fh, '>', \$var;
613
614 This was a mistake, and the previous behaviour from perl 5.10 and 5.12, which is
615 to treat \$var as a scalar reference, has now been restored.
616
617 =item *
618
619 The regular expression bracketed character class C<[\8\9]> was
620 effectively the same as C<[89\000]>, incorrectly matching a NULL character.
621 It also gave incorrect warnings that the C<8> and C<9> were ignored.
622 Now C<[\8\9]> is the same as C<[89]> and gives legitimate warnings that
623 C<\8> and C<\9> are unrecognized escape sequences, passed-through.
624
625 =item *
626
627 C<warn()> now respects utf8-encoded scalars [perl #45549].
628
629 =back
630
631 =head1 Known Problems
632
633 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
634 tests that had to be C<TODO>ed for the release would be noted here, unless
635 they were specific to a particular platform (see below).
636
637 This is a list of some significant unfixed bugs, which are regressions
638 from either 5.XXX.XXX or 5.XXX.XXX.
639
640 [ List each fix as a =item entry ]
641
642 =over 4
643
644 =item *
645
646 XXX
647
648 =back
649
650 =head1 Obituary
651
652 XXX If any significant core contributor has died, we've added a short obituary
653 here.
654
655 =head1 Acknowledgements
656
657 XXX The list of people to thank goes here.
658
659 =head1 Reporting Bugs
660
661 If you find what you think is a bug, you might check the articles
662 recently posted to the comp.lang.perl.misc newsgroup and the perl
663 bug database at http://rt.perl.org/perlbug/ .  There may also be
664 information at http://www.perl.org/ , the Perl Home Page.
665
666 If you believe you have an unreported bug, please run the B<perlbug>
667 program included with your release.  Be sure to trim your bug down
668 to a tiny but sufficient test case.  Your bug report, along with the
669 output of C<perl -V>, will be sent off to perlbug@perl.org to be
670 analysed by the Perl porting team.
671
672 If the bug you are reporting has security implications, which make it
673 inappropriate to send to a publicly archived mailing list, then please send
674 it to perl5-security-report@perl.org. This points to a closed subscription
675 unarchived mailing list, which includes all the core committers, who be able
676 to help assess the impact of issues, figure out a resolution, and help
677 co-ordinate the release of patches to mitigate or fix the problem across all
678 platforms on which Perl is supported. Please only use this address for
679 security issues in the Perl core, not for modules independently
680 distributed on CPAN.
681
682 =head1 SEE ALSO
683
684 The F<Changes> file for an explanation of how to view exhaustive details
685 on what changed.
686
687 The F<INSTALL> file for how to build Perl.
688
689 The F<README> file for general stuff.
690
691 The F<Artistic> and F<Copying> files for copyright information.
692
693 =cut