4 83b195e49dd1 ensure correctness if sv_2mortal modifies errno
8 [ this is a template for a new perldelta file. Any text flagged as
9 XXX needs to be processed before release. ]
11 perldelta - what is new for perl v5.17.1
15 This document describes differences between the 5.17.0 release and
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
24 XXX Any important notices here
26 =head1 Core Enhancements
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.
32 [ List each enhancement as a =head2 entry ]
34 =head2 More CORE:: subs
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>.
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)>.
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.
52 [ List each security issue as a =head2 entry ]
54 =head1 Incompatible Changes
56 XXX For a release on a stable branch, this section aspires to be:
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.
62 =head2 C</(?{})/> and C</(??{}> have been heavily reworked.
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.
69 =head2 C<\N{BELL}> now refers to U+1F514 instead of U+0007
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.
77 =head2 Alphanumeric operators must now be separated from the closing
78 delimiter of regular expressions
80 You may no longer write something like:
84 Instead you must write
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.
92 =head2 C<require> dies for unreadable files
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
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.
104 [ List each deprecation as a =head2 entry ]
106 =head1 Performance Enhancements
108 XXX Changes which enhance performance without changing behaviour go here. There
109 may well be none in a stable release.
111 [ List each enhancement as a =item entry ]
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.
123 =head1 Modules and Pragmata
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
133 [ Within each section, list entries as a =item entry ]
135 =head2 New Modules and Pragmata
145 =head2 Updated Modules and Pragmata
151 L<ExtUtils::CBuilder> has been upgraded from version 0.280206 to 0.280208.
153 Manifest files are now correctly embedded for those versions of VC++ which
154 make use of them. [perl #111782, #111798].
158 L<B> has been upgraded from version 1.35 to 1.36.
160 C<B::COP::stashlen> has been replaced with C<B::COP::stashoff>.
162 C<B::COP::stashpv> now supports UTF8 package names and embedded nulls.
166 L<Class::Struct> has been upgraded from version 0.63 to 0.64.
168 The constructor now respects overridden accessor methods [perl #29230].
172 L<DynaLoader> has been upgraded from version 1.14 to 1.15.
174 This is due to a minor code change in the XS for the VMS implementation.
178 L<File::DosGlob> has been upgraded from version 1.07 to 1.08.
180 There are no visible changes, only minor internal refactorings.
184 L<File::Spec::Unix> has been upgraded from version 3.39_02 to 3.39_03.
186 C<abs2rel> could produce incorrect results when given two relative paths or
187 the root directory twice [perl #111510].
191 L<IO> has been upgraded from version 1.25_06 to 1.25_07.
193 C<sync()> can now be called on read-only file handles [perl #64772].
197 L<Pod::Html> has been upgraded from version 1.15_02 to 1.16.
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.
204 L<Unicode::UCD> has been upgraded from version 0.43 to 0.44.
206 This adds a function L<all_casefolds()|Unicode::UCD/all_casefolds()>
207 that returns all the casefolds.
211 L<Scalar::Util> has been upgraded from version 1.23 to version 1.25.
215 =head2 Removed Modules and Pragmata
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>.
230 =head2 New Documentation
232 XXX Changes which create B<new> files in F<pod/> go here.
236 XXX Description of the purpose of the new file here
238 =head2 Changes to Existing Documentation
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>
250 L<perlfaq> has been synchronised with version 5.0150040 from C<CPAN>.
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>.
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.
263 [ Within each section, list entries as a =item entry that links to perldiag,
268 L<Invalid version object|perldiag/"Invalid version object">
271 =head2 New Diagnostics
273 XXX Newly added diagnostic messages go here
281 XXX L<message|perldiag/"message">
291 XXX L<message|perldiag/"message">
295 =head2 Changes to Existing Diagnostics
297 XXX Changes (i.e. rewording) of diagnostic messages go here
303 XXX Describe change here
307 =head2 Removals of Diagnostics
313 The "Runaway prototype" warning that occurs in bizarre cases has been
314 removed as being unhelpful and inconsistent.
318 The "Not a format reference" error has been removed, as the only case in
319 which it could be triggered was a bug.
323 =head1 Utility Changes
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>.
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. ]
342 =head1 Configuration and Compilation
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.
349 [ List changes as a =item entry ].
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.
367 [ List each test improvement as a =item entry ]
377 =head1 Platform Support
379 XXX Any changes to platform support should be listed in the sections below.
381 [ Within the sections, list each platform as a =item entry with specific
382 changes as paragraphs below it. ]
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
393 =item XXX-some-platform
399 =head2 Discontinued Platforms
401 XXX List any platforms that this version of perl no longer compiles on.
405 =item XXX-some-platform
411 =head2 Platform-Specific Notes
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.
422 C<link> on Win32 now attempts to set C<$!> to more appropriate values
423 based on the Win32 API error code. [perl #112272]
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>).
434 =head1 Internal Changes
436 XXX Changes which affect the interface available to C<XS> code go here.
437 Other significant internal changes for future core maintainers should
440 [ List each change as a =item entry ]
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.
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.
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.
465 A new function C<alloccoptash> has been added to the API, but is considered
466 experimental. See L<perlapi>.
470 =head1 Selected Bug Fixes
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>.
476 [ List each fix as a =item entry ]
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:
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:
496 This means that this error message is longer generated:
498 Sequence (?{...}) not terminated or not {}-balanced in regex
500 but a new error may be seen:
502 Sequence (?{...}) not terminated with ')'
504 In addition, literal code blocks within run-time patterns are only
505 compiled once, at perl compile-time:
508 # this 'FOO' block of code is compiled once,
509 # at the same time as the surrounding 'for' loop
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:
522 push @r, qr/^(??{$i})$/;
524 "1" =~ $r[1]; # matches
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:
534 my $r = qr/abc(?{....})def/;
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.
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:
550 my $code = '(??{$x})';
552 # recompile to see fresh value of $x each time
559 The C</msix> and C<(?msix)> etc. flags are now propagated into the return
560 value from C<(??{})>; this now works:
562 "AB" =~ /a(??{'b'})/i;
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>:
569 use re 'eval'; $c = '(?{ warn "foo" })'; /$c/;
574 foo at (re_eval 1) line 1.
575 foo at (re_eval 2) line 1.
579 foo at (eval 1) line 1.
580 foo at /some/prog line 2.
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
593 C<vec> no longer produces "uninitialized" warnings in lvalue context
598 An optimisation involving fixed strings in regular expressions could cause
599 a severe performance penalty in edge cases. This has been fixed
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].
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.
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].
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).
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].
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].
641 C<UNIVERSAL::can> no longer treats its first argument differently
642 depending on whether it is a string or number internally.
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.
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.
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
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].
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.
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].
685 Unary negation now treats strings consistently, regardless of the internal
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]
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.
705 C<__SUB__> now works in special blocks (BEGIN, END, etc.).
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].
715 =head1 Known Problems
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).
721 This is a list of some significant unfixed bugs, which are regressions
722 from either 5.XXX.XXX or 5.XXX.XXX.
724 [ List each fix as a =item entry ]
736 XXX If any significant core contributor has died, we've added a short obituary
739 =head1 Acknowledgements
741 XXX Generate this with:
743 perl Porting/acknowledgements.pl v5.17.0..HEAD
745 =head1 Reporting Bugs
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.
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.
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
771 The F<Changes> file for an explanation of how to view exhaustive details
774 The F<INSTALL> file for how to build Perl.
776 The F<README> file for general stuff.
778 The F<Artistic> and F<Copying> files for copyright information.