This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for 8e720305
[perl5.git] / pod / perldelta.pod
1 =encoding utf8
2
3 =for comment
4 This has been completed up to 8e720305, except for:
5 d9a4b459f94297889956ac3adc42707365f274c2
6 bf5522a13a381257966e7ed6b731195a873b153e
7 9cef83062267e94311e1fd8744396e440642738e
8 8e88cfee26d866223a6b3bfffce6270271de00db
9
10 =head1 NAME
11
12 [ this is a template for a new perldelta file. Any text flagged as
13 XXX needs to be processed before release. ]
14
15 perldelta - what is new for perl v5.13.8
16
17 =head1 DESCRIPTION
18
19 This document describes differences between the 5.13.8 release and
20 the 5.13.7 release.
21
22 If you are upgrading from an earlier release such as 5.13.6, first read
23 L<perl5137delta>, which describes differences between 5.13.6 and
24 5.13.7.
25
26 =head1 Notice
27
28 XXX Any important notices here
29
30 =head1 Core Enhancements
31
32 XXX New core language features go here. Summarise user-visible core language
33 enhancements. Particularly prominent performance optimisations could go
34 here, but most should go in the L</Performance Enhancements> section.
35
36 [ List each enhancement as a =head2 entry ]
37
38 =head2 C<-d:-foo> calls C<Devel::foo::unimport>
39
40 The syntax C<-dI<B<:>foo>> was extended in 5.6.1 to make C<-dI<:fooB<=bar>>>
41 equivalent to C<-MDevel::foo=bar>, which expands
42 internally to C<use Devel::foo 'bar';>.
43 F<perl> now allows prefixing the module name with C<->, with the same
44 semantics as C<-M>, I<i.e.>
45
46 =over 4
47
48 =item C<-d:-foo>
49
50 Equivalent to C<-M-Devel::foo>, expands to
51 C<no Devel::foo;>, calls C<< Devel::foo->unimport() >>
52 if the method exists.
53
54 =item C<-d:-foo=bar>
55
56 Equivalent to C<-M-Devel::foo=bar>, expands to C<no Devel::foo 'bar';>,
57 calls C<< Devel::foo->unimport('bar') >> if the method exists.
58
59 =back
60
61 This is particularly useful to suppresses the default actions of a
62 C<Devel::*> module's C<import> method whilst still loading it for debugging.
63
64 =head2 Filehandle method calls load IO::File on demand
65
66 When a method call on a filehandle would die because the method can not
67 be resolved and L<IO::File> has not been loaded, Perl now loads IO::File
68 via C<require> and attempts method resolution again:
69
70   open my $fh, ">", $file;
71   $fh->binmode(":raw");     # loads IO::File and succeeds
72
73 This also works for globs like STDOUT, STDERR and STDIN:
74
75   STDOUT->autoflush(1);
76
77 Because this on-demand load only happens if method resolution fails, the
78 legacy approach of manually loading an IO::File parent class for partial
79 method support still works as expected:
80
81   use IO::Handle;
82   open my $fh, ">", $file;
83   $fh->autoflush(1);        # IO::File not loaded
84
85 =head2 Full functionality for C<use feature 'unicode_strings'>
86
87 This release provides full functionality for C<use feature
88 'unicode_strings'>.  Under its scope, all string operations executed and
89 regular expressions compiled (even if executed outside its scope) have
90 Unicode semantics.   See L<feature>.
91
92 This feature avoids the "Unicode Bug" (See
93 L<perlunicode/The "Unicode Bug"> for details.)  If their is a
94 possibility that your code will process Unicode strings, you are
95 B<strongly> encouraged to use this subpragma to avoid nasty surprises.
96
97 This availability of this should strongly affect the whole tone of
98 various documents, such as L<perlunicode> and L<perluniintro>, but this
99 work has not been done yet.
100
101 =head2 Exception Handling Backcompat Hack
102
103 When an exception is thrown in an C<eval BLOCK>, C<$@> is now set before
104 unwinding, as well as being set after unwinding as the eval block exits.  This
105 early setting supports code that has historically treated C<$@> during unwinding
106 as an indicator of whether the unwinding was due to an exception.  These modules
107 had been broken by 5.13.1's change from setting C<$@> early to setting it late.
108 This double setting arrangement is a stopgap until the reason for unwinding can
109 be made properly introspectable.  C<$@> has never been a reliable indicator of
110 this.
111
112 =head2 DTrace probes now include package name
113
114 The DTrace probes now include an additional argument (C<arg3>) which contains
115 the package the subroutine being entered or left was compiled in.
116
117 For example using the following DTrace script:
118
119   perl$target:::sub-entry
120   {
121       printf("%s::%s\n", copyinstr(arg0), copyinstr(arg3));
122   }
123
124 and then running:
125
126   perl -e'sub test { }; test'
127
128 DTrace will print:
129
130   main::test
131
132 =head2 Stacked labels
133
134 Multiple statement labels can now appear before a single statement.
135
136 =head1 Security
137
138 XXX Any security-related notices go here.  In particular, any security
139 vulnerabilities closed should be noted here rather than in the
140 L</Selected Bug Fixes> section.
141
142 [ List each security issue as a =head2 entry ]
143
144 =head1 Incompatible Changes
145
146 =head2 Attempting to use C<:=> as an empty attribute list is now a syntax error
147
148 Previously C<my $pi := 4;> was exactly equivalent to C<my $pi : = 4;>,
149 with the C<:> being treated as the start of an attribute list, ending before
150 the C<=>. The use of C<:=> to mean C<: => was deprecated in 5.12.0, and is now
151 a syntax error. This will allow the future use of C<:=> as a new token.
152
153 We find no Perl 5 code on CPAN using this construction, outside the core's
154 tests for it, so we believe that this change will have very little impact on
155 real-world codebases.
156
157 If it is absolutely necessary to have empty attribute lists (for example,
158 because of a code generator) then avoid the error by adding a space before
159 the C<=>.
160
161 =head2 Run-time code block in regular expressions
162
163 Code blocks in regular expressions (C<(?{...})> and C<(??{...})>) used not
164 to inherit any pragmata (strict, warnings, etc.) if the regular expression
165 was compiled at run time as happens in cases like these two:
166
167   use re 'eval';
168   $foo =~ $bar; # when $bar contains (?{...})
169   $foo =~ /$bar(?{ $finished = 1 })/;
170
171 This was a bug, which has now been fixed. But it has the potential to break
172 any code that was relying on this bug.
173
174 =head1 Deprecations
175
176 XXX Any deprecated features, syntax, modules etc. should be listed here.
177 In particular, deprecated modules should be listed here even if they are
178 listed as an updated module in the L</Modules and Pragmata> section.
179
180 [ List each deprecation as a =head2 entry ]
181
182 =head2 C<?PATTERN?> is deprecated
183
184 C<?PATTERN?> (without the initial m) has been deprecated and now produces
185 a warning.
186
187 =head2 C<sv_compile_2op> is now deprecated
188
189 The C<sv_compile_2op> is now deprecated, and will be removed. Searches suggest
190 that nothing on CPAN is using it, so this should have zero impact.
191
192 It attempted to provide an API to compile code down to an optree, but failed
193 to bind correctly to lexicals in the enclosing scope. It's not possible to
194 fix this problem within the constraints of its parameters and return value.
195
196 =head2 Tie functions on scalars holding typeglobs
197
198 Calling a tie function (C<tie>, C<tied>, C<untie>) with a scalar argument
199 acts on a file handle if the scalar happens to hold a typeglob.
200
201 This is a long-standing bug that will be removed in Perl 5.16, as
202 there is currently no way to tie the scalar itself when it holds
203 a typeglob, and no way to untie a scalar that has had a typeglob
204 assigned to it.
205
206 This bug was fixed in 5.13.7 but, because of the breakage it caused, the
207 fix has been reverted. Now there is a deprecation warning whenever a tie
208 function is used on a handle without an explicit C<*>.
209
210 =head1 Performance Enhancements
211
212 XXX Changes which enhance performance without changing behaviour go here. There
213 may well be none in a stable release.
214
215 [ List each enhancement as a =item entry ]
216
217 =over 4
218
219 =item *
220
221 XXX
222
223 =back
224
225 =head1 Modules and Pragmata
226
227 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
228 go here.  If Module::CoreList is updated, generate an initial draft of the
229 following sections using F<Porting/corelist-perldelta.pl>, which prints stub
230 entries to STDOUT.  Results can be pasted in place of the '=head2' entries
231 below.  A paragraph summary for important changes should then be added by hand.
232 In an ideal world, dual-life modules would have a F<Changes> file that could be
233 cribbed.
234
235 [ Within each section, list entries as a =item entry ]
236
237 =head2 New Modules and Pragmata
238
239 =over 4
240
241 =item *
242
243 XXX
244
245 =back
246
247 =head2 Updated Modules and Pragmata
248
249 =over 4
250
251 =item *
252
253 C<Devel::SelfStubber> has been upgraded from version 1.04 to 1.05.
254
255 =item *
256
257 C<Digest::SHA> has been upgraded from 5.48 to 5.50
258
259 shasum now more closely mimics sha1sum/md5sum and Addfile
260 accepts all POSIX filenames.
261
262 =item *
263
264 C<Dumpvalue> has been upgraded from version 1.14 to 1.15.
265
266 =item *
267
268 C<Env> has been upgraded from version 1.01 to 1.02.
269
270 =item *
271
272 C<ExtUtils::CBuilder> has been upgraded from 0.2703 to 0.2802
273
274 =item *
275
276 C<if> has been upgraded from 0.06 to 0.0601.
277
278 =item *
279
280 C<Devel::SelfStubber> has been upgraded from version 1.03 to 1.04.
281
282 =item *
283
284 C<IPC::Cmd> has been upgraded from 0.64 to 0.66
285
286 Resolves an issue with splitting Win32 command lines
287 and documentation enhancements.
288
289 =item *
290
291 C<Locale::Codes> has been upgraded from version 3.14 to 3.15
292
293 =item *
294
295 C<Memoize> has been upgraded from version 1.01_03 to 1.02.
296
297 =item *
298
299 C<MIME::Base64> has been upgraded from 3.10 to 3.13
300
301 Now provides encode_base64url and decode_base64url functions to process
302 the base64 scheme for "URL applications".
303
304 =item *
305
306 C<mro> has been upgraded from version 1.05 to 1.06.
307
308 C<next::method> I<et al.> now take into account that every class inherits
309 from UNIVERSAL
310 L<[perl #68654]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=68654>.
311
312 =item *
313
314 C<overload> has been upgraded from 1.11 to 1.12.
315
316 =item *
317
318 C<PerlIO::scalar> has been upgraded from 0.10 to 0.11.
319
320 A C<read> after a C<seek> beyond the end of the string no longer thinks it
321 has data to read
322 L<[perl #78716]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78716>.
323
324 =item *
325
326 C<re> has been upgraded from 0.14 to 0.15.
327
328 =item *
329
330 C<Socket> has been upgraded from 1.91 to 1.92.
331
332 It has several new functions for handling IPv6 addresses.
333
334 =item *
335
336 C<Storable> has been upgraded from 2.24 to 2.25.
337
338 This adds support for serialising code references that contain UTF-8 strings
339 correctly. The Storable minor version number changed as a result -- this means
340 Storable users that set C<$Storable::accept_future_minor> to a C<FALSE> value
341 will see errors (see L<Storable/FORWARD COMPATIBILITY> for more details).
342
343 =item *
344
345 C<Time::HiRes> has been upgraded from 1.9721 to 1.9721_01.
346
347 =item *
348
349 C<Unicode::Collate> has been upgraded from 0.67 to 0.68
350
351 =item *
352
353 C<Unicode::UCD> has been upgraded from 0.29 to 0.30.
354
355 =item *
356
357 C<version> has been upgraded from 0.82 to 0.86.
358
359 =item *
360
361 C<Win32> has been upgraded from 0.039 to 0.040.
362
363 =back
364
365 =head2 Removed Modules and Pragmata
366
367 =over 4
368
369 =item *
370
371 XXX
372
373 =back
374
375 =head1 Documentation
376
377 XXX Changes to files in F<pod/> go here.  Consider grouping entries by
378 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
379
380 =head2 New Documentation
381
382 XXX Changes which create B<new> files in F<pod/> go here.
383
384 =head3 L<XXX>
385
386 XXX Description of the purpose of the new file here
387
388 =head2 Changes to Existing Documentation
389
390 XXX Changes which significantly change existing files in F<pod/> go here.
391 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
392 section.
393
394 =head3 L<XXX>
395
396 =over 4
397
398 =item *
399
400 XXX Description of the change here
401
402 =back
403
404 =head1 Diagnostics
405
406 The following additions or changes have been made to diagnostic output,
407 including warnings and fatal error messages.  For the complete list of
408 diagnostic messages, see L<perldiag>.
409
410 XXX New or changed warnings emitted by the core's C<C> code go here. Also
411 include any changes in L<perldiag> that reconcile it to the C<C> code.
412
413 [ Within each section, list entries as a =item entry ]
414
415 =head2 New Diagnostics
416
417 XXX Newly added diagnostic messages go here
418
419 =over 4
420
421 =item *
422
423 There is a new "Closure prototype called" error.
424
425 =back
426
427 =head2 Changes to Existing Diagnostics
428
429 XXX Changes (i.e. rewording) of diagnostic messages go here
430
431 =over 4
432
433 =item *
434
435 The "Found = in conditional" warning that is emitted when a constant is
436 assigned to a variable in a condition is now withheld if the constant is
437 actually a subroutine or one generated by C<use constant>, since the value
438 of the constant may not be known at the time the program is written
439 L<[perl #77762]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77762>.
440
441 =back
442
443 =head1 Utility Changes
444
445 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
446 here. Most of these are built within the directories F<utils> and F<x2p>.
447
448 [ List utility changes as a =head3 entry for each utility and =item
449 entries for each change
450 Use L<XXX> with program names to get proper documentation linking. ]
451
452 =head3 L<XXX>
453
454 =over 4
455
456 =item *
457
458 XXX
459
460 =back
461
462 =head1 Configuration and Compilation
463
464 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
465 go here.  Any other changes to the Perl build process should be listed here.
466 However, any platform-specific changes should be listed in the
467 L</Platform Support> section, instead.
468
469 [ List changes as a =item entry ].
470
471 =over 4
472
473 =item *
474
475 XXX
476
477 =back
478
479 =head1 Testing
480
481 XXX Any significant changes to the testing of a freshly built perl should be
482 listed here.  Changes which create B<new> files in F<t/> go here as do any
483 large changes to the testing harness (e.g. when parallel testing was added).
484 Changes to existing files in F<t/> aren't worth summarising, although the bugs
485 that they represent may be covered elsewhere.
486
487 [ List each test improvement as a =item entry ]
488
489 =over 4
490
491 =item *
492
493 XXX
494
495 =back
496
497 =head1 Platform Support
498
499 XXX Any changes to platform support should be listed in the sections below.
500
501 [ Within the sections, list each platform as a =item entry with specific
502 changes as paragraphs below it. ]
503
504 =head2 New Platforms
505
506 XXX List any platforms that this version of perl compiles on, that previous
507 versions did not. These will either be enabled by new files in the F<hints/>
508 directories, or new subdirectories and F<README> files at the top level of the
509 source tree.
510
511 =over 4
512
513 =item XXX-some-platform
514
515 XXX
516
517 =back
518
519 =head2 Discontinued Platforms
520
521 XXX List any platforms that this version of perl no longer compiles on.
522
523 =over 4
524
525 =item XXX-some-platform
526
527 XXX
528
529 =back
530
531 =head2 Platform-Specific Notes
532
533 XXX List any changes for specific platforms. This could include configuration
534 and compilation changes or changes in portability/compatibility.  However,
535 changes within modules for platforms should generally be listed in the
536 L</Modules and Pragmata> section.
537
538 =over 4
539
540 =item NetBSD
541
542 The NetBSD hints file has been changed to make the system's malloc the
543 default.
544
545 =back
546
547 =head1 Internal Changes
548
549 XXX Changes which affect the interface available to C<XS> code go here.
550 Other significant internal changes for future core maintainers should
551 be noted as well.
552
553 [ List each test improvement as a =item entry ]
554
555 =over 4
556
557 =item *
558
559 C<mg_findext> and C<sv_unmagicext> have been added.
560
561 These new functions allow extension authors to find and remove magic attached to
562 scalars based on both the magic type and the magic virtual table, similar to how
563 C<sv_magicext> attaches magic of a certain type and with a given virtual table
564 to a scalar. This eliminates the need for extensions to walk the list of
565 C<MAGIC> pointers of an C<SV> to find the magic that belongs to them.
566
567 =item *
568
569 The C<parse_fullexpr()>, C<parse_listexpr(), C<parse_termexpr()> and
570 C<parse_arithexpr()> functions have been added.
571
572 These are for parsing expressions at various precedence levels.
573
574 =back
575
576 =head1 Selected Bug Fixes
577
578 XXX Important bug fixes in the core language are summarised here.
579 Bug fixes in files in F<ext/> and F<lib/> are best summarised in
580 L</Modules and Pragmata>.
581
582 [ List each fix as a =item entry ]
583
584 =over 4
585
586 =item *
587
588 C<BEGIN {require 5.12.0}> now behaves as documented, rather than behaving
589 identically to C<use 5.12.0;>. Previously, C<require> in a C<BEGIN> block
590 was erroneously executing the C<use feature ':5.12.0'> and
591 C<use strict; use warnings;> behaviour, which only C<use> was documented to
592 provide
593 L<[perl #69050]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=69050>.
594
595 =item *
596
597 C<use 5.42>
598 L<[perl #69050]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=69050>,
599 C<use 6> and C<no 5> no longer leak memory.
600
601 =item *
602
603 C<eval "BEGIN{die}"> no longer leaks memory on non-threaded builds.
604
605 =item *
606
607 PerlIO no longer crashes when called recursively, e.g., from a signal
608 handler. Now it just leaks memory
609 L<[perl #75556]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75556>.
610
611 =item *
612
613 Defining a constant with the same name as one of perl's special blocks
614 (e.g., INIT) stopped working in 5.12.0, but has now been fixed
615 L<[perl #78634]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78634>.
616
617 =item *
618
619 A reference to a literal value used as a hash key (C<$hash{\"foo"}>) used
620 to be stringified, even if the hash was tied
621 L<[perl #79178]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=79178>.
622
623 =item *
624
625 A closure containing an C<if> statement followed by a constant or variable
626 is no longer treated as a constant
627 L<[perl #63540]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=63540>.
628
629 =item *
630
631 Calling a closure prototype (what is passed to an attribute handler for a
632 closure) now results in a "Closure prototype called" error message instead
633 of a crash
634 L<[perl #68560]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=68560>.
635
636 =item *
637
638 A regular expression optimisation would sometimes cause a match with a
639 C<{n,m}> quantifier to fail when it should match
640 L<[perl #79152]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=79152>.
641
642 =item *
643
644 What has become known as the "Unicode Bug" is resolved in this release.
645 Under C<use feature 'unicode_strings'>, the internal storage format of a
646 string no longer affects the external semantics.  There are two known
647 exceptions.  User-defined case changing functions, which are planned to
648 be deprecated in 5.14, require utf8-encoded strings to function; and the
649 character C<LATIN SMALL LETTER SHARP S> in regular expression
650 case-insensitive matching has a somewhat different set of bugs depending
651 on the internal storage format.  Case-insensitive matching of all
652 characters that have multi-character matches, as this one does, is
653 problematical in Perl.
654 L<[perl #58182]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=58182>.
655
656 =item *
657
658 Mentioning a read-only lexical variable from the enclosing scope in a
659 string C<eval> would cause the variable to become writable
660 L<[perl #19135]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=19135>.
661
662 =item *
663
664 C<state> can now be used with attributes. It used to mean the same thing as
665 C<my> if attributes were present
666 L<[perl #68658]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=68658>.
667
668 =item *
669
670 Expressions like C<< @$a > 3 >> no longer cause C<$a> to be mentioned in
671 the "Use of uninitialized value in numeric gt" warning when C<$a> is
672 undefined (since it is not part of the C<E<gt>> expression, but the operand
673 of the C<@>)
674 L<[perl #72090]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=72090>.
675
676 =item *
677
678 C<require> no longer causes C<caller> to return the wrong file name for
679 the scope that called C<require> and other scopes higher up that had the
680 same file name
681 L<[perl #68712]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=68712>.
682
683 =item *
684
685 The ref types in the typemap for XS bindings now support magical variables
686 L<[perl #72684]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=72684>.
687
688 =item *
689
690 Match variables (e.g., C<$1>) no longer persist between calls to a sort
691 subroutine
692 L<[perl #76026]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=76026>.
693
694 =item *
695
696 The C<B> module was returning B::OPs instead of B::LOGOPs for C<entertry>
697 L<[perl #80622]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=80622>.
698
699 This was due to a bug in the perl core, not in C<B> itself.
700
701 =back
702
703 =head1 Known Problems
704
705 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
706 tests that had to be C<TODO>ed for the release would be noted here, unless
707 they were specific to a particular platform (see below).
708
709 This is a list of some significant unfixed bugs, which are regressions
710 from either 5.XXX.XXX or 5.XXX.XXX.
711
712 [ List each fix as a =item entry ]
713
714 =over 4
715
716 =item *
717
718 XXX
719
720 =back
721
722 =head1 Obituary
723
724 XXX If any significant core contributor has died, we've added a short obituary
725 here.
726
727 =head1 Acknowledgements
728
729 XXX The list of people to thank goes here.
730
731 =head1 Reporting Bugs
732
733 If you find what you think is a bug, you might check the articles
734 recently posted to the comp.lang.perl.misc newsgroup and the perl
735 bug database at http://rt.perl.org/perlbug/ .  There may also be
736 information at http://www.perl.org/ , the Perl Home Page.
737
738 If you believe you have an unreported bug, please run the L<perlbug>
739 program included with your release.  Be sure to trim your bug down
740 to a tiny but sufficient test case.  Your bug report, along with the
741 output of C<perl -V>, will be sent off to perlbug@perl.org to be
742 analysed by the Perl porting team.
743
744 If the bug you are reporting has security implications, which make it
745 inappropriate to send to a publicly archived mailing list, then please send
746 it to perl5-security-report@perl.org. This points to a closed subscription
747 unarchived mailing list, which includes all the core committers, who be able
748 to help assess the impact of issues, figure out a resolution, and help
749 co-ordinate the release of patches to mitigate or fix the problem across all
750 platforms on which Perl is supported. Please only use this address for
751 security issues in the Perl core, not for modules independently
752 distributed on CPAN.
753
754 =head1 SEE ALSO
755
756 The F<Changes> file for an explanation of how to view exhaustive details
757 on what changed.
758
759 The F<INSTALL> file for how to build Perl.
760
761 The F<README> file for general stuff.
762
763 The F<Artistic> and F<Copying> files for copyright information.
764
765 =cut