5 perl5260delta - what is new for perl v5.26.0
9 This document describes the differences between the 5.24.0 release and the
12 =head1 Core Enhancements
14 =head2 Perl can now do default collation in UTF-8 locales on platforms
17 Some platforms natively do a reasonable job of collating and sorting in
18 UTF-8 locales. Perl now works with those. For portability and full
19 control, L<Unicode::Collate> is still recommended, but now you may
20 not need to do anything special to get good-enough results, depending on
22 L<perllocale/Category C<LC_COLLATE>: Collation: Text Comparisons and Sorting>.
24 =head2 Better locale collation of strings containing embedded C<NUL>
27 In locales that have multi-level character weights, these are now
28 ignored at the higher priority ones. There are still some gotchas in
29 some strings, though. See
30 L<perllocale/Collation of strings containing embedded C<NUL> characters>.
32 =head2 Lexical subroutines are no longer experimental
34 Using the C<lexical_subs> feature no longer emits a warning. Existing
35 code that disables the C<experimental::lexical_subs> warning category
36 that the feature previously used will continue to work. The
37 C<lexical_subs> feature has no effect; all Perl code can use lexical
38 subroutines, regardless of what feature declarations are in scope.
40 =head2 C<CORE> subroutines for hash and array functions callable via
43 The hash and array functions in the C<CORE> namespace--C<keys>, C<each>,
44 C<values>, C<push>, C<pop>, C<shift>, C<unshift> and C<splice>--, can now
45 be called with ampersand syntax (C<&CORE::keys(\%hash>) and via reference
46 (C<< my $k = \&CORE::keys; $k->(\%hash) >>). Previously they could only be
49 =head2 POSIX::tmpnam() has been removed
51 The fundamentally unsafe C<tmpnam()> interface was deprecated in
52 Perl 5.22.0 and has now been removed. In its place you can use
53 for example the L<File::Temp> interfaces.
55 =head2 require ::Foo::Bar is now illegal.
57 Formerly, C<require ::Foo::Bar> would try to read F</Foo/Bar.pm>. Now any
58 bareword require which starts with a double colon dies instead.
60 =head2 Unescaped literal C<"{"> characters in regular expression
61 patterns are no longer permissible
63 You have to now say something like C<"\{"> or C<"[{]"> to specify to
64 match a LEFT CURLY BRACKET. This will allow future extensions to the
65 language. This restriction is not enforced, nor are there current plans
66 to enforce it, if the C<"{"> is the first character in the pattern.
68 These have been deprecated since v5.16, with a deprecation message
69 displayed starting in v5.22.
71 =head2 Literal control character variable names are no longer permissible
73 A variable name may no longer contain a literal control character under
74 any circumstances. These previously were allowed in single-character
75 names on ASCII platforms, but have been deprecated there since Perl
76 v5.20. This affects things like C<$I<\cT>>, where I<\cT> is a literal
77 control (such as a C<NAK> or C<NEGATIVE ACKNOWLEDGE> character) in the
80 =head2 C<qr//xx> is no longer permissible
82 Using more than one C</x> regular expression pattern modifier on a
83 single pattern is now forbidden. This is to allow a future enhancement
84 to the language. This usage has been deprecated since v5.22.
86 =head2 C<NBSP> is no longer permissible in C<\N{...}>
88 The name of a character may no longer contain non-breaking spaces. It
89 has been deprecated to do so since Perl v5.22.
93 =head2 C<-Di> switch is now required for PerlIO debugging output
95 Previously PerlIO debugging output would be sent to the file specified
96 by the C<PERLIO_DEBUG> environment variable if perl wasn't running
97 setuid and the C<-T> or C<-t> switches hadn't been parsed yet.
99 If perl performed output at a point where it hadn't yet parsed its
100 switches this could result in perl creating or overwriting the file
101 named by C<PERLIO_DEBUG> even when the C<-T> switch had been supplied.
103 Perl now requires the C<-Di> switch to produce PerlIO debugging
104 output. By default this is written to C<stderr>, but can optionally
105 be redirected to a file by setting the C<PERLIO_DEBUG> environment
108 If perl is running setuid or the C<-T> switch has supplied
109 C<PERLIO_DEBUG> is ignored and the debugging output is sent to
110 C<stderr> as for any other C<-D> switch.
112 =head1 Incompatible Changes
114 =head2 C<keys> returned from an lvalue subroutine
116 C<keys> returned from an lvalue subroutine can no longer be assigned
119 sub foo : lvalue { keys(%INC) }
121 sub bar : lvalue { keys(@_) }
122 (bar) = 3; # also an error
124 This makes the lvalue sub case consistent with C<(keys %hash) = ...> and
125 C<(keys @_) = ...>, which are also errors. [perl #128187]
127 =head1 Performance Enhancements
133 Bareword constant strings are now permitted to take part in constant
134 folding. They were originally exempted from constant folding in August 1999,
135 during the development of Perl 5.6, to ensure that C<use strict "subs">
136 would still apply to bareword constants. That has now been accomplished a
137 different way, so barewords, like other constants, now gain the performance
138 benefits of constant folding.
140 This also means that void-context warnings on constant expressions of
141 barewords now report the folded constant operand, rather than the operation;
142 this matches the behaviour for non-bareword constants.
146 =head1 Modules and Pragmata
148 =head2 Updated Modules and Pragmata
154 L<POSIX> has been upgraded from version 1.65 to 1.69. This remedies several
155 defects in making its symbols exportable. [perl #127821]
156 The C<POSIX::tmpnam()> interface has been removed,
157 see L</"POSIX::tmpnam() has been removed">.
158 Trying to import POSIX subs that have no real implementations
159 (like C<POSIX::atend()>) now fails at import time, instead of
160 waiting until runtime.
164 L<threads> has been upgraded from version 2.07 to 2.08. Compatibility
165 with 5.8 has been restored.
171 =head2 Changes to Existing Documentation
173 =head3 L<perlcommunity>
179 All references to Usenet have been removed.
189 All references to Usenet have been removed.
199 Document NUL collation handling.
203 =head3 L<perlmodinstall>
209 All references to Usenet have been removed.
219 Updated the mirror list.
223 All references to Usenet have been removed.
233 All references to Usenet have been removed.
243 Fixed link to Crosby paper on hash complexity attack.
249 =head2 New Diagnostics
257 L<Version control conflict marker|perldiag/"Version control conflict marker">
259 (F) The parser found a line starting with C<E<lt><<<<<<>,
260 C<E<gt>E<gt>E<gt>E<gt>E<gt>E<gt>E<gt>>, or C<=======>. These may be left by a
261 version control system to mark conflicts after a failed merge operation.
265 L<%s: command not found|perldiag/"%s: command not found">
267 (A) You've accidentally run your script through B<bash> or another shell
268 instead of Perl. Check the #! line, or manually feed your script into
269 Perl yourself. The #! line at the top of your file could look like:
275 L<%s: command not found: %s|perldiag/"%s: command not found: %s">
277 (A) You've accidentally run your script through B<zsh> or another shell
278 instead of Perl. Check the #! line, or manually feed your script into
279 Perl yourself. The #! line at the top of your file could look like:
285 L<Unescaped left brace in regex is deprecated here, passed through in regex; marked by S<<-- HERE> in mE<sol>%sE<sol>|perldiag/"Unescaped left brace in regex is deprecated here, passed through in regex; marked by S<<-- HERE> in m/%s/">
287 Unescaped left braces are already illegal in some contexts in regular
288 expression patterns, but, due to an oversight, no deprecation warning
289 was raised in other contexts where they are intended to become illegal.
290 This warning is now raised in these contexts.
294 L<Bareword in require contains "%s"|perldiag/"Bareword in require contains "%s"">
298 L<Bareword in require maps to empty filename|perldiag/"Bareword in require maps to empty filename">
302 L<Bareword in require maps to disallowed filename "%s"|perldiag/"Bareword in require maps to disallowed filename "%s"">
306 L<Bareword in require must not start with a double-colon: "%s"|perldiag/"Bareword in require must not start with a double-colon: "%s"">
310 =head2 Changes to Existing Diagnostics
316 L<Unescaped left brace in regex is illegal here in regex; marked by S<<-- HERE> in mE<sol>%sE<sol>|perldiag/"Unescaped left brace in regex is illegal here in regex; marked by S<<-- HERE> in m/%s/">
318 The word "here" has been added to the message that was raised in
319 v5.25.1. This is to indicate that there are contexts in which unescaped
320 left braces are not (yet) illegal.
324 Code like C<$x = $x . "a"> was incorrectly failing to yield a
325 L<use of uninitialized value|perldiag/"Use of uninitialized value%s">
326 warning when C<$x> was a lexical variable with an undefined value. That has
327 now been fixed. [perl #127877]
331 When the error "Experimental push on scalar is now forbidden" is raised for
332 the hash functions C<keys>, C<each>, and C<values>, it is now followed by
333 the more helpful message, "Type of arg 1 to whatever must be hash or
334 array". [perl #127976]
338 C<undef *_; shift> or C<undef *_; pop> inside a subroutine, with no
339 argument to C<shift> or C<pop>, began crashing in Perl 5.14.0, but has now
344 C<< "string$scalar-E<gt>$*" >> now correctly prefers concat overloading to
345 string overloading if C<< $scalar-E<gt>$* >> returns an overloaded object,
346 bringing it into consistency with C<$$scalar>.
350 C<< /@0{0*-E<gt>@*/*0 >> and similar contortions used to crash, but no longer
351 do, but merely produce a syntax error. [perl #128171]
355 C<do> or C<require> with a reference or typeglob which, when stringified,
356 contains a null character started crashing in Perl 5.20.0, but has now been
357 fixed. [perl #128182]
361 =head1 Utility Changes
369 Long lines in the message body are now wrapped at 900 characters, to stay
370 well within the 1000-character limit imposed by SMTP mail transfer agents.
371 This is particularly likely to be important for the list of arguments to
372 C<Configure>, which can readily exceed the limit if, for example, it names
373 several non-default installation paths. This change also adds the first unit
374 tests for perlbug. [perl #128020]
378 =head1 Configuration and Compilation
384 F<make_ext.pl> no longer updates a module's F<pm_to_blib> file when no
385 files require updates. This could cause dependencies, F<perlmain.c>
386 in particular, to be rebuilt unnecessarily. [perl #126710]
390 The output of C<perl -V> has been reformatted so that each configuration
391 and compile-time option is now listed one per line, to improve
396 C<Configure> now builds C<miniperl> and C<generate_uudmap> if you
397 invoke it with C<-Dusecrosscompiler> but not C<-Dtargethost=somehost>.
398 This means you can supply your target platform C<config.sh>, generate
399 the headers and proceed to build your cross-target perl. [perl #127234]
403 Builds with C<-Accflags=-DPERL_TRACE_OPS> now only dump the operator
404 counts when the environment variable C<PERL_TRACE_OPS> to be set to a
405 non-zero integer. This allows C<make test> to pass on such a build.
409 When building with GCC 6 and link-time optimization (the C<-flto> option to
410 C<gcc>), C<Configure> was treating all probed symbols as present on the
411 system, regardless of whether they actually exist. This has been fixed.
416 The F<t/test.pl> library is used for internal testing of Perl itself, and
417 also copied by several CPAN modules. Some of those modules must work on
418 older versions of Perl, so F<t/test.pl> must in turn avoid newer Perl
419 features. Compatibility with Perl 5.8 was inadvertently removed some time
420 ago; it has now been restored. [perl #128052]
424 The build process no longer emits an extra blank line before building each
425 "simple" extension (those with only F<*.pm> and F<*.pod> files).
435 F<t/harness> now tries really hard not to run tests outside of the Perl
436 source tree. [perl #124050]
440 =head1 Internal Changes
446 Perl no longer panics when switching into some locales on machines with
447 buggy C<strxfrm()> implementations in their libc. [perl #121734]
451 Perl is now built with the C<PERL_OP_PARENT> compiler define enabled by
452 default. To disable it, use the C<PERL_NO_OP_PARENT> compiler define.
453 This flag alters how the C<op_sibling> field is used in C<OP> structures,
454 and has been available optionally since perl 5.22.0.
456 See L<perl5220delta/"Internal Changes"> for more details of what this
461 =head1 Selected Bug Fixes
467 C< until ($x = 1) { ... } > and C< ... until $x = 1 > now properly
468 warn when syntax warnings are enabled. [perl #127333]
472 socket() now leaves the error code returned by the system in C<$!> on
473 failure. [perl #128316]
477 Assignment variants of any bitwise ops under the C<bitwise> feature would
478 crash if the left-hand side was an array or hash. [perl #128204]
482 C<require> followed by a single colon (as in C<foo() ? require : ...> is
483 now parsed correctly as C<require> with implicit $_, rather than
484 C<require "">. [perl #128307]
488 Scalar C<keys %hash> can now be assigned to consistently in all scalar
489 lvalue contexts. Previously it worked for some contexts but not others.
493 List assignment to C<vec> or C<substr> with an array or hash for its first
494 argument used to result in crashes or "Can't coerce" error messages at run
495 time, unlike scalar assignment, which would give an error at compile time.
496 List assignment now gives a compile-time error, too. [perl #128260]
500 Expressions containing an C<&&> or C<||> operator (or their synonyms C<and>
501 and C<or>) were being compiled incorrectly in some cases. If the left-hand
502 side consisted of either a negated bareword constant or a negated C<do {}>
503 block containing a constant expression, and the right-hand side consisted of
504 a negated non-foldable expression, one of the negations was effectively
505 ignored. The same was true of C<if> and C<unless> statement modifiers,
506 though with the left-hand and right-hand sides swapped. This long-standing
507 bug has now been fixed. [perl #127952]
511 C<reset> with an argument no longer crashes when encountering stash entries
512 other than globs. [perl #128106]
516 Assignment of hashes to, and deletion of, typeglobs named C<*::::::> no
517 longer causes crashes. [perl #128086]
521 =head1 Known Problems
527 Some modules have been broken by the L<context stack rework|/Internal Changes>.
528 These modules were relying on non-guaranteed implementation details in perl.
529 Their maintainers have been informed, and should contact perl5-porters for
530 advice if needed. Below is a subset of these modules:
534 =item * L<Algorithm::Permute>
538 L<Coro> and perl v5.22.0 were already incompatible due to a change in the perl,
539 and the reworking on the perl context stack creates a further incompatibility.
540 perl5-porters has L<discussed the issue on the mailing
541 list|http://www.nntp.perl.org/group/perl.perl5.porters/2016/05/msg236174.html>.
543 =item * L<Data::Alias>
547 =item * L<Scope::Upper>
555 The module L<lexical::underscore> no longer works on perl v5.24.0, because perl
556 no longer has a lexical C<$_>!
560 C<mod_perl> has been patched for compatibility for v5.22.0 and later but no
561 release has been made. The relevant patch (and other changes) can be found in
562 their source code repository, L<mirrored at
563 GitHub|https://github.com/apache/mod_perl/commit/82827132efd3c2e25cc413c85af61bb63375da6e>.
567 =head1 Acknowledgements
569 XXX Generate this with:
571 perl Porting/acknowledgements.pl v5.24.0..HEAD
573 =head1 Reporting Bugs
575 If you find what you think is a bug, you might check the articles recently
576 posted to the comp.lang.perl.misc newsgroup and the perl bug database at
577 L<https://rt.perl.org/> . There may also be information at
578 L<http://www.perl.org/> , the Perl Home Page.
580 If you believe you have an unreported bug, please run the L<perlbug> program
581 included with your release. Be sure to trim your bug down to a tiny but
582 sufficient test case. Your bug report, along with the output of C<perl -V>,
583 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
585 If the bug you are reporting has security implications which make it
586 inappropriate to send to a publicly archived mailing list, then see
587 L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION>
588 for details of how to report the issue.
592 The F<Changes> file for an explanation of how to view exhaustive details on
595 The F<INSTALL> file for how to build Perl.
597 The F<README> file for general stuff.
599 The F<Artistic> and F<Copying> files for copyright information.