This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
combine sections
[perl5.git] / pod / perldelta.pod
1 =encoding utf8
2
3 =for todo
4 83b195e49dd1 ensure correctness if sv_2mortal modifies errno
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.17.1
12
13 =head1 DESCRIPTION
14
15 This document describes differences between the 5.17.0 release and
16 the 5.17.1 release.
17
18 If you are upgrading from an earlier release such as 5.16.0, first read
19 L<perl5170delta>, which describes differences between 5.16.0 and
20 5.17.0.
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 [ List each enhancement as a =head2 entry ]
33
34 =head2 More CORE:: subs
35
36 Several more built-in functions have been added as subroutines to the
37 CORE:: namespace, namely, those non-overridable keywords that can be
38 implemented without custom parsers: C<defined>, C<delete>, C<exists>,
39 C<glob>, C<pos>, C<protoytpe>, C<scalar>, C<split>, C<study>, and C<undef>.
40
41 As some of these have prototypes, C<prototype('CORE::...')> has been
42 changed to not make a distinction between overridable and non-overridable
43 keywords.  This is to make C<prototype('CORE::pos')> consistent with
44 C<prototype(&CORE::pos)>.
45
46 =head1 Security
47
48 XXX Any security-related notices go here.  In particular, any security
49 vulnerabilities closed should be noted here rather than in the
50 L</Selected Bug Fixes> section.
51
52 [ List each security issue as a =head2 entry ]
53
54 =head1 Incompatible Changes
55
56 XXX For a release on a stable branch, this section aspires to be:
57
58     There are no changes intentionally incompatible with 5.XXX.XXX
59     If any exist, they are bugs, and we request that you submit a
60     report.  See L</Reporting Bugs> below.
61
62 =head2 C</(?{})/> and C</(??{}> have been heavily reworked.
63
64 The implementation of this feature has been almost completely rewritten.
65 Although its main intent is to fix bugs, some behaviours, especially
66 related to the scope of lexical variables, will have changed.  This is
67 described more fully in the L</Selected Bug Fixes> section.
68
69 =head2 C<\N{BELL}> now refers to U+1F514 instead of U+0007
70
71 Unicode 6.0 reused the name "BELL" for a different code point than it
72 traditionally had meant.  Since Perl v5.14, use of this name still
73 referred to U+0007, but would raise a deprecated warning.  Now, "BELL"
74 refers to U+1F514, and the name for U+0007 is "ALERT".  All the
75 functions in L<charnames> have been correspondingly updated.
76
77 =head2 Alphanumeric operators must now be separated from the closing
78 delimiter of regular expressions
79
80 You may no longer write something like:
81
82  m/a/and 1
83
84 Instead you must write
85
86  m/a/ and 1
87
88 with whitespace separating the operator from the closing delimiter of
89 the regular expression.  Not having whitespace has resulted in a
90 deprecated warning since Perl v5.14.0.
91
92 =head2 C<require> dies for unreadable files
93
94 When C<require> encounters an unreadable file, it now dies.  It used to
95 ignore the file and continue searching the directories in @INC
96 [perl #113422].
97
98 =head1 Deprecations
99
100 XXX Any deprecated features, syntax, modules etc. should be listed here.
101 In particular, deprecated modules should be listed here even if they are
102 listed as an updated module in the L</Modules and Pragmata> section.
103
104 [ List each deprecation as a =head2 entry ]
105
106 =head1 Performance Enhancements
107
108 XXX Changes which enhance performance without changing behaviour go here. There
109 may well be none in a stable release.
110
111 [ List each enhancement as a =item entry ]
112
113 =over 4
114
115 =item *
116
117 The C<x> repetition operator is now folded to a single constant at compile
118 time if called in scalar context with constant operands and no parentheses
119 around the left operand.
120
121 =back
122
123 =head1 Modules and Pragmata
124
125 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
126 go here.  If Module::CoreList is updated, generate an initial draft of the
127 following sections using F<Porting/corelist-perldelta.pl>, which prints stub
128 entries to STDOUT.  Results can be pasted in place of the '=head2' entries
129 below.  A paragraph summary for important changes should then be added by hand.
130 In an ideal world, dual-life modules would have a F<Changes> file that could be
131 cribbed.
132
133 [ Within each section, list entries as a =item entry ]
134
135 =head2 New Modules and Pragmata
136
137 =over 4
138
139 =item *
140
141 XXX
142
143 =back
144
145 =head2 Updated Modules and Pragmata
146
147 =over 4
148
149 =item *
150
151 L<ExtUtils::CBuilder> has been upgraded from version 0.280206 to 0.280208.
152
153 Manifest files are now correctly embedded for those versions of VC++ which
154 make use of them. [perl #111782, #111798].
155
156 =item *
157
158 L<B> has been upgraded from version 1.35 to 1.36.
159
160 C<B::COP::stashlen> has been replaced with C<B::COP::stashoff>.
161
162 C<B::COP::stashpv> now supports UTF8 package names and embedded nulls.
163
164 =item *
165
166 L<Class::Struct> has been upgraded from version 0.63 to 0.64.
167
168 The constructor now respects overridden accessor methods [perl #29230].
169
170 =item *
171
172 L<DynaLoader> has been upgraded from version 1.14 to 1.15.
173
174 This is due to a minor code change in the XS for the VMS implementation.
175
176 =item *
177
178 L<File::DosGlob> has been upgraded from version 1.07 to 1.08.
179
180 There are no visible changes, only minor internal refactorings.
181
182 =item *
183
184 L<File::Spec::Unix> has been upgraded from version 3.39_02 to 3.39_03.
185
186 C<abs2rel> could produce incorrect results when given two relative paths or
187 the root directory twice [perl #111510].
188
189 =item *
190
191 L<IO> has been upgraded from version 1.25_06 to 1.25_07.
192
193 C<sync()> can now be called on read-only file handles [perl #64772].
194
195 =item *
196
197 L<Pod::Html> has been upgraded from version 1.15_02 to 1.16.
198
199 The option C<--libpods> has been reinstated. It is deprecated, and its use
200 does nothing other than issue a warning that it is no longer supported.
201
202 =item *
203
204 L<Unicode::UCD> has been upgraded from version 0.43 to 0.44.
205
206 This adds a function L<all_casefolds()|Unicode::UCD/all_casefolds()>
207 that returns all the casefolds.
208
209 =item *
210
211 L<Scalar::Util> has been upgraded from version 1.23 to version 1.25.
212
213 =back
214
215 =head2 Removed Modules and Pragmata
216
217 =over 4
218
219 =item *
220
221 XXX
222
223 =back
224
225 =head1 Documentation
226
227 XXX Changes to files in F<pod/> go here.  Consider grouping entries by
228 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
229
230 =head2 New Documentation
231
232 XXX Changes which create B<new> files in F<pod/> go here.
233
234 =head3 L<XXX>
235
236 XXX Description of the purpose of the new file here
237
238 =head2 Changes to Existing Documentation
239
240 XXX Changes which significantly change existing files in F<pod/> go here.
241 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
242 section.
243
244 =head3 L<perlfaq>
245
246 =over 4
247
248 =item *
249
250 L<perlfaq> has been synchronised with version 5.0150040 from C<CPAN>.
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 [ Within each section, list entries as a =item entry that links to perldiag,
264   e.g.
265
266   =item *
267
268   L<Invalid version object|perldiag/"Invalid version object">
269 ]
270
271 =head2 New Diagnostics
272
273 XXX Newly added diagnostic messages go here
274
275 =head3 New Errors
276
277 =over 4
278
279 =item *
280
281 XXX L<message|perldiag/"message">
282
283 =back
284
285 =head3 New Warnings
286
287 =over 4
288
289 =item *
290
291 XXX L<message|perldiag/"message">
292
293 =back
294
295 =head2 Changes to Existing Diagnostics
296
297 XXX Changes (i.e. rewording) of diagnostic messages go here
298
299 =over 4
300
301 =item *
302
303 XXX Describe change here
304
305 =back
306
307 =head2 Removals of Diagnostics
308
309 =over 4
310
311 =item *
312
313 The "Runaway prototype" warning that occurs in bizarre cases has been
314 removed as being unhelpful and inconsistent.
315
316 =item *
317
318 The "Not a format reference" error has been removed, as the only case in
319 which it could be triggered was a bug.
320
321 =back
322
323 =head1 Utility Changes
324
325 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
326 here. Most of these are built within the directories F<utils> and F<x2p>.
327
328 [ List utility changes as a =head3 entry for each utility and =item
329 entries for each change
330 Use L<XXX> with program names to get proper documentation linking. ]
331
332 =head3 L<XXX>
333
334 =over 4
335
336 =item *
337
338 XXX
339
340 =back
341
342 =head1 Configuration and Compilation
343
344 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
345 go here.  Any other changes to the Perl build process should be listed here.
346 However, any platform-specific changes should be listed in the
347 L</Platform Support> section, instead.
348
349 [ List changes as a =item entry ].
350
351 =over 4
352
353 =item *
354
355 XXX
356
357 =back
358
359 =head1 Testing
360
361 XXX Any significant changes to the testing of a freshly built perl should be
362 listed here.  Changes which create B<new> files in F<t/> go here as do any
363 large changes to the testing harness (e.g. when parallel testing was added).
364 Changes to existing files in F<t/> aren't worth summarising, although the bugs
365 that they represent may be covered elsewhere.
366
367 [ List each test improvement as a =item entry ]
368
369 =over 4
370
371 =item *
372
373 XXX
374
375 =back
376
377 =head1 Platform Support
378
379 XXX Any changes to platform support should be listed in the sections below.
380
381 [ Within the sections, list each platform as a =item entry with specific
382 changes as paragraphs below it. ]
383
384 =head2 New Platforms
385
386 XXX List any platforms that this version of perl compiles on, that previous
387 versions did not. These will either be enabled by new files in the F<hints/>
388 directories, or new subdirectories and F<README> files at the top level of the
389 source tree.
390
391 =over 4
392
393 =item XXX-some-platform
394
395 XXX
396
397 =back
398
399 =head2 Discontinued Platforms
400
401 XXX List any platforms that this version of perl no longer compiles on.
402
403 =over 4
404
405 =item XXX-some-platform
406
407 XXX
408
409 =back
410
411 =head2 Platform-Specific Notes
412
413 XXX List any changes for specific platforms. This could include configuration
414 and compilation changes or changes in portability/compatibility.  However,
415 changes within modules for platforms should generally be listed in the
416 L</Modules and Pragmata> section.
417
418 =over 4
419
420 =item Win32
421
422 C<link> on Win32 now attempts to set C<$!> to more appropriate values
423 based on the Win32 API error code. [perl #112272]
424
425 Perl no longer mangles the environment block, e.g. when launching a new
426 sub-process, when the environment contains non-ASCII characters. Known
427 problems still remain, however, when the environment contains characters
428 outside of the current ANSI codepage (e.g. see the item about Unicode in
429 C<%ENV> in L<http://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/todo.pod>).
430 [perl #113536]
431
432 =back
433
434 =head1 Internal Changes
435
436 XXX Changes which affect the interface available to C<XS> code go here.
437 Other significant internal changes for future core maintainers should
438 be noted as well.
439
440 [ List each change as a =item entry ]
441
442 =over 4
443
444 =item *
445
446 The C<study> function was made a no-op in 5.16.  It was simply disabled via
447 a C<return> statement; the code was left in place.  Now the code supporting
448 what C<study> used to do has been removed.
449
450 =item *
451
452 Under threaded perls, there is no longer a separate PV allocated for every
453 COP to store its package name (C<< cop->stashpv >>).  Instead, there is an
454 offset (C<< cop->stashoff >>) into the new C<PL_stashpad> array, which
455 holds stash pointers.
456
457 =item *
458
459 In the pluggable regex API, the C<regexp_engine> struct has acquired a new
460 field C<op_comp>, which is currently just for perl's internal use, and
461 should be initialised to NULL by other regex plugin modules.
462
463 =item *
464
465 A new function C<alloccoptash> has been added to the API, but is considered
466 experimental.  See L<perlapi>.
467
468 =back
469
470 =head1 Selected Bug Fixes
471
472 XXX Important bug fixes in the core language are summarised here.
473 Bug fixes in files in F<ext/> and F<lib/> are best summarised in
474 L</Modules and Pragmata>.
475
476 [ List each fix as a =item entry ]
477
478 =over 4
479
480 =item *
481
482 The implementation of code blocks in regular expressions, such as C<(?{})>
483 and C<(??{})> has been heavily reworked to eliminate a whole slew of bugs.
484 The main user-visible changes are:
485
486 =over 4
487
488 =item *
489
490 Code blocks within patterns are now parsed in the same pass as the
491 surrounding code; in particular it is no longer necessary to have balanced
492 braces: this now works:
493
494     /(?{  $x='{'  })/
495
496 This means that this error message is longer generated:
497
498     Sequence (?{...}) not terminated or not {}-balanced in regex
499
500 but a new error may be seen:
501
502     Sequence (?{...}) not terminated with ')'
503
504 In addition, literal code blocks within run-time patterns are only
505 compiled once, at perl compile-time:
506
507     for my $p (...) {
508         # this 'FOO' block of code is compiled once,
509         # at the same time as the surrounding 'for' loop
510         /$p{(?{FOO;})/;
511     }
512
513 =item *
514
515 Lexical variables are now sane as regards scope, recursion and closure
516 behaviour. In particular, C</A(?{B})C/> behaves (from a closure viewpoint)
517 exactly like C</A/ && do { B } && /C/>, while  C<qr/A(?{B})C/> is like
518 C<sub {/A/ && do { B } && /C/}>. So this code now works how you might
519 expect, creating three regexes that match 0, 1, and 2:
520
521     for my $i (0..2) {
522         push @r, qr/^(??{$i})$/;
523     }
524     "1" =~ $r[1]; # matches
525
526 =item *
527
528 The C<use re 'eval'> pragma is now only required for code blocks defined
529 at runtime; in particular in the following, the text of the C<$r> pattern is
530 still interpolated into the new pattern and recompiled, but the individual
531 compiled code-blocks within C<$r> are reused rather than being recompiled,
532 and C<use re 'eval'> isn't needed any more:
533
534     my $r = qr/abc(?{....})def/;
535     /xyz$r/;
536
537 =item *
538
539 Flow control operators no longer crash. Each code block runs in a new
540 dynamic scope, so C<next> etc. will not see any enclosing loops and
541 C<caller> will not see any calling subroutines. C<return> returns a value
542 from the code block, not from any enclosing subroutine.
543
544 =item *
545
546 Perl normally caches the compilation of run-time patterns, and doesn't
547 recompile if the pattern hasn't changed; but this is now disabled if
548 required for the correct behaviour of closures; for example:
549
550     my $code = '(??{$x})';
551     for my $x (1..3) {
552         # recompile to see fresh value of $x each time
553         $x =~ /$code/;
554     }
555
556
557 =item *
558
559 The C</msix> and C<(?msix)> etc. flags are now propagated into the return
560 value from C<(??{})>; this now works:
561
562     "AB" =~ /a(??{'b'})/i;
563
564 =item *
565
566 Warnings and errors will appear to come from the surrounding code (or for
567 run-time code blocks, from an eval) rather than from an C<re_eval>:
568
569     use re 'eval'; $c = '(?{ warn "foo" })'; /$c/;
570     /(?{ warn "foo" })/;
571
572 formerly gave:
573
574     foo at (re_eval 1) line 1.
575     foo at (re_eval 2) line 1.
576
577 and now gives:
578
579     foo at (eval 1) line 1.
580     foo at /some/prog line 2.
581
582 =back
583
584 =item *
585
586 Perl now works as well as can be expected on all releases of Unicode so
587 far.  In v5.16, it worked on Unicodes 6.0 and 6.1, but there were
588 various bugs for earlier releases; the older the release the more
589 problems.
590
591 =item *
592
593 C<vec> no longer produces "uninitialized" warnings in lvalue context
594 [perl #9423].
595
596 =item *
597
598 An optimisation involving fixed strings in regular expressions could cause
599 a severe performance penalty in edge cases.  This has been fixed
600 [perl #76546].
601
602 =item *
603
604 The "Can't find an opnumber" message that C<prototype> produces when passed
605 a string like "CORE::nonexistent_keyword" now passes UTF8 and embedded
606 nuls through unchanged [perl #97478].
607
608 =item *
609
610 C<prototype> now treats magical variables like C<$1> the same way as
611 non-magical variables when checking for the CORE:: prefix, instead of
612 treating them as subroutine names.
613
614 =item *
615
616 Under threaded perls, a runtime code block in a regular expression could
617 corrupt the package name stored in the op tree, resulting in bad reads
618 in C<caller>, and possibly crashes [perl #113060].
619
620 =item *
621
622 Referencing a closure prototype (C<\&{$_[1]}> in an attribute handler for a
623 closure) no longer results in a copy of the subroutine (or assertion
624 failures on debugging builds).
625
626 =item *
627
628 C<eval '__PACKAGE__'> now returns the right answer on threaded builds if
629 the current package has been assigned over (as in
630 C<*ThisPackage:: = *ThatPackage::>) [perl #78742].
631
632 =item *
633
634 If a package is deleted by code that it calls, it is possible for C<caller>
635 to see a stack frame belonging to that deleted package.  C<caller> could
636 crash if the stash's memory address was reused for a scalar and a
637 substitution was performed on the same scalar [perl #113486].
638
639 =item *
640
641 C<UNIVERSAL::can> no longer treats its first argument differently
642 depending on whether it is a string or number internally.
643
644 =item *
645
646 C<open> with "<&" for the mode checks to see whether the third argument is
647 a number, in determining whether to treat it as a file descriptor or a
648 handle name.  Magical variables like C<$1> were always failing the numeric
649 check and being treated as handle names.
650
651 =item *
652
653 C<warn>'s handling of magical variables (C<$1>, ties) has undergone several
654 fixes.  FETCH is only called once now on a tied argument or a tied C<$@>
655 [perl #97480].  Tied variables returning objects that stringify as "" are
656 no longer ignored.  A tied C<$@> that happened to return a reference the
657 I<previous> time is was used is no longer ignored.
658
659 =item *
660
661 C<warn ""> now treats C<$@> with a number in it the same way, regardless of
662 whether it happened via C<$@=3> or C<$@="3">.  It used to ignore the
663 former.  Now it appends "\t...caught", as it has always done with
664 C<$@="3">.
665
666 =item *
667
668 Numeric operators on magical variables (e.g., S<C<$1 + 1>>) used to use
669 floating point operations even where integer operations were more appropriate,
670 resulting in loss of accuracy on 64-bit platforms [perl #109542].
671
672 =item *
673
674 Unary negation no longer treats a string as a number if the string happened
675 to be used as a number at some point.  So, if C<$x> contains the string "dogs",
676 C<-$x> returns "-dogs" even if C<$y=0+$x> has happened at some point.
677
678 =item *
679
680 In Perl 5.14, C<-'-10'> was fixed to return "10", not "+10".  But magical
681 variables (C<$1>, ties) were not fixed till now [perl #57706].
682
683 =item *
684
685 Unary negation now treats strings consistently, regardless of the internal
686 UTF8 flag.
687
688 =item *
689
690 A regression introduced in Perl v5.16.0 involving
691 C<tr/I<SEARCHLIST>/I<REPLACEMENTLIST>/> has been fixed.  Only the first
692 instance is supposed to be meaningful if a character appears more than
693 once in C<I<SEARCHLIST>>.  Under some circumstances, the final instance
694 was overriding all earlier ones.  [perl #113584]
695
696 =item *
697
698 Regular expressions like C<qr/\87/> previously silently inserted a NUL
699 character, thus matching as if it had been written C<qr/\00087/>.  Now it
700 matches as if it had been written as C<qr/87/>, with a message that the
701 sequence C<"\8"> is unrecognized.
702
703 =item *
704
705 C<__SUB__> now works in special blocks (BEGIN, END, etc.).
706
707 =item *
708
709 Thread creation on Windows could theoretically result in a crash if done
710 inside a BEGIN block.  It still does not work properly, but it no longer
711 crashes [perl #111610].
712
713 =back
714
715 =head1 Known Problems
716
717 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
718 tests that had to be C<TODO>ed for the release would be noted here, unless
719 they were specific to a particular platform (see below).
720
721 This is a list of some significant unfixed bugs, which are regressions
722 from either 5.XXX.XXX or 5.XXX.XXX.
723
724 [ List each fix as a =item entry ]
725
726 =over 4
727
728 =item *
729
730 XXX
731
732 =back
733
734 =head1 Obituary
735
736 XXX If any significant core contributor has died, we've added a short obituary
737 here.
738
739 =head1 Acknowledgements
740
741 XXX Generate this with:
742
743   perl Porting/acknowledgements.pl v5.17.0..HEAD
744
745 =head1 Reporting Bugs
746
747 If you find what you think is a bug, you might check the articles
748 recently posted to the comp.lang.perl.misc newsgroup and the perl
749 bug database at http://rt.perl.org/perlbug/ .  There may also be
750 information at http://www.perl.org/ , the Perl Home Page.
751
752 If you believe you have an unreported bug, please run the L<perlbug>
753 program included with your release.  Be sure to trim your bug down
754 to a tiny but sufficient test case.  Your bug report, along with the
755 output of C<perl -V>, will be sent off to perlbug@perl.org to be
756 analysed by the Perl porting team.
757
758 If the bug you are reporting has security implications, which make it
759 inappropriate to send to a publicly archived mailing list, then please send
760 it to perl5-security-report@perl.org. This points to a closed subscription
761 unarchived mailing list, which includes
762 all the core committers, who will be able
763 to help assess the impact of issues, figure out a resolution, and help
764 co-ordinate the release of patches to mitigate or fix the problem across all
765 platforms on which Perl is supported. Please only use this address for
766 security issues in the Perl core, not for modules independently
767 distributed on CPAN.
768
769 =head1 SEE ALSO
770
771 The F<Changes> file for an explanation of how to view exhaustive details
772 on what changed.
773
774 The F<INSTALL> file for how to build Perl.
775
776 The F<README> file for general stuff.
777
778 The F<Artistic> and F<Copying> files for copyright information.
779
780 =cut