This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
note that .. can also create string ranges
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
eabfc7bc 5perldelta - what is new for perl v5.22.0
c68523cb 6
238894db 7=head1 DESCRIPTION
c68523cb 8
f146a2b2 9This document describes differences between the 5.20.0 release and the 5.22.0
238894db 10release.
c68523cb 11
eabfc7bc
RS
12If you are upgrading from an earlier release such as 5.18.0, first read
13L<perl5200delta>, which describes differences between 5.18.0 and 5.20.0.
14
15=head1 Core Enhancements
2ec11c70 16
eabfc7bc 17=head2 New bitwise operators
b9c683b3 18
eabfc7bc
RS
19A new experimental facility has been added that makes the four standard
20bitwise operators (C<& | ^ ~>) treat their operands consistently as
21numbers, and introduces four new dotted operators (C<&. |. ^. ~.>) that
22treat their operands consistently as strings. The same applies to the
23assignment variants (C<&= |= ^= &.= |.= ^.=>).
2e4abf26 24
eabfc7bc
RS
25To use this, enable the "bitwise" feature and disable the
26"experimental::bitwise" warnings category. See L<perlop/Bitwise String
a75e6a3a
SH
27Operators> for details.
28L<[perl #123466]|https://rt.perl.org/Ticket/Display.html?id=123466>.
eabfc7bc
RS
29
30=head2 New double-diamond operator
31
32C<<< <<>> >>> is like C<< <> >> but uses three-argument C<open> to open
4ec8e6f0
KW
33each file in C<@ARGV>. This means that each element of C<@ARGV> will be treated
34as an actual file name, and C<"|foo"> won't be treated as a pipe open.
eabfc7bc
RS
35
36=head2 New \b boundaries in regular expressions
37
38=head3 qr/\b{gcb}/
39
40C<gcb> stands for Grapheme Cluster Boundary. It is a Unicode property
41that finds the boundary between sequences of characters that look like a
42single character to a native speaker of a language. Perl has long had
43the ability to deal with these through the C<\X> regular escape
44sequence. Now, there is an alternative way of handling these. See
45L<perlrebackslash/\b{}, \b, \B{}, \B> for details.
46
47=head3 qr/\b{wb}/
48
49C<wb> stands for Word Boundary. It is a Unicode property
50that finds the boundary between words. This is similar to the plain
51C<\b> (without braces) but is more suitable for natural language
01842271 52processing. It knows, for example, that apostrophes can occur in the
eabfc7bc
RS
53middle of words. See L<perlrebackslash/\b{}, \b, \B{}, \B> for details.
54
55=head3 qr/\b{sb}/
56
57C<sb> stands for Sentence Boundary. It is a Unicode property
58to aid in parsing natural language sentences.
59See L<perlrebackslash/\b{}, \b, \B{}, \B> for details.
60
61=head2 C<no re> covers more and is lexical
62
63Previously running C<no re> would only turn off a few things. Now it
64turns off all the enabled things. For example, previously, you
65couldn't turn off debugging, once enabled, inside the same block.
66
67=head2 Non-Capturing Regular Expression Flag
68
69Regular expressions now support a C</n> flag that disables capturing
70and filling in C<$1>, C<$2>, etc... inside of groups:
71
72 "hello" =~ /(hi|hello)/n; # $1 is not set
73
74This is equivalent to putting C<?:> at the beginning of every capturing group.
75
76See L<perlre/"n"> for more information.
77
78=head2 C<use re 'strict'>
79
80This applies stricter syntax rules to regular expression patterns
81compiled within its scope, which hopefully will alert you to typos and
82other unintentional behavior that backwards-compatibility issues prevent
83us from doing in normal regular expression compilations. Because the
84behavior of this is subject to change in future Perl releases as we gain
85experience, using this pragma will raise a category
86C<experimental::re_strict> warning.
87See L<'strict' in re|re/'strict' mode>.
88
ce93e38b 89=head2 Unicode 7.0 (with correction) is now supported
eabfc7bc
RS
90
91For details on what is in this release, see
92L<http://www.unicode.org/versions/Unicode7.0.0/>.
ce93e38b
KW
93The version of Unicode 7.0 that comes with Perl includes
94a correction dealing with glyph shaping in Arabic
95(see L<http://www.unicode.org/errata/#current_errata>).
96
eabfc7bc
RS
97
98=head2 S<C<use locale>> can restrict which locale categories are affected
99
100It is now possible to pass a parameter to S<C<use locale>> to specify
101a subset of locale categories to be locale-aware, with the remaining
102ones unaffected. See L<perllocale/The "use locale" pragma> for details.
103
01842271 104=head2 Perl now supports POSIX 2008 locale currency additions
eabfc7bc
RS
105
106On platforms that are able to handle POSIX.1-2008, the
107hash returned by
108L<C<POSIX::localeconv()>|perllocale/The localeconv function>
109includes the international currency fields added by that version of the
110POSIX standard. These are
111C<int_n_cs_precedes>,
112C<int_n_sep_by_space>,
113C<int_n_sign_posn>,
114C<int_p_cs_precedes>,
115C<int_p_sep_by_space>,
116and
117C<int_p_sign_posn>.
118
119=head2 Better heuristics on older platforms for determining locale UTF8ness
120
121On platforms that implement neither the C99 standard nor the POSIX 2001
122standard, determining if the current locale is UTF8 or not depends on
123heuristics. These are improved in this release.
124
125=head2 Aliasing via reference
126
127Variables and subroutines can now be aliased by assigning to a reference:
128
129 \$c = \$d;
130 \&x = \&y;
131
132Or by using a backslash before a C<foreach> iterator variable, which is
133perhaps the most useful idiom this feature provides:
134
135 foreach \%hash (@array_of_hash_refs) { ... }
136
137This feature is experimental and must be enabled via C<use feature
138'refaliasing'>. It will warn unless the C<experimental::refaliasing>
139warnings category is disabled.
140
141See L<perlref/Assigning to References>
142
143=head2 C<prototype> with no arguments
144
a75e6a3a
SH
145C<prototype()> with no arguments now infers C<$_>.
146L<[perl #123514]|https://rt.perl.org/Ticket/Display.html?id=123514>.
eabfc7bc
RS
147
148=head2 New "const" subroutine attribute
149
f1c9eac6
DM
150The "const" attribute can be applied to an anonymous subroutine. It
151causes the new sub to be executed immediately whenever one is created
152(i.e. when the C<sub> expression is evaluated). Its value is captured
153and used to create a new constant subroutine that is returned. This
154feature is experimental. See L<perlsub/Constant Functions>.
eabfc7bc
RS
155
156=head2 C<fileno> now works on directory handles
157
158When the relevant support is available in the operating system, the
159C<fileno> builtin now works on directory handles, yielding the
160underlying file descriptor in the same way as for filehandles. On
161operating systems without such support, C<fileno> on a directory handle
162continues to return the undefined value, as before, but also sets C<$!> to
163indicate that the operation is not supported.
164
165Currently, this uses either a C<dd_fd> member in the OS C<DIR>
4ec8e6f0 166structure, or a C<dirfd(3)> function as specified by POSIX.1-2008.
eabfc7bc
RS
167
168=head2 List form of pipe open implemented for Win32
169
170The list form of pipe:
171
172 open my $fh, "-|", "program", @arguments;
173
174is now implemented on Win32. It has the same limitations as C<system
175LIST> on Win32, since the Win32 API doesn't accept program arguments
176as a list.
177
178=head2 C<close> now sets C<$!>
179
180When an I/O error occurs, the fact that there has been an error is recorded
181in the handle. C<close> returns false for such a handle. Previously, the
182value of C<$!> would be untouched by C<close>, so the common convention of
4ec8e6f0 183writing S<C<close $fh or die $!>> did not work reliably. Now the handle
eabfc7bc
RS
184records the value of C<$!>, too, and C<close> restores it.
185
186=head2 Assignment to list repetition
187
188C<(...) x ...> can now be used within a list that is assigned to, as long
4ec8e6f0
KW
189as the left-hand side is a valid lvalue. This allows S<C<(undef,undef,$foo)
190= that_function()>> to be written as S<C<((undef)x2, $foo) = that_function()>>.
eabfc7bc
RS
191
192=head2 Infinity and NaN (not-a-number) handling improved
193
194Floating point values are able to hold the special values infinity (also
195-infinity), and NaN (not-a-number). Now we more robustly recognize and
196propagate the value in computations, and on output normalize them to C<Inf> and
197C<NaN>.
198
199See also the L<POSIX> enhancements.
200
201=head2 Floating point parsing has been improved
202
203Parsing and printing of floating point values has been improved.
204
205As a completely new feature, hexadecimal floating point literals
4ec8e6f0 206(like C<0x1.23p-4>) are now supported, and they can be output with
eabfc7bc
RS
207C<printf %a>.
208
209=head2 Packing infinity or not-a-number into a character is now fatal
210
211Before, when trying to pack infinity or not-a-number into a
212(signed) character, Perl would warn, and assumed you tried to
213pack C<< 0xFF >>; if you gave it as an argument to C<< chr >>,
214C<< U+FFFD >> was returned.
215
216But now, all such actions (C<< pack >>, C<< chr >>, and C<< print '%c' >>)
217result in a fatal error.
218
219=head2 Experimental C Backtrace API
2e4abf26 220
43831b1f 221Perl now supports (via a C level API) retrieving
eabfc7bc 222the C level backtrace (similar to what symbolic debuggers like gdb do).
fea59588 223
eabfc7bc
RS
224The backtrace returns the stack trace of the C call frames,
225with the symbol names (function names), the object names (like "perl"),
226and if it can, also the source code locations (file:line).
227
228The supported platforms are Linux and OS X (some *BSD might work at
229least partly, but they have not yet been tested).
230
231The feature needs to be enabled with C<Configure -Dusecbacktrace>.
232
eabfc7bc 233See L<perlhacktips/"C backtrace"> for more information.
83a5d6b6 234
7f9fef93 235=head1 Security
e455391f 236
eabfc7bc
RS
237=head2 Perl is now compiled with -fstack-protector-strong if available
238
239Perl has been compiled with the anti-stack-smashing option
240C<-fstack-protector> since 5.10.1. Now Perl uses the newer variant
241called C<-fstack-protector-strong>, if available.
242
243=head2 The L<Safe> module could allow outside packages to be replaced
244
245Critical bugfix: outside packages could be replaced. L<Safe> has
246been patched to 2.38 to address this.
247
248=head2 Perl is now always compiled with -D_FORTIFY_SOURCE=2 if available
e455391f 249
eabfc7bc
RS
250The 'code hardening' option called C<_FORTIFY_SOURCE>, available in
251gcc 4.*, is now always used for compiling Perl, if available.
252
253Note that this isn't necessarily a huge step since in many platforms
254the step had already been taken several years ago: many Linux
255distributions (like Fedora) have been using this option for Perl,
256and OS X has enforced the same for many years.
53902397 257
7f9fef93 258=head1 Incompatible Changes
79a77127 259
eabfc7bc
RS
260=head2 Subroutine signatures moved before attributes
261
262The experimental sub signatures feature, as introduced in 5.20, parsed
263signatures after attributes. In this release, the positioning has been
264moved such that signatures occur after the subroutine name (if any) and
265before the attribute list (if any).
266
267=head2 C<&> and C<\&> prototypes accepts only subs
268
43831b1f
DM
269The C<&> prototype character now accepts only anonymous subs (C<sub
270{...}>), things beginning with C<\&>, or an explicit C<undef>. Formerly
271it erroneously also allowed references to arrays, hashes, and lists.
a75e6a3a
SH
272L<[perl #4539]|https://rt.perl.org/Ticket/Display.html?id=4539>.
273L<[perl #123062]|https://rt.perl.org/Ticket/Display.html?id=123062>.
43831b1f 274L<[perl #123062]|https://rt.perl.org/Ticket/Display.html?id=123475>.
eabfc7bc 275
43831b1f
DM
276In addition, the C<\&> prototype was allowing subroutine calls, whereas
277now it only allows subroutines: C<&foo> is still permitted as an argument,
278while C<&foo()> and C<foo()> no longer are.
a75e6a3a 279L<[perl #77860]|https://rt.perl.org/Ticket/Display.html?id=77860>.
eabfc7bc
RS
280
281=head2 C<use encoding> is now lexical
282
283The L<encoding> pragma's effect is now limited to lexical scope. This
284pragma is deprecated, but in the meantime, it could adversely affect
285unrelated modules that are included in the same program.
286
287=head2 List slices returning empty lists
288
289List slices return an empty list now only if the original list was empty
290(or if there are no indices). Formerly, a list slice would return an empty
43831b1f
DM
291list if all indices fell outside the original list; now it returns a list
292of undef values.
a75e6a3a 293L<[perl #114498]|https://rt.perl.org/Ticket/Display.html?id=114498>.
eabfc7bc 294
01842271 295=head2 C<\N{}> with a sequence of multiple spaces is now a fatal error
eabfc7bc 296
43831b1f 297E.g. C<\N{TOO MANY SPACES}> or C<\N{TRAILING SPACE }>.
eabfc7bc
RS
298This has been deprecated since v5.18.
299
300=head2 S<C<use UNIVERSAL '...'>> is now a fatal error
301
302Importing functions from C<UNIVERSAL> has been deprecated since v5.12, and
303is now a fatal error. S<C<"use UNIVERSAL">> without any arguments is still
304allowed.
305
306=head2 In double-quotish C<\cI<X>>, I<X> must now be a printable ASCII character
307
308In prior releases, failure to do this raised a deprecation warning.
309
310=head2 Splitting the tokens C<(?> and C<(*> in regular expressions is
311now a fatal compilation error.
312
313These had been deprecated since v5.18.
314
43831b1f
DM
315=head2 C<qr/foo/x> now ignores all Unicode pattern white space
316
317The C</x> regular expression modifier allows the pattern to contain
318white space and comments (both of which are ignored) for improved
319readability. Until now, not all the white space characters that Unicode
320designates for this purpose were handled. The additional ones now
321recognized are
322
323 U+0085 NEXT LINE
324 U+200E LEFT-TO-RIGHT MARK
325 U+200F RIGHT-TO-LEFT MARK
326 U+2028 LINE SEPARATOR
327 U+2029 PARAGRAPH SEPARATOR
eabfc7bc
RS
328
329The use of these characters with C</x> outside bracketed character
330classes and when not preceded by a backslash has raised a deprecation
43831b1f 331warning since v5.18. Now they will be ignored.
eabfc7bc 332
43831b1f 333=head2 Comment lines within S<C<(?[ ])>> are now ended only by a C<\n>
eabfc7bc
RS
334
335S<C<(?[ ])>> is an experimental feature, introduced in v5.18. It operates
43831b1f 336as if C</x> is always enabled. But there was a difference: comment
eabfc7bc
RS
337lines (following a C<#> character) were terminated by anything matching
338C<\R> which includes all vertical whitespace, such as form feeds. For
339consistency, this is now changed to match what terminates comment lines
340outside S<C<(?[ ])>>, namely a C<\n> (even if escaped), which is the
341same as what terminates a heredoc string and formats.
342
343=head2 C<(?[...])> operators now follow standard Perl precedence
344
345This experimental feature allows set operations in regular expression patterns.
346Prior to this, the intersection operator had the same precedence as the other
347binary operators. Now it has higher precedence. This could lead to different
348outcomes than existing code expects (though the documentation has always noted
349that this change might happen, recommending fully parenthesizing the
350expressions). See L<perlrecharclass/Extended Bracketed Character Classes>.
351
4ec8e6f0 352=head2 Omitting C<%> and C<@> on hash and array names is no longer permitted
c14a43b7 353
4ec8e6f0 354Really old Perl let you omit the C<@> on array names and the C<%> on hash
eabfc7bc 355names in some spots. This has issued a deprecation warning since Perl
93780ae6 3565.000, and is no longer permitted.
c14a43b7 357
eabfc7bc
RS
358=head2 C<"$!"> text is now in English outside C<"use locale"> scope
359
360Previously, the text, unlike almost everything else, always came out
361based on the current underlying locale of the program. (Also affected
362on some systems is C<"$^E>".) For programs that are unprepared to
363handle locale, this can cause garbage text to be displayed. It's better
364to display text that is translatable via some tool than garbage text
365which is much harder to figure out.
366
367=head2 C<"$!"> text will be returned in UTF-8 when appropriate
368
369The stringification of C<$!> and C<$^E> will have the UTF-8 flag set
370when the text is actually non-ASCII UTF-8. This will enable programs
371that are set up to be locale-aware to properly output messages in the
372user's native language. Code that needs to continue the 5.20 and
373earlier behavior can do the stringification within the scopes of both
4ec8e6f0
KW
374S<C<'use bytes'>> and S<C<'use locale ":messages">>. No other Perl
375operations will
eabfc7bc
RS
376be affected by locale; only C<$!> and C<$^E> stringification. The
377'bytes' pragma causes the UTF-8 flag to not be set, just as in previous
a75e6a3a
SH
378Perl releases. This resolves
379L<[perl #112208]|https://rt.perl.org/Ticket/Display.html?id=112208>.
eabfc7bc
RS
380
381=head2 Support for C<?PATTERN?> without explicit operator has been removed
382
383Starting regular expressions matching only once directly with the
384question mark delimiter is now a syntax error, so that the question mark
385can be available for use in new operators. Write C<m?PATTERN?> instead,
386explicitly using the C<m> operator: the question mark delimiter still
387invokes match-once behaviour.
388
389=head2 C<defined(@array)> and C<defined(%hash)> are now fatal errors
390
391These have been deprecated since v5.6.1 and have raised deprecation
392warnings since v5.16.
393
01842271 394=head2 Using a hash or an array as a reference are now fatal errors
eabfc7bc 395
43831b1f 396For example, C<< %foo->{"bar"} >> now causes a fatal compilation
eabfc7bc
RS
397error. These have been deprecated since before v5.8, and have raised
398deprecation warnings since then.
399
400=head2 Changes to the C<*> prototype
401
402The C<*> character in a subroutine's prototype used to allow barewords to take
43831b1f
DM
403precedence over most, but not all, subroutine names. It was never
404consistent and exhibited buggy behaviour.
eabfc7bc
RS
405
406Now it has been changed, so subroutines always take precedence over barewords,
407which brings it into conformity with similarly prototyped built-in functions:
408
409 sub splat(*) { ... }
410 sub foo { ... }
411 splat(foo); # now always splat(foo())
412 splat(bar); # still splat('bar') as before
413 close(foo); # close(foo())
414 close(bar); # close('bar')
c14a43b7 415
7f9fef93 416=head1 Deprecations
47cb8ddb 417
eabfc7bc 418=head2 Setting C<${^ENCODING}> to anything but C<undef>
c14a43b7 419
eabfc7bc
RS
420This variable allows Perl scripts to be written in a non-ASCII,
421non-UTF-8 encoding. However, it affects all modules globally, leading
422to wrong answers and segmentation faults. New scripts should be written
423in UTF-8; old scripts should be converted to UTF-8, which is easily done
424with the L<encoding> pragma.
c14a43b7 425
eabfc7bc 426=head2 Use of non-graphic characters in single-character variable names
51c2f40f 427
eabfc7bc
RS
428The syntax for single-character variable names is more lenient than
429for longer variable names, allowing the one-character name to be a
430punctuation character or even invisible (a non-graphic). Perl v5.20
431deprecated the ASCII-range controls as such a name. Now, all
432non-graphic characters that formerly were allowed are deprecated.
433The practical effect of this occurs only when not under C<S<"use
434utf8">>, and affects just the C1 controls (code points 0x80 through
4350xFF), NO-BREAK SPACE, and SOFT HYPHEN.
83a5d6b6 436
eabfc7bc 437=head2 Inlining of C<sub () { $var }> with observable side-effects
abec5bed 438
4ec8e6f0
KW
439In many cases Perl makes S<C<sub () { $var }>> into an inlinable constant
440subroutine, capturing the value of C<$var> at the time the C<sub> expression
eabfc7bc 441is evaluated. This can break the closure behaviour in those cases where
43831b1f
DM
442C<$var> is subsequently modified, since the subroutine won't return the
443changed value. (Note that this all only applies to anonymous subroutines
444with an empty prototype (C<sub ()>).)
abec5bed 445
eabfc7bc
RS
446This usage is now deprecated in those cases where the variable could be
447modified elsewhere. Perl detects those cases and emits a deprecation
448warning. Such code will likely change in the future and stop producing a
449constant.
abec5bed 450
eabfc7bc
RS
451If your variable is only modified in the place where it is declared, then
452Perl will continue to make the sub inlinable with no warnings.
c14a43b7 453
eabfc7bc
RS
454 sub make_constant {
455 my $var = shift;
456 return sub () { $var }; # fine
457 }
c14a43b7 458
eabfc7bc
RS
459 sub make_constant_deprecated {
460 my $var;
461 $var = shift;
462 return sub () { $var }; # deprecated
463 }
c14a43b7 464
eabfc7bc
RS
465 sub make_constant_deprecated2 {
466 my $var = shift;
467 log_that_value($var); # could modify $var
468 return sub () { $var }; # deprecated
469 }
c14a43b7 470
4ec8e6f0 471In the second example above, detecting that C<$var> is assigned to only once
eabfc7bc
RS
472is too hard to detect. That it happens in a spot other than the C<my>
473declaration is enough for Perl to find it suspicious.
7f9fef93 474
eabfc7bc
RS
475This deprecation warning happens only for a simple variable for the body of
476the sub. (A C<BEGIN> block or C<use> statement inside the sub is ignored,
477because it does not become part of the sub's body.) For more complex
4ec8e6f0 478cases, such as S<C<sub () { do_something() if 0; $var }>> the behaviour has
eabfc7bc
RS
479changed such that inlining does not happen if the variable is modifiable
480elsewhere. Such cases should be rare.
c14a43b7 481
eabfc7bc 482=head2 Use of multiple /x regexp modifiers
c14a43b7 483
eabfc7bc 484It is now deprecated to say something like any of the following:
c14a43b7 485
eabfc7bc
RS
486 qr/foo/xx;
487 /(?xax:foo)/;
488 use re qw(/amxx);
be39acb2 489
eabfc7bc
RS
490That is, now C<x> should only occur once in any string of contiguous
491regular expression pattern modifiers. We do not believe there are any
492occurrences of this in all of CPAN. This is in preparation for a future
493Perl release having C</xx> mean to allow white-space for readability in
494bracketed character classes (those enclosed in square brackets:
495C<[...]>).
c14a43b7 496
eabfc7bc
RS
497=head2 Using a NO-BREAK space in a character alias for C<\N{...}> is now
498deprecated
60dcce55 499
eabfc7bc
RS
500This non-graphic character is essentially indistinguishable from a
501regular space, and so should not be allowed. See
502L<charnames/CUSTOM ALIASES>.
60dcce55 503
eabfc7bc
RS
504=head2 A literal C<"{"> should now be escaped in a pattern
505
506If you want a literal left curly bracket (also called a left brace) in a
507regular expression pattern, you should now escape it by either
508preceding it with a backslash (C<"\{">) or enclosing it within square
509brackets C<"[{]">, or by using C<\Q>; otherwise a deprecation warning
510will be raised. This was first announced as forthcoming in the v5.16
511release; it will allow future extensions to the language to happen.
512
513=head2 Making all warnings fatal is discouraged
514
515The documentation for L<fatal warnings|warnings/Fatal Warnings> notes that
516C<< use warnings FATAL => 'all' >> is discouraged and provides stronger
517language about the risks of fatal warnings in general.
518
519=head1 Performance Enhancements
79a77127 520
7f9fef93 521=over 4
abec5bed
DIM
522
523=item *
524
43831b1f 525If a method or class name is known at compile time, a hash is precomputed
eabfc7bc
RS
526to speed up run-time method lookup. Also, compound method names like
527C<SUPER::new> are parsed at compile time, to save having to parse them at
528run time.
9749148e 529
eabfc7bc 530=item *
9749148e 531
eabfc7bc
RS
532Array and hash lookups (especially nested ones) that use only constants
533or simple variables as keys, are now considerably faster. See
534L</Internal Changes> for more details.
abec5bed
DIM
535
536=item *
537
eabfc7bc
RS
538C<(...)x1>, C<("constant")x0> and C<($scalar)x0> are now optimised in list
539context. If the right-hand argument is a constant 1, the repetition
540operator disappears. If the right-hand argument is a constant 0, the whole
6a3ea89b 541expression is optimised to the empty list, so long as the left-hand
eabfc7bc 542argument is a simple scalar or constant. C<(foo())x0> is not optimised.
6bb5549b 543
eabfc7bc 544=item *
7f9fef93 545
eabfc7bc
RS
546C<substr> assignment is now optimised into 4-argument C<substr> at the end
547of a subroutine (or as the argument to C<return>). Previously, this
548optimisation only happened in void context.
abec5bed 549
eabfc7bc 550=item *
7f9fef93 551
43831b1f
DM
552Assignment to lexical variables is now more often optimised away. For
553instance, in
eabfc7bc
RS
554C<$lexical = chr $foo>, the C<chr> operator writes directly to the lexical
555variable instead of returning a value that gets copied. This optimisation
556has been extended to C<split>, C<x> and C<vec> on the right-hand side. It
557has also been made to work with state variable initialization.
be39acb2 558
2e4abf26
DG
559=item *
560
43831b1f
DM
561In C<"\L...">, C<"\Q...">, etc., the extra "stringify" op is now optimised
562away, making these just as fast as C<lcfirst>, C<quotemeta>, etc.
2e4abf26 563
eabfc7bc 564=item *
83a5d6b6 565
eabfc7bc
RS
566Assignment to an empty list is now sometimes faster. In particular, it
567never calls C<FETCH> on tied arguments on the right-hand side, whereas it
568used to sometimes.
569
570=item *
83a5d6b6 571
eabfc7bc 572C<length> is up to 20% faster for non-magical/non-tied scalars containing a
4ec8e6f0 573string if it is a non-utf8 string or if is in scope of C<use bytes>.
338906ce 574
eabfc7bc 575=item *
5de148ee 576
43831b1f
DM
577On most perl builds with 64 bit integers, non-magical/non-tied scalars
578that contain only a floating point value now use between 8 and 32 less bytes
579of memory, depending on OS.
5de148ee 580
eabfc7bc 581=item *
5de148ee 582
eabfc7bc
RS
583In C<@array = split>, the assignment can be optimized away with C<split>
584writing directly to the array. This optimisation was happening only for
43831b1f
DM
585package arrays other than C<@_>, and only sometimes. Now this
586optimisation happens almost all the time.
5de148ee 587
eabfc7bc 588=item *
7f9fef93 589
43831b1f
DM
590C<join> is now subject to constant folding. So for example
591C<join "-", "a", "b"> is converted at compile-time to C<"a-b">.
592Moreover, C<join> with a scalar or constant for the separator and a
593single-item list to join is simplified to a stringification. The
594separator doesn't even get evaluated.
5de148ee 595
eabfc7bc 596=item *
47cb8ddb 597
eabfc7bc 598C<qq(@array)> is implemented using two ops: a stringify op and a join op.
4ec8e6f0 599If the C<qq> contains nothing but a single array, the stringification is
eabfc7bc 600optimized away.
47cb8ddb
SH
601
602=item *
603
4ec8e6f0
KW
604S<C<our $var>> and S<C<our($s,@a,%h)>> in void context are no longer evaluated at
605run time. Even a whole sequence of S<C<our $foo;>> statements will simply be
eabfc7bc 606skipped over. The same applies to C<state> variables.
47cb8ddb 607
eabfc7bc 608=item *
47cb8ddb 609
eabfc7bc
RS
610Many internal functions have been refactored to improve performance and reduce
611their memory footprints.
eabfc7bc
RS
612L<[perl #121436]|https://rt.perl.org/Ticket/Display.html?id=121436>
613L<[perl #121906]|https://rt.perl.org/Ticket/Display.html?id=121906>
614L<[perl #121969]|https://rt.perl.org/Ticket/Display.html?id=121969>
47cb8ddb 615
eabfc7bc 616=item *
47cb8ddb 617
eabfc7bc 618C<-T> and C<-B> filetests will return sooner when an empty file is detected.
a75e6a3a 619L<[perl #121489]|https://rt.perl.org/Ticket/Display.html?id=121489>
47cb8ddb 620
eabfc7bc 621=item *
5de148ee 622
01842271 623Hash lookups where the key is a constant are faster.
be39acb2
SH
624
625=item *
626
eabfc7bc
RS
627Subroutines with an empty prototype and bodies containing just C<undef> are now
628eligible for inlining.
629L<[perl #122728]|https://rt.perl.org/Ticket/Display.html?id=122728>
be39acb2 630
eabfc7bc 631=item *
be39acb2 632
43831b1f
DM
633Subroutines in packages no longer need to be stored in typeglobs:
634declaring a subroutine will now put a simple sub reference directly in the
635stash if possible, saving memory. The typeglob still notionally exists,
636so accessing it will cause the stash entry to be upgraded to a typeglob
637(i.e. this is just an internal implementation detail).
638This optimization does not currently apply to XSUBs or exported
639subroutines, and method calls will undo it, since they cache things in
640typeglobs.
eabfc7bc 641L<[perl #120441]|https://rt.perl.org/Ticket/Display.html?id=120441>
7f9fef93 642
eabfc7bc 643=item *
be39acb2 644
eabfc7bc
RS
645The functions C<utf8::native_to_unicode()> and C<utf8::unicode_to_native()>
646(see L<utf8>) are now optimized out on ASCII platforms. There is now not even
647a minimal performance hit in writing code portable between ASCII and EBCDIC
648platforms.
be39acb2
SH
649
650=item *
651
eabfc7bc 652Win32 Perl uses 8 KB less of per-process memory than before for every perl
43831b1f 653process, because some data is now memory mapped from disk and shared
eabfc7bc 654between perl processes from the same perl binary.
be39acb2
SH
655
656=back
657
eabfc7bc 658=head1 Modules and Pragmata
83a5d6b6 659
eabfc7bc
RS
660XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
661go here. If Module::CoreList is updated, generate an initial draft of the
662following sections using F<Porting/corelist-perldelta.pl>. A paragraph summary
663for important changes should then be added by hand. In an ideal world,
664dual-life modules would have a F<Changes> file that could be cribbed.
83a5d6b6 665
eabfc7bc 666[ Within each section, list entries as a =item entry ]
338906ce 667
eabfc7bc 668=head2 New Modules and Pragmata
cd7bac54 669
b5d4d3b9 670=over 4
83b69bfd
DD
671
672=item *
673
7f9fef93 674XXX
13adb056 675
b5d4d3b9 676=back
391823f2 677
eabfc7bc
RS
678=head2 Updated Modules and Pragmata
679
680=over 4
681
682=item *
683
6af93725
TC
684L<ExtUtils::MakeMaker> has been upgraded from version 6.98 to 7.04_01.
685
686Some changes from github have been backported to prevent failures and
687noise on Win32 when C<chcp> is missing or unavailable.
688L<[perl #123998]|https://rt.perl.org/Ticket/Display.html?id=123998>
6c8457e9 689
eabfc7bc 690=back
2bf83140 691
eabfc7bc 692=head2 Removed Modules and Pragmata
041a5927 693
7f9fef93 694=over 4
69e954a5 695
7f9fef93 696=item *
86e0176a 697
7f9fef93 698XXX
69e954a5 699
e5998677 700=back
20b5e916 701
eabfc7bc
RS
702=head1 Documentation
703
704=head2 New Documentation
532ecd00 705
eabfc7bc 706=head3 L<perlunicook>
d76c14eb 707
eabfc7bc
RS
708This document, by Tom Christiansen, provides examples of handling Unicode in
709Perl.
710
711=head2 Changes to Existing Documentation
712
713=head3 L<perlapi>
d547bad0 714
e5998677 715=over 4
d547bad0 716
8a95d307
FC
717=item *
718
eabfc7bc 719Note that C<SvSetSV> doesn't do set magic.
532ecd00 720
eabfc7bc 721=item *
532ecd00 722
eabfc7bc
RS
723C<sv_usepvn_flags> - Fix documentation to mention the use of C<NewX> instead of
724C<malloc>.
532ecd00 725
eabfc7bc 726L<[perl #121869]|https://rt.perl.org/Ticket/Display.html?id=121869>
532ecd00 727
eabfc7bc 728=item *
532ecd00 729
eabfc7bc 730Clarify where C<NUL> may be embedded or is required to terminate a string.
532ecd00 731
eabfc7bc 732=item *
532ecd00 733
eabfc7bc 734Previously missing documentation due to formatting errors are now included.
532ecd00 735
eabfc7bc 736=item *
532ecd00 737
eabfc7bc 738Entries are now organized into groups rather than by file where they are found.
532ecd00 739
eabfc7bc 740=item *
532ecd00 741
eabfc7bc
RS
742Alphabetical sorting of entries is now handled by the POD generator to make
743entries easier to find when scanning.
744
745=back
338906ce 746
eabfc7bc 747=head3 L<perldata>
338906ce 748
e5998677 749=over 4
338906ce 750
eabfc7bc 751=item *
2f304be9 752
eabfc7bc
RS
753The syntax of single-character variable names has been brought
754up-to-date and more fully explained.
9749148e 755
7f9fef93 756=back
9749148e 757
eabfc7bc 758=head3 L<perlebcdic>
47cb8ddb 759
7f9fef93 760=over 4
47cb8ddb 761
eabfc7bc 762=item *
47cb8ddb 763
eabfc7bc
RS
764This document has been significantly updated in the light of recent
765improvements to EBCDIC support.
47cb8ddb 766
7f9fef93 767=back
47cb8ddb 768
eabfc7bc 769=head3 L<perlfunc>
be39acb2 770
eabfc7bc 771=over 4
be39acb2 772
eabfc7bc 773=item *
be39acb2 774
eabfc7bc 775Mention that C<study()> is currently a no-op.
be39acb2
SH
776
777=item *
778
eabfc7bc
RS
779Calling C<delete> or C<exists> on array values is now described as "strongly
780discouraged" rather than "deprecated".
be39acb2 781
eabfc7bc 782=item *
7f9fef93 783
eabfc7bc 784Improve documentation of C<< our >>.
be39acb2 785
eabfc7bc 786=item *
be39acb2 787
eabfc7bc
RS
788C<-l> now notes that it will return false if symlinks aren't supported by the
789file system.
be39acb2 790
eabfc7bc 791L<[perl #121523]|https://rt.perl.org/Ticket/Display.html?id=121523>
be39acb2
SH
792
793=item *
794
eabfc7bc
RS
795Note that C<exec LIST> and C<system LIST> may fall back to the shell on
796Win32. Only C<exec PROGRAM LIST> and C<system PROGRAM LIST> indirect object
797syntax will reliably avoid using the shell.
798
799This has also been noted in L<perlport>.
800
801L<[perl #122046]|https://rt.perl.org/Ticket/Display.html?id=122046>
be39acb2 802
7f9fef93 803=back
be39acb2 804
eabfc7bc
RS
805=head3 L<perlguts>
806
807=over 4
808
809=item *
810
811The OOK example has been updated to account for COW changes and a change in the
812storage of the offset.
813
814=item *
be39acb2 815
eabfc7bc 816Details on C level symbols and libperl.t added.
be39acb2 817
ce93e38b
KW
818=item *
819
820Information on Unicode handling has been added
821
822=item *
823
824Information on EBCDIC handling has been added
825
eabfc7bc
RS
826=back
827
828=head3 L<perlhacktips>
7f9fef93
SH
829
830=over 4
be39acb2
SH
831
832=item *
833
eabfc7bc
RS
834Documentation has been added illustrating the perils of assuming the contents
835of static memory pointed to by the return values of Perl wrappers for C library
836functions doesn't change.
837
838=item *
839
840Recommended replacements for tmpfile, atoi, strtol, and strtoul added.
841
842=item *
843
844Updated documentation for the C<test.valgrind> C<make> target.
845
846L<[perl #121431]|https://rt.perl.org/Ticket/Display.html?id=121431>
be39acb2 847
a9c3e753 848=back
ea13b07e 849
eabfc7bc 850=head3 L<perlmodstyle>
0d42058e 851
7f9fef93
SH
852=over 4
853
854=item *
2a7a05b4 855
eabfc7bc
RS
856Instead of pointing to the module list, we are now pointing to
857L<PrePAN|http://prepan.org/>.
2a7a05b4 858
7f9fef93
SH
859=back
860
eabfc7bc
RS
861=head3 L<perlpolicy>
862
863=over 4
864
865=item *
866
867We now have a code of conduct for the I<< p5p >> mailing list, as documented
868in L<< perlpolicy/STANDARDS OF CONDUCT >>.
2a7a05b4 869
eabfc7bc
RS
870=item *
871
872The conditions for marking an experimental feature as non-experimental are now
873set out.
874
875=back
876
877=head3 L<perlport>
878
879=over 4
880
881=item *
882
883Out-of-date VMS-specific information has been fixed/simplified.
884
ce93e38b
KW
885=item *
886
887Notes about EBCDIC have been added.
888
eabfc7bc
RS
889=back
890
891=head3 L<perlre>
892
893=over 4
894
895=item *
896
897The C</x> modifier has been clarified to note that comments cannot be continued
898onto the next line by escaping them.
899
900=back
901
902=head3 L<perlrebackslash>
903
904=over 4
905
906=item *
907
908Added documentation of C<\b{sb}>, C<\b{wb}>, C<\b{gcb}>, and C<\b{g}>.
909
910=back
911
912=head3 L<perlrecharclass>
913
914=over 4
915
916=item *
917
918Clarifications have been added to L<perlrecharclass/Character Ranges>
919to the effect that Perl guarantees that C<[A-Z]>, C<[a-z]>, C<[0-9]> and
920any subranges thereof in regular expression bracketed character classes
921are guaranteed to match exactly what a naive English speaker would
922expect them to match, even on platforms (such as EBCDIC) where special
923handling is required to accomplish this.
924
925=item *
926
927The documentation of Bracketed Character Classes has been expanded to cover the
928improvements in C<qr/[\N{named sequence}]/> (see under L</Selected Bug Fixes>).
929
930=back
931
932=head3 L<perlsec>
933
934=over 4
935
936=item *
937
938Comments added on algorithmic complexity and tied hashes.
939
940=back
941
942=head3 L<perlsyn>
943
944=over 4
945
946=item *
947
948An ambiguity in the documentation of the C<...> statement has been corrected.
949L<[perl #122661]|https://rt.perl.org/Ticket/Display.html?id=122661>
950
951=item *
952
953The empty conditional in C<< for >> and C<< while >> is now documented
954in L<< perlsyn >>.
955
956=back
957
958=head3 L<perlunicode>
959
960=over 4
961
962=item *
963
ce93e38b
KW
964This has had extensive revisions to bring it up-to-date with current
965Unicode support and to make it more readable.
eabfc7bc
RS
966
967=back
968
969=head3 L<perluniintro>
970
971=over 4
972
973=item *
974
975Advice for how to make sure your strings and regular expression patterns are
ce93e38b 976interpreted as Unicode has been updated.
eabfc7bc
RS
977
978=back
979
980=head3 L<perlvar>
981
982=over 4
983
984=item *
985
986Further clarify version number representations and usage.
987
988=back
989
990=head3 L<perlvms>
991
992=over 4
993
994=item *
995
996Out-of-date and/or incorrect material has been removed.
997
998=item *
999
1000Updated documentation on environment and shell interaction in VMS.
1001
1002=back
1003
1004=head3 L<perlxs>
1005
1006=over 4
1007
1008=item *
1009
1010Added a discussion of locale issues in XS code.
1011
1012=back
1013
1014=head1 Diagnostics
1015
1016The following additions or changes have been made to diagnostic output,
1017including warnings and fatal error messages. For the complete list of
1018diagnostic messages, see L<perldiag>.
1019
1020=head2 New Diagnostics
1021
1022=head3 New Errors
1023
1024=over 4
1025
1026=item *
1027
1028L<Bad symbol for scalar|perldiag/"Bad symbol for scalar">
1029
1030(P) An internal request asked to add a scalar entry to something that
1031wasn't a symbol table entry.
1032
1033=item *
1034
1035L<Can't use a hash as a reference|perldiag/"Can't use a hash as a reference">
1036
1037(F) You tried to use a hash as a reference, as in
1038C<< %foo->{"bar"} >> or C<< %$ref->{"hello"} >>. Versions of perl E<lt>= 5.6.1
1039used to allow this syntax, but shouldn't have.
1040
1041=item *
1042
1043L<Can't use an array as a reference|perldiag/"Can't use an array as a reference">
1044
1045(F) You tried to use an array as a reference, as in
1046C<< @foo->[23] >> or C<< @$ref->[99] >>. Versions of perl E<lt>= 5.6.1 used to
1047allow this syntax, but shouldn't have.
1048
1049=item *
1050
1051L<Can't use 'defined(@array)' (Maybe you should just omit the defined()?)|perldiag/"Can't use 'defined(@array)' (Maybe you should just omit the defined()?)">
1052
4ec8e6f0 1053(F) C<defined()> is not useful on arrays because it
eabfc7bc 1054checks for an undefined I<scalar> value. If you want to see if the
4ec8e6f0 1055array is empty, just use S<C<if (@array) { # not empty }>> for example.
eabfc7bc
RS
1056
1057=item *
1058
1059L<Can't use 'defined(%hash)' (Maybe you should just omit the defined()?)|perldiag/"Can't use 'defined(%hash)' (Maybe you should just omit the defined()?)">
1060
1061(F) C<defined()> is not usually right on hashes.
1062
4ec8e6f0 1063Although S<C<defined %hash>> is false on a plain not-yet-used hash, it
eabfc7bc 1064becomes true in several non-obvious circumstances, including iterators,
4ec8e6f0
KW
1065weak references, stash names, even remaining true after S<C<undef %hash>>.
1066These things make S<C<defined %hash>> fairly useless in practice, so it now
eabfc7bc
RS
1067generates a fatal error.
1068
1069If a check for non-empty is what you wanted then just put it in boolean
1070context (see L<perldata/Scalar values>):
1071
1072 if (%hash) {
1073 # not empty
1074 }
1075
4ec8e6f0 1076If you had S<C<defined %Foo::Bar::QUUX>> to check whether such a package
eabfc7bc
RS
1077variable exists then that's never really been reliable, and isn't
1078a good way to enquire about the features of a package, or whether
1079it's loaded, etc.
1080
1081=item *
1082
1083L<Cannot chr %f|perldiag/"Cannot chr %f">
1084
c21a1c59
RS
1085(F) You passed an invalid number (like an infinity or not-a-number) to
1086C<chr>.
1087
eabfc7bc
RS
1088=item *
1089
1090L<Cannot compress %f in pack|perldiag/"Cannot compress %f in pack">
1091
c21a1c59
RS
1092(F) You tried converting an infinity or not-a-number to an unsigned
1093character, which makes no sense.
1094
eabfc7bc
RS
1095=item *
1096
1097L<Cannot pack %f with '%c'|perldiag/"Cannot pack %f with '%c'">
1098
c21a1c59
RS
1099(F) You tried converting an infinity or not-a-number to a character,
1100which makes no sense.
1101
eabfc7bc
RS
1102=item *
1103
1104L<Cannot print %f with '%c'|perldiag/"Cannot printf %f with '%c'">
1105
4ec8e6f0
KW
1106(F) You tried printing an infinity or not-a-number as a character (C<%c>),
1107which makes no sense. Maybe you meant C<'%s'>, or just stringifying it?
c21a1c59 1108
eabfc7bc
RS
1109=item *
1110
1111L<charnames alias definitions may not contain a sequence of multiple spaces|perldiag/"charnames alias definitions may not contain a sequence of multiple spaces">
1112
1113(F) You defined a character name which had multiple space
1114characters in a row. Change them to single spaces. Usually these
1115names are defined in the C<:alias> import argument to C<use charnames>, but
1116they could be defined by a translator installed into C<$^H{charnames}>.
1117See L<charnames/CUSTOM ALIASES>.
1118
1119=item *
1120
1121L<charnames alias definitions may not contain trailing white-space|perldiag/"charnames alias definitions may not contain trailing white-space">
1122
1123(F) You defined a character name which ended in a space
1124character. Remove the trailing space(s). Usually these names are
1125defined in the C<:alias> import argument to C<use charnames>, but they
1126could be defined by a translator installed into C<$^H{charnames}>.
1127See L<charnames/CUSTOM ALIASES>.
1128
1129=item *
1130
1131L<:const is not permitted on named subroutines|perldiag/":const is not permitted on named subroutines">
1132
1133(F) The "const" attribute causes an anonymous subroutine to be run and
1134its value captured at the time that it is cloned. Names subroutines are
1135not cloned like this, so the attribute does not make sense on them.
1136
1137=item *
1138
1139L<Hexadecimal float: internal error|perldiag/"Hexadecimal float: internal error">
1140
1141(F) Something went horribly bad in hexadecimal float handling.
1142
1143=item *
1144
1145L<Hexadecimal float: unsupported long double format|perldiag/"Hexadecimal float: unsupported long double format">
1146
1147(F) You have configured Perl to use long doubles but
1148the internals of the long double format are unknown,
1149therefore the hexadecimal float output is impossible.
1150
1151=item *
1152
1153L<Illegal suidscript|perldiag/"Illegal suidscript">
1154
1155(F) The script run under suidperl was somehow illegal.
1156
1157=item *
1158
1159L<In '(?...)', the '(' and '?' must be adjacent in regex; marked by S<<-- HERE> in mE<sol>%sE<sol>|perldiag/"In '(?...)', the '(' and '?' must be adjacent in regex; marked by <-- HERE in m/%s/">
1160
1161(F) The two-character sequence C<"(?"> in
1162this context in a regular expression pattern should be an
1163indivisible token, with nothing intervening between the C<"(">
1164and the C<"?">, but you separated them.
1165
1166=item *
1167
1168L<In '(*VERB...)', the '(' and '*' must be adjacent in regex; marked by S<<-- HERE> in mE<sol>%sE<sol>|perldiag/"In '(*VERB...)', the '(' and '*' must be adjacent in regex; marked by <-- HERE in m/%s/">
1169
1170(F) The two-character sequence C<"(*"> in
1171this context in a regular expression pattern should be an
1172indivisible token, with nothing intervening between the C<"(">
1173and the C<"*">, but you separated them.
1174
1175=item *
1176
1177L<Invalid quantifier in {,} in regex; marked by <-- HERE in mE<sol>%sE<sol>|perldiag/"Invalid quantifier in {,} in regex; marked by <-- HERE in m/%s/">
1178
1179(F) The pattern looks like a {min,max} quantifier, but the min or max could not
1180be parsed as a valid number - either it has leading zeroes, or it represents
1181too big a number to cope with. The S<<-- HERE> shows where in the regular
1182expression the problem was discovered. See L<perlre>.
1183
1184=back
1185
1186=head3 New Warnings
1187
1188=over 4
1189
1190=item *
1191
43831b1f
DM
1192L<\C is deprecated in regex|perldiag/"\C is deprecated in regex; marked by <-- HERE in m/%s/">
1193
1194(D deprecated) The C<< /\C/ >> character class was deprecated in v5.20, and
1195now emits a warning. It is intended that it will become an error in v5.24.
1196This character class matches a single byte even if it appears within a
1197multi-byte character, breaks encapsulation, and can corrupt utf8
1198strings.
1199
1200=item *
1201
eabfc7bc
RS
1202L<'%s' is an unknown bound type in regex|perldiag/"'%s' is an unknown bound type in regex; marked by <-- HERE in m/%s/">
1203
1204You used C<\b{...}> or C<\B{...}> and the C<...> is not known to
1205Perl. The current valid ones are given in
1206L<perlrebackslash/\b{}, \b, \B{}, \B>.
1207
1208=item *
1209
1210L<"%s" is more clearly written simply as "%s" in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol>|perldiag/"%s" is more clearly written simply as "%s" in regex; marked by <-- HERE in mE<sol>%sE<sol>>
1211
1212(W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
1213
1214You specified a character that has the given plainer way of writing it,
1215and which is also portable to platforms running with different character
1216sets.
1217
1218=item *
1219
1220L<Argument "%s" treated as 0 in increment (++)|perldiag/"Argument "%s" treated
1221as 0 in increment (++)">
1222
1223(W numeric) The indicated string was fed as an argument to the C<++> operator
1224which expects either a number or a string matching C</^[a-zA-Z]*[0-9]*\z/>.
1225See L<perlop/Auto-increment and Auto-decrement> for details.
1226
1227=item *
1228
1229L<Both or neither range ends should be Unicode in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol>|perldiag/"Both or neither range ends should be Unicode in regex; marked by <-- HERE in m/%s/">
1230
1231(W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
1232
1233In a bracketed character class in a regular expression pattern, you
1234had a range which has exactly one end of it specified using C<\N{}>, and
1235the other end is specified using a non-portable mechanism. Perl treats
1236the range as a Unicode range, that is, all the characters in it are
1237considered to be the Unicode characters, and which may be different code
1238points on some platforms Perl runs on. For example, C<[\N{U+06}-\x08]>
1239is treated as if you had instead said C<[\N{U+06}-\N{U+08}]>, that is it
1240matches the characters whose code points in Unicode are 6, 7, and 8.
1241But that C<\x08> might indicate that you meant something different, so
1242the warning gets raised.
1243
1244=item *
1245
eabfc7bc
RS
1246L<:const is experimental|perldiag/":const is experimental">
1247
1248(S experimental::const_attr) The "const" attribute is experimental.
1249If you want to use the feature, disable the warning with C<no warnings
1250'experimental::const_attr'>, but know that in doing so you are taking
1251the risk that your code may break in a future Perl version.
1252
1253=item *
1254
1255L<gmtime(%f) failed|perldiag/"gmtime(%f) failed">
1256
1257(W overflow) You called C<gmtime> with a number that it could not handle:
1258too large, too small, or NaN. The returned value is C<undef>.
1259
1260=item *
1261
1262L<Hexadecimal float: exponent overflow|perldiag/"Hexadecimal float: exponent overflow">
1263
1264(W overflow) The hexadecimal floating point has larger exponent
1265than the floating point supports.
1266
1267=item *
1268
1269L<Hexadecimal float: exponent underflow|perldiag/"Hexadecimal float: exponent underflow">
1270
1271(W overflow) The hexadecimal floating point has smaller exponent
1272than the floating point supports.
1273
1274=item *
1275
1276L<Hexadecimal float: mantissa overflow|perldiag/"Hexadecimal float: mantissa overflow">
1277
1278(W overflow) The hexadecimal floating point literal had more bits in
1279the mantissa (the part between the 0x and the exponent, also known as
1280the fraction or the significand) than the floating point supports.
1281
1282=item *
1283
1284L<Hexadecimal float: precision loss|perldiag/"Hexadecimal float: precision loss">
1285
1286(W overflow) The hexadecimal floating point had internally more
1287digits than could be output. This can be caused by unsupported
1288long double formats, or by 64-bit integers not being available
1289(needed to retrieve the digits under some configurations).
1290
eabfc7bc
RS
1291=item *
1292
1293L<localtime(%f) failed|perldiag/"localtime(%f) failed">
1294
1295(W overflow) You called C<localtime> with a number that it could not handle:
1296too large, too small, or NaN. The returned value is C<undef>.
1297
1298=item *
1299
1300L<Negative repeat count does nothing|perldiag/"Negative repeat count does nothing">
1301
1302(W numeric) You tried to execute the
1303L<C<x>|perlop/Multiplicative Operators> repetition operator fewer than 0
1304times, which doesn't make sense.
1305
1306=item *
1307
1308L<NO-BREAK SPACE in a charnames alias definition is deprecated|perldiag/"NO-BREAK SPACE in a charnames alias definition is deprecated">
1309
1310(D deprecated) You defined a character name which contained a no-break
1311space character. Change it to a regular space. Usually these names are
1312defined in the C<:alias> import argument to C<use charnames>, but they
1313could be defined by a translator installed into C<$^H{charnames}>. See
1314L<charnames/CUSTOM ALIASES>.
1315
1316=item *
1317
1318L<Non-finite repeat count does nothing|perldiag/"Non-finite repeat count does nothing">
1319
1320(W numeric) You tried to execute the
1321L<C<x>|perlop/Multiplicative Operators> repetition operator C<Inf> (or
1322C<-Inf>) or C<NaN> times, which doesn't make sense.
1323
1324=item *
1325
1326L<PerlIO layer ':win32' is experimental|perldiag/"PerlIO layer ':win32' is experimental">
1327
1328(S experimental::win32_perlio) The C<:win32> PerlIO layer is
1329experimental. If you want to take the risk of using this layer,
1330simply disable this warning:
1331
1332 no warnings "experimental::win32_perlio";
1333
1334=item *
1335
1336L<Ranges of ASCII printables should be some subset of "0-9", "A-Z", or "a-z" in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol>|perldiag/"Ranges of ASCII printables should be some subset of "0-9", "A-Z", or "a-z" in regex; marked by <-- HERE in mE<sol>%sE<sol>">
1337
1338(W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
1339
1340Stricter rules help to find typos and other errors. Perhaps you didn't
1341even intend a range here, if the C<"-"> was meant to be some other
1342character, or should have been escaped (like C<"\-">). If you did
1343intend a range, the one that was used is not portable between ASCII and
1344EBCDIC platforms, and doesn't have an obvious meaning to a casual
1345reader.
1346
1347 [3-7] # OK; Obvious and portable
1348 [d-g] # OK; Obvious and portable
1349 [A-Y] # OK; Obvious and portable
1350 [A-z] # WRONG; Not portable; not clear what is meant
1351 [a-Z] # WRONG; Not portable; not clear what is meant
1352 [%-.] # WRONG; Not portable; not clear what is meant
1353 [\x41-Z] # WRONG; Not portable; not obvious to non-geek
1354
1355(You can force portability by specifying a Unicode range, which means that
1356the endpoints are specified by
1357L<C<\N{...}>|perlrecharclass/Character Ranges>, but the meaning may
1358still not be obvious.)
1359The stricter rules require that ranges that start or stop with an ASCII
93780ae6 1360character that is not a control have all their endpoints be a literal
eabfc7bc
RS
1361character, and not some escape sequence (like C<"\x41">), and the ranges
1362must be all digits, or all uppercase letters, or all lowercase letters.
1363
1364=item *
1365
1366L<Ranges of digits should be from the same group in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol>|perldiag/"Ranges of digits should be from the same group in regex; marked by <-- HERE in m/%s/">
1367
1368(W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
1369
1370Stricter rules help to find typos and other errors. You included a
1371range, and at least one of the end points is a decimal digit. Under the
1372stricter rules, when this happens, both end points should be digits in
1373the same group of 10 consecutive digits.
1374
1375=item *
1376
1377L<Redundant argument in %s|perldiag/Redundant argument in %s>
1378
1379(W redundant) You called a function with more arguments than other
1380arguments you supplied indicated would be needed. Currently only
1381emitted when a printf-type format required fewer arguments than were
1382supplied, but might be used in the future for e.g. L<perlfunc/pack>.
1383
a75e6a3a
SH
1384The warnings category C<< redundant >> is new. See also
1385L<[perl #121025]|https://rt.perl.org/Ticket/Display.html?id=121025>.
eabfc7bc
RS
1386
1387=item *
1388
1389L<Use of \b{} for non-UTF-8 locale is wrong. Assuming a UTF-8 locale|perldiag/"Use of \b{} for non-UTF-8 locale is wrong. Assuming a UTF-8 locale">
1390
1391You are matching a regular expression using locale rules,
1392and a Unicode boundary is being matched, but the locale is not a Unicode
1393one. This doesn't make sense. Perl will continue, assuming a Unicode
1394(UTF-8) locale, but the results could well be wrong except if the locale
1395happens to be ISO-8859-1 (Latin1) where this message is spurious and can
1396be ignored.
1397
1398=item *
1399
1400L<< Using E<sol>u for '%s' instead of E<sol>%s in regex; marked by E<lt>-- HERE in mE<sol>%sE<sol>|perldiag/"Using E<sol>u for '%s' instead of E<sol>%s in regex; marked by <-- HERE in mE<sol>%sE<sol>" >>
1401
1402You used a Unicode boundary (C<\b{...}> or C<\B{...}>) in a
1403portion of a regular expression where the character set modifiers C</a>
1404or C</aa> are in effect. These two modifiers indicate an ASCII
1405interpretation, and this doesn't make sense for a Unicode definition.
1406The generated regular expression will compile so that the boundary uses
1407all of Unicode. No other portion of the regular expression is affected.
1408
1409=item *
1410
1411L<The bitwise feature is experimental|perldiag/"The bitwise feature is experimental">
1412
1413This warning is emitted if you use bitwise
1414operators (C<& | ^ ~ &. |. ^. ~.>) with the "bitwise" feature enabled.
1415Simply suppress the warning if you want to use the feature, but know
1416that in doing so you are taking the risk of using an experimental
1417feature which may change or be removed in a future Perl version:
1418
1419 no warnings "experimental::bitwise";
1420 use feature "bitwise";
1421 $x |.= $y;
1422
1423=item *
1424
1425L<Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in mE<sol>%sE<sol>|perldiag/"Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/%s/">
1426
1427(D deprecated, regexp) You used a literal C<"{"> character in a regular
1428expression pattern. You should change to use C<"\{"> instead, because a future
1429version of Perl (tentatively v5.26) will consider this to be a syntax error. If
1430the pattern delimiters are also braces, any matching right brace
1431(C<"}">) should also be escaped to avoid confusing the parser, for
1432example,
1433
1434 qr{abc\{def\}ghi}
1435
1436=item *
1437
1438L<Use of literal non-graphic characters in variable names is deprecated|perldiag/"Use of literal non-graphic characters in variable names is deprecated">
1439
1440=item *
1441
1442L<Useless use of attribute "const"|perldiag/Useless use of attribute "const">
1443
1444(W misc) The "const" attribute has no effect except
1445on anonymous closure prototypes. You applied it to
1446a subroutine via L<attributes.pm|attributes>. This is only useful
1447inside an attribute handler for an anonymous subroutine.
1448
1449=item *
1450
1451L<E<quot>use re 'strict'E<quot> is experimental|perldiag/"use re 'strict'" is experimental>
1452
1453(S experimental::re_strict) The things that are different when a regular
1454expression pattern is compiled under C<'strict'> are subject to change
1455in future Perl releases in incompatible ways. This means that a pattern
1456that compiles today may not in a future Perl release. This warning is
1457to alert you to that risk.
1458
1459=item *
1460
caa16dbd
TC
1461L<Warning: unable to close filehandle properly: %s|perldiag/"Warning: unable to close filehandle properly: %s">
1462
eabfc7bc
RS
1463L<Warning: unable to close filehandle %s properly: %s|perldiag/"Warning: unable to close filehandle %s properly: %s">
1464
caa16dbd
TC
1465(S io) An error occurred when Perl implicitly closed a filehandle. This
1466usually indicates your file system ran out of disk space.
1467
eabfc7bc
RS
1468=item *
1469
1470L<Wide character (U+%X) in %s|perldiag/"Wide character (U+%X) in %s">
1471
1472(W locale) While in a single-byte locale (I<i.e.>, a non-UTF-8
1473one), a multi-byte character was encountered. Perl considers this
1474character to be the specified Unicode code point. Combining non-UTF8
1475locales and Unicode is dangerous. Almost certainly some characters
1476will have two different representations. For example, in the ISO 8859-7
1477(Greek) locale, the code point 0xC3 represents a Capital Gamma. But so
1478also does 0x393. This will make string comparisons unreliable.
1479
1480You likely need to figure out how this multi-byte character got mixed up
1481with your single-byte locale (or perhaps you thought you had a UTF-8
1482locale, but Perl disagrees).
1483
1484=item *
1485
1486The following two warnings for C<tr///> used to be skipped if the
1487transliteration contained wide characters, but now they occur regardless of
1488whether there are wide characters or not:
1489
1490L<Useless use of E<sol>d modifier in transliteration operator|perldiag/"Useless use of /d modifier in transliteration operator">
1491
1492L<Replacement list is longer than search list|perldiag/Replacement list is longer than search list>
1493
1494=item *
1495
1496A new C<locale> warning category has been created, with the following warning
1497messages currently in it:
1498
1499=over 4
1500
1501=item *
1502
1503L<Locale '%s' may not work well.%s|perldiag/Locale '%s' may not work well.%s>
1504
1505=item *
1506
1507L<Can't do %s("%s") on non-UTF-8 locale; resolved to "%s".|perldiag/Can't do %s("%s") on non-UTF-8 locale; resolved to "%s".>
1508
1509=back
1510
1511=back
1512
1513=head2 Changes to Existing Diagnostics
1514
1515=over 4
1516
1517=item *
1518
1519<> should be quotes
1520
1521This warning has been changed to
1522L<< <> at require-statement should be quotes|perldiag/"<> at require-statement should be quotes" >>
1523to make the issue more identifiable.
1524
1525=item *
1526
1527L<Argument "%s" isn't numeric%s|perldiag/"Argument "%s" isn't numeric%s">
1528now adds the following note:
1529
4ec8e6f0 1530 Note that for the Inf and NaN (infinity and not-a-number) the
77c2376a
KW
1531 definition of "numeric" is somewhat unusual: the strings themselves
1532 (like "Inf") are considered numeric, and anything following them is
1533 considered non-numeric.
eabfc7bc
RS
1534
1535=item *
1536
1537L<Global symbol "%s" requires explicit package name|perldiag/"Global symbol "%s" requires explicit package name (did you forget to declare "my %s"?)">
1538
1539This message has had '(did you forget to declare "my %s"?)' appended to it, to
1540make it more helpful to new Perl programmers.
1541L<[perl #121638]|https://rt.perl.org/Ticket/Display.html?id=121638>
1542
1543=item *
1544
1545'"my" variable &foo::bar can't be in a package' has been reworded to say
1546'subroutine' instead of 'variable'.
1547
1548=item *
1549
022a330c 1550L<\N{} in character class restricted to one character in regex; marked by S<<-- HERE> in mE<sol>%sE<sol>|perldiag/"\N{} in inverted character class or as a range end-point is restricted to one character in regex; marked by <-- HERE in m/%s/">
eabfc7bc
RS
1551
1552This message has had 'character class' changed to 'inverted character class or
1553as a range end-point is' to reflect improvements in C<qr/[\N{named sequence}]/>
1554(see under L</Selected Bug Fixes>).
1555
1556=item *
1557
1558L<panic: frexp|perldiag/"panic: frexp: %f">
1559
4ec8e6f0 1560This message has had ': C<%f>' appended to it, to show what the offending floating
eabfc7bc
RS
1561point number is.
1562
1563=item *
1564
1565B<Possible precedence problem on bitwise %c operator> reworded as
1566L<Possible precedence problem on bitwise %s operator|perldiag/"Possible precedence problem on bitwise %s operator">.
1567
1568=item *
1569
1570C<require> with no argument or undef used to warn about a Null filename; now
1571it dies with C<Missing or undefined argument to require>.
1572
1573=item *
1574
1575L<Unsuccessful %s on filename containing newline|perldiag/"Unsuccessful %s on filename containing newline">
1576
1577This warning is now only produced when the newline is at the end of
1578the filename.
1579
1580=item *
1581
4ec8e6f0 1582"Variable C<%s> will not stay shared" has been changed to say "Subroutine"
eabfc7bc
RS
1583when it is actually a lexical sub that will not stay shared.
1584
1585=item *
1586
1587L<Variable length lookbehind not implemented in regex mE<sol>%sE<sol>|perldiag/"Variable length lookbehind not implemented in regex m/%s/">
1588
1589Information about Unicode behaviour has been added.
1590
1591=back
1592
1593=head2 Diagnostic Removals
1594
1595=over
1596
1597=item *
1598
1599"Ambiguous use of -foo resolved as -&foo()"
1600
1601There is actually no ambiguity here, and this impedes the use of negated
1602constants; e.g., C<-Inf>.
1603
1604=item *
1605
1606"Constant is not a FOO reference"
1607
1608Compile-time checking of constant dereferencing (e.g., C<< my_constant->() >>)
1609has been removed, since it was not taking overloading into account.
1610L<[perl #69456]|https://rt.perl.org/Ticket/Display.html?id=69456>
1611L<[perl #122607]|https://rt.perl.org/Ticket/Display.html?id=122607>
1612
1613=back
1614
1615=head1 Utility Changes
1616
1617=head2 F<x2p/>
1618
1619=over 4
1620
1621=item *
1622
1623The F<x2p/> directory has been removed from the Perl core.
1624
1625This removes find2perl, s2p and a2p. They have all been released to CPAN as
1626separate distributions (App::find2perl, App::s2p, App::a2p).
1627
1628=back
1629
1630=head2 L<h2ph>
1631
1632=over 4
1633
1634=item *
1635
1636F<h2ph> now handles hexadecimal constants in the compiler's predefined
a75e6a3a
SH
1637macro definitions, as visible in C<$Config{cppsymbols}>.
1638L<[perl #123784]|https://rt.perl.org/Ticket/Display.html?id=123784>.
eabfc7bc
RS
1639
1640=back
1641
1642=head2 L<encguess>
1643
1644=over 4
1645
1646=item *
1647
f1c9eac6 1648No longer depends on non-core modules.
eabfc7bc
RS
1649
1650=back
1651
1652=head1 Configuration and Compilation
1653
1654=over 4
1655
1656=item *
1657
1658F<Configure> now checks for F<lrintl>, F<lroundl>, F<llrintl>, and F<llroundl>.
1659
1660=item *
1661
a75e6a3a
SH
1662F<Configure> with C<-Dmksymlinks> should now be faster.
1663L<[perl #122002]|https://rt.perl.org/Ticket/Display.html?id=122002>.
eabfc7bc
RS
1664
1665=item *
1666
1667pthreads and lcl will be linked by default if present. This allows XS modules
1668that require threading to work on non-threaded perls. Note that you must still
1669pass C<-Dusethreads> if you want a threaded perl.
1670
1671=item *
1672
1673For long doubles (to get more precision and range for floating point numbers)
1674one can now use the GCC quadmath library which implements the quadruple
f1c9eac6
DM
1675precision floating point numbers on x86 and IA-64 platforms. See
1676F<INSTALL> for details.
eabfc7bc
RS
1677
1678=item *
1679
1680MurmurHash64A and MurmurHash64B can now be configured as the internal hash
1681function.
1682
1683=item *
1684
1685C<make test.valgrind> now supports parallel testing.
1686
1687For example:
1688
1689 TEST_JOBS=9 make test.valgrind
1690
1691See L<perlhacktips/valgrind> for more information.
1692
1693L<[perl #121431]|https://rt.perl.org/Ticket/Display.html?id=121431>
1694
1695=item *
1696
1697The MAD (Misc Attribute Decoration) build option has been removed
1698
1699This was an unmaintained attempt at preserving
1700the Perl parse tree more faithfully so that automatic conversion of
1701Perl 5 to Perl 6 would have been easier.
1702
1703This build-time configuration option had been unmaintained for years,
1704and had probably seriously diverged on both Perl 5 and Perl 6 sides.
1705
1706=item *
1707
1708A new compilation flag, C<< -DPERL_OP_PARENT >> is available. For details,
1709see the discussion below at L<< /Internal Changes >>.
1710
43831b1f
DM
1711=item *
1712
1713Pathtools no longer tries to load XS on miniperl. This speeds up building perl
1714slightly.
1715
1716
eabfc7bc
RS
1717=back
1718
1719=head1 Testing
1720
1721=over 4
1722
1723=item *
1724
1725F<t/porting/re_context.t> has been added to test that L<utf8> and its
1726dependencies only use the subset of the C<$1..$n> capture vars that
4ec8e6f0 1727C<Perl_save_re_context()> is hard-coded to localize, because that function has no
eabfc7bc
RS
1728efficient way of determining at runtime what vars to localize.
1729
1730=item *
1731
1732Tests for performance issues have been added in the file F<t/perf/taint.t>.
1733
1734=item *
1735
1736Some regular expression tests are written in such a way that they will
1737run very slowly if certain optimizations break. These tests have been
1738moved into new files, F<< t/re/speed.t >> and F<< t/re/speed_thr.t >>,
1739and are run with a C<< watchdog() >>.
1740
1741=item *
1742
1743C<< test.pl >> now allows C<< plan skip_all => $reason >>, to make it
1744more compatible with C<< Test::More >>.
1745
1746=item *
1747
1748A new test script, F<op/infnan.t>, has been added to test if Inf and NaN are
1749working correctly. See L</Infinity and NaN (not-a-number) handling improved>.
1750
1751=back
1752
1753=head1 Platform Support
1754
1755=head2 Regained Platforms
1756
1757=over 4
1758
1759=item IRIX and Tru64 platforms are working again.
1760
1761(Some C<make test> failures remain.)
1762
1763=item z/OS running EBCDIC Code Page 1047
1764
1765Core perl now works on this EBCDIC platform. Earlier perls also worked, but,
1766even though support wasn't officially withdrawn, recent perls would not compile
1767and run well. Perl 5.20 would work, but had many bugs which have now been
1768fixed. Many CPAN modules that ship with Perl still fail tests, including
1769Pod::Simple. However the version of Pod::Simple currently on CPAN should work;
1770it was fixed too late to include in Perl 5.22. Work is under way to fix many
1771of the still-broken CPAN modules, which likely will be installed on CPAN when
1772completed, so that you may not have to wait until Perl 5.24 to get a working
1773version.
1774
1775=back
1776
1777=head2 Discontinued Platforms
1778
1779=over 4
1780
1781=item NeXTSTEP/OPENSTEP
1782
f1c9eac6
DM
1783NeXTSTEP was a proprietary operating system bundled with NeXT's
1784workstations in the early to mid 90s; OPENSTEP was an API specification
1785that provided a NeXTSTEP-like environment on a non-NeXTSTEP system. Both
1786are now long dead, so support for building Perl on them has been removed.
eabfc7bc
RS
1787
1788=back
1789
1790=head2 Platform-Specific Notes
1791
1792=over 4
1793
1794=item EBCDIC
1795
1796Special handling is required on EBCDIC platforms to get C<qr/[i-j]/> to
1797match only C<"i"> and C<"j">, since there are 7 characters between the
1798code points for C<"i"> and C<"j">. This special handling had only been
1799invoked when both ends of the range are literals. Now it is also
1800invoked if any of the C<\N{...}> forms for specifying a character by
1801name or Unicode code point is used instead of a literal. See
1802L<perlrecharclass/Character Ranges>.
1803
1804=item HP-UX
1805
1806The archname now distinguishes use64bitint from use64bitall.
1807
1808=item Android
1809
1810Build support has been improved for cross-compiling in general and for
1811Android in particular.
1812
1813=item VMS
1814
1815=over 4
1816
1817=item *
1818
1819When spawning a subprocess without waiting, the return value is now
1820the correct PID.
1821
1822=item *
1823
1824Fix a prototype so linking doesn't fail under the VMS C++ compiler.
1825
1826=item *
1827
1828C<finite>, C<finitel>, and C<isfinite> detection has been added to
1829C<configure.com>, environment handling has had some minor changes, and
1830a fix for legacy feature checking status.
1831
1832=back
1833
1834=item Win32
1835
1836=over 4
1837
1838=item *
1839
1840F<miniperl.exe> is now built with C<-fno-strict-aliasing>, allowing 64-bit
1841builds to complete on GCC 4.8.
1842L<[perl #123976]|https://rt.perl.org/Ticket/Display.html?id=123976>
1843
1844=item *
1845
17fcdc49
TC
1846C<nmake minitest> now works on Win32. Due to dependency issues you
1847need to build C<nmake test-prep> first, and a small number of the
1848tests fail.
1849L<[perl #123394]|https://rt.perl.org/Ticket/Display.html?id=123394>
1850
1851=item *
1852
eabfc7bc
RS
1853Perl can now be built in C++ mode on Windows by setting the makefile macro
1854C<USE_CPLUSPLUS> to the value "define".
1855
1856=item *
1857
18f4cc8e
TC
1858List form of pipe open has been implemented for Win32. Note: unlike
1859C< system LIST >> this does not fall back to the shell.
1860L<[perl #121159]|https://rt.perl.org/Ticket/Display.html?id=121159>
eabfc7bc
RS
1861
1862=item *
1863
eabfc7bc
RS
1864New C<DebugSymbols> and C<DebugFull> configuration options added to
1865Windows makefiles.
1866
1867=item *
1868
1869L<B> now compiles again on Windows.
1870
1871=item *
1872
f1c9eac6
DM
1873Previously compiling XS modules (including CPAN ones) using Visual C++ for
1874Win64 resulted in around a dozen warnings per file from hv_func.h. These
1875warnings have been silenced.
eabfc7bc
RS
1876
1877=item *
1878
1879Support for building without PerlIO has been removed from the Windows
1880makefiles. Non-PerlIO builds were all but deprecated in Perl 5.18.0 and are
1881already not supported by F<Configure> on POSIX systems.
1882
1883=item *
1884
1885Between 2 and 6 ms and 7 I/O calls have been saved per attempt to open a perl
1886module for each path in C<@INC>.
1887
1888=item *
1889
1890Intel C builds are now always built with C99 mode on.
1891
1892=item *
1893
1894C<%I64d> is now being used instead of C<%lld> for MinGW.
1895
1896=item *
1897
1898In the experimental C<:win32> layer, a crash in C<open> was fixed. Also
1899opening C</dev/null>, which works the Win32 Perl's normal C<:unix> layer, was
1900implemented for C<:win32>.
1901L<[perl #122224]|https://rt.perl.org/Ticket/Display.html?id=122224>
1902
1903=item *
1904
1905A new makefile option, C<USE_LONG_DOUBLE>, has been added to the Windows
1906dmake makefile for gcc builds only. Set this to "define" if you want perl to
1907use long doubles to give more accuracy and range for floating point numbers.
1908
1909=back
1910
1911=item OpenBSD
1912
1913On OpenBSD, Perl will now default to using the system C<malloc> due to the
1914security features it provides. Perl's own malloc wrapper has been in use
1915since v5.14 due to performance reasons, but the OpenBSD project believes
1916the tradeoff is worth it and would prefer that users who need the speed
1917specifically ask for it.
1918
1919L<[perl #122000]|https://rt.perl.org/Ticket/Display.html?id=122000>.
1920
1921=item Solaris
1922
1923=over 4
1924
1925=item *
1926
1927We now look for the Sun Studio compiler in both F</opt/solstudio*> and
1928F</opt/solarisstudio*>.
1929
1930=item *
1931
1932Builds on Solaris 10 with C<-Dusedtrace> would fail early since make
1933didn't follow implied dependencies to build C<perldtrace.h>. Added an
1934explicit dependency to C<depend>.
1935L<[perl #120120]|https://rt.perl.org/Ticket/Display.html?id=120120>
1936
1937=item *
1938
1939C<c99> options have been cleaned up, hints look for C<solstudio>
1940as well as C<SUNWspro>, and support for native C<setenv> has been added.
1941
1942=back
1943
1944=back
1945
1946=head1 Internal Changes
1947
1948=over 4
1949
1950=item *
1951
bad0181b
DM
1952Experimental support has been added to allow ops in the optree to locate
1953their parent, if any. This is enabled by the non-default build option
1954C<-DPERL_OP_PARENT>. It is envisaged that this will eventually become
1955enabled by default, so XS code which directly accesses the C<op_silbing>
1956field of ops should be updated to be future-proofed.
eabfc7bc
RS
1957
1958On C<PERL_OP_PARENT> builds, the C<op_sibling> field has been renamed
bad0181b
DM
1959C<op_sibparent> and a new flag, C<op_moresib>, added. On the last op in a
1960sibling chain, C<op_moresib> is false and C<op_sibparent> points to the
1961parent (if any) rather than to being C<NULL>.
1962
1963To make existing code work transparently whether using C<-DPERL_OP_PARENT>
1964or not, a number of new macros and functions have been added that should
1965be used, rather than directly manipulating C<op_sibling>.
1966
1967For the case of just reading C<op_sibling> to determine the next sibling,
1968two new macros have been added. A simple scan through a sibling chain
1969like this:
1970
1971 for (; kid->op_sibling; kid = kid->op_sibling) { ... }
1972
1973should now be written as:
1974
1975 for (; OpHAS_SIBLING(kid); kid = OpSIBLING(kid)) { ... }
1976
1977For altering optrees, A general-purpose function C<op_sibling_splice()>
1978has been added, which allows for manipulation of a chain of sibling ops.
1979By analogy with the Perl function C<splice()>, it allows you to cut out
1980zero or more ops from a sibling chain and replace them with zero or more
1981new ops. It transparently handles all the updating of sibling, parent,
1982op_last pointers etc.
1983
1984If you need to manipulate ops at a lower level, then three new macros,
1985C<OpMORESIB_set>, C<OpLASTSIB_set> and C<OpMAYBESIB_set> are intended to
1986be a low-level portable way to set C<op_sibling> / C<op_sibparent> while
1987also updating C<op_moresib>. The first sets the sibling pointer to a new
1988sibling, the second makes the op the last sibling, and the third
1989conditionally does the first or second action. Note that unlike
1990C<op_sibling_splice()> these macros won't maintain consistency in the
1991parent at the same time (e.g. by updating C<op_first> and C<op_last> where
1992appropriate).
1993
1994A C-level C<Perl_op_parent()> function and a perl-level C<B::OP::parent()>
1995method have been added. The C function only exists under
1996C<-DPERL_OP_PARENT> builds (using it is build-time error on vanilla
1997perls). C<B::OP::parent()> exists always, but on a vanilla build it
1998always returns C<NULL>. Under C<-DPERL_OP_PARENT>, they return the parent
1999of the current op, if any. The variable C<$B::OP::does_parent> allows you
2000to determine whether C<B> supports retrieving an op's parent.
2001
19c9b733 2002XXX C<-DPERL_OP_PARENT> was introduced in 5.21.2, but the interface was
bad0181b
DM
2003changed considerably in 5.21.11. If you updated your code before the
20045.21.11 changes, it may require further revision. The main changes after
20055.21.2 were:
eabfc7bc 2006
bad0181b 2007=over 4
eabfc7bc
RS
2008
2009=item *
2010
bad0181b
DM
2011The C<OP_SIBLING> and C<OP_HAS_SIBLING> macros have been renamed
2012C<OpSIBLING> and C<OpHAS_SIBLING> for consistency with other
2013op-manipulating macros.
eabfc7bc
RS
2014
2015=item *
2016
bad0181b
DM
2017The C<op_lastsib> field has been renamed C<op_moresib>, and its meaning
2018inverted.
eabfc7bc
RS
2019
2020=item *
2021
bad0181b
DM
2022The macro C<OpSIBLING_set> has been removed, and has been superseded by
2023C<OpMORESIB_set> et al.
eabfc7bc
RS
2024
2025=item *
2026
bad0181b
DM
2027The C<op_sibling_splice()> function now accepts a null C<parent> argument
2028where the splicing doesn't affect the first or last ops in the sibling
2029chain
eabfc7bc
RS
2030
2031=back
2032
2033=item *
2034
2035Macros have been created to allow XS code to better manipulate the POSIX locale
2036category C<LC_NUMERIC>. See L<perlapi/Locale-related functions and macros>.
2037
2038=item *
2039
2040The previous C<atoi> et al replacement function, C<grok_atou>, has now been
2041superseded by C<grok_atoUV>. See L<perlclib> for details.
2042
2043=item *
2044
4ec8e6f0 2045Added C<Perl_sv_get_backrefs()> to determine if an SV is a weak-referent.
eabfc7bc
RS
2046
2047Function either returns an SV * of type AV, which contains the set of
2048weakreferences which reference the passed in SV, or a simple RV * which
2049is the only weakref to this item.
2050
2051=item *
2052
f1c9eac6
DM
2053The C<screaminstr> perl function has been removed. Although marked as
2054public API, it was undocumented and had no usage in CPAN modules. Calling
2055it has been fatal since 5.17.0.
eabfc7bc
RS
2056
2057=item *
2058
2059C<newDEFSVOP>, C<block_start>, C<block_end> and C<intro_my> have been added
2060to the API.
2061
2062=item *
2063
2064The internal C<convert> function in F<op.c> has been renamed
2065C<op_convert_list> and added to the API.
2066
2067=item *
2068
2069C<sv_magic> no longer forbids "ext" magic on read-only values. After all,
2070perl can't know whether the custom magic will modify the SV or not.
a75e6a3a 2071L<[perl #123103]|https://rt.perl.org/Ticket/Display.html?id=123103>.
eabfc7bc
RS
2072
2073=item *
2074
19c9b733 2075Accessing L<perlapi/CvPADLIST> in an XSUB is now forbidden.
4488fd23
KW
2076C<CvPADLIST> has been reused for a different internal purpose for XSUBs. Guard all
2077C<CvPADLIST> expressions with C<CvISXSUB()> if your code doesn't already block
eabfc7bc
RS
2078XSUB CV*s from going through optree CV* expecting code.
2079
2080=item *
2081
2082SVs of type SVt_NV are now bodyless when a build configure and platform allow
2083it, specifically C<sizeof(NV) <= sizeof(IV)>. The bodyless trick is the same one
2084as for IVs since 5.9.2, but for NVs, unlike IVs, is not guaranteed on all
2085platforms and build configurations.
2086
2087=item *
2088
2089The C<$DB::single>, C<$DB::signal> and C<$DB::trace> now have set and
2090get magic that stores their values as IVs and those IVs are used when
2091testing their values in C<pp_dbstate>. This prevents perl from
f1c9eac6 2092recursing infinitely if an overloaded object is assigned to any of those
a75e6a3a
SH
2093variables.
2094L<[perl #122445]|https://rt.perl.org/Ticket/Display.html?id=122445>.
eabfc7bc
RS
2095
2096=item *
2097
f1c9eac6 2098C<Perl_tmps_grow> which is marked as public API but is undocumented, has been
eabfc7bc
RS
2099removed from public API. If you use C<EXTEND_MORTAL> macro in your XS code to
2100preextend the mortal stack, you are unaffected by this change.
2101
2102=item *
2103
19c9b733 2104XXX C<cv_name>, which was introduced in 5.21.4, has been changed incompatibly.
eabfc7bc
RS
2105It now has a flags field that allows the caller to specify whether the name
2106should be fully qualified. See L<perlapi/cv_name>.
2107
2108=item *
2109
2110Internally Perl no longer uses the C<SVs_PADMY> flag. C<SvPADMY()> now
2111returns a true value for anything not marked PADTMP. C<SVs_PADMY> is now
2112defined as 0.
2113
2114=item *
2115
2116The macros SETsv and SETsvUN have been removed. They were no longer used
2117in the core since commit 6f1401dc2a, and have not been found present on
2118CPAN.
2119
2120=item *
2121
2122The C<< SvFAKE >> bit (unused on HVs) got informally reserved by
2123David Mitchell for future work on vtables.
2124
2125=item *
2126
2127The C<sv_catpvn_flags> function accepts C<SV_CATBYTES> and C<SV_CATUTF8>
2128flags, which specify whether the appended string is bytes or utf8,
2129respectively.
2130
2131=item *
2132
f1c9eac6 2133A new opcode class, C<< METHOP >>, has been introduced. It holds
eabfc7bc
RS
2134class/method related info needed at runtime to improve performance
2135of class/object method calls.
2136
2137C<< OP_METHOD >> and C<< OP_METHOD_NAMED >> are moved from being
2138C<< UNOP/SVOP >> to being C<< METHOP >>.
2139
2140=item *
2141
2142C<save_re_context> no longer does anything and has been moved to F<mathoms.c>.
2143
2144=item *
2145
2146C<cv_name> is a new API function that can be passed a CV or GV. It returns an
2147SV containing the name of the subroutine for use in diagnostics.
2148L<[perl #116735]|https://rt.perl.org/Ticket/Display.html?id=116735>
2149L<[perl #120441]|https://rt.perl.org/Ticket/Display.html?id=120441>
2150
2151=item *
2152
2153C<cv_set_call_checker_flags> is a new API function that works like
2154C<cv_set_call_checker>, except that it allows the caller to specify whether the
2155call checker requires a full GV for reporting the subroutine's name, or whether
2156it could be passed a CV instead. Whatever value is passed will be acceptable
2157to C<cv_name>. C<cv_set_call_checker> guarantees there will be a GV, but it
2158may have to create one on the fly, which is inefficient.
2159L<[perl #116735]|https://rt.perl.org/Ticket/Display.html?id=116735>
2160
2161=item *
2162
2163C<CvGV> (which is not part of the API) is now a more complex macro, which may
2164call a function and reify a GV. For those cases where is has been used as a
2165boolean, C<CvHASGV> has been added, which will return true for CVs that
2166notionally have GVs, but without reifying the GV. C<CvGV> also returns a GV
2167now for lexical subs.
2168L<[perl #120441]|https://rt.perl.org/Ticket/Display.html?id=120441>
2169
2170=item *
2171
2172Added L<perlapi/sync_locale>. Changing the program's locale should be avoided
2173by XS code. Nevertheless, certain non-Perl libraries called from XS, such as
2174C<Gtk> do so. When this happens, Perl needs to be told that the locale has
2175changed. Use this function to do so, before returning to Perl.
2176
2177=item *
2178
2179The defines and labels for the flags in the C<op_private> field of OPs are now
2180auto-generated from data in F<regen/op_private>. The noticeable effect of this
2181is that some of the flag output of C<Concise> might differ slightly, and the
2182flag output of C<perl -Dx> may differ considerably (they both use the same set
2183of labels now). Also in debugging builds, there is a new assert in
2184C<op_free()> that checks that the op doesn't have any unrecognized flags set in
2185C<op_private>.
2186
2187=item *
2188
eabfc7bc
RS
2189The deprecated variable C<PL_sv_objcount> has been removed.
2190
2191=item *
2192
2193Perl now tries to keep the locale category C<LC_NUMERIC> set to "C"
2194except around operations that need it to be set to the program's
2195underlying locale. This protects the many XS modules that cannot cope
2196with the decimal radix character not being a dot. Prior to this
2197release, Perl initialized this category to "C", but a call to
2198C<POSIX::setlocale()> would change it. Now such a call will change the
2199underlying locale of the C<LC_NUMERIC> category for the program, but the
ce93e38b
KW
2200locale exposed to XS code will remain "C". There are new macros
2201to manipulate the LC_NUMERIC locale, including
2202C<STORE_LC_NUMERIC_SET_TO_NEEDED> and
2203C<STORE_LC_NUMERIC_FORCE_TO_UNDERLYING>.
2204See L<perlapi/Locale-related functions and macros>.
eabfc7bc
RS
2205
2206=item *
2207
2208A new macro L<C<isUTF8_CHAR>|perlapi/isUTF8_CHAR> has been written which
2209efficiently determines if the string given by its parameters begins
2210with a well-formed UTF-8 encoded character.
2211
2212=item *
2213
2214The following private API functions had their context parameter removed,
2215C<Perl_cast_ulong>, C<Perl_cast_i32>, C<Perl_cast_iv>, C<Perl_cast_uv>,
2216C<Perl_cv_const_sv>, C<Perl_mg_find>, C<Perl_mg_findext>, C<Perl_mg_magical>,
2217C<Perl_mini_mktime>, C<Perl_my_dirfd>, C<Perl_sv_backoff>, C<Perl_utf8_hop>.
2218
2219Users of the public API prefix-less calls remain unaffected.
2220
2221=item *
2222
eabfc7bc 2223The PADNAME and PADNAMELIST types are now separate types, and no longer
a75e6a3a
SH
2224simply aliases for SV and AV.
2225L<[perl #123223]|https://rt.perl.org/Ticket/Display.html?id=123223>.
eabfc7bc
RS
2226
2227=item *
2228
2229Pad names are now always UTF8. The C<PadnameUTF8> macro always returns
2230true. Previously, this was effectively the case already, but any support
2231for two different internal representations of pad names has now been
2232removed.
2233
2234=item *
2235
eabfc7bc
RS
2236A new op class, C<UNOP_AUX>, has been added. This is a subclass of
2237C<UNOP> with an C<op_aux> field added, which points to an array of unions
2238of C<UV>, C<SV*> etc. It is intended for where an op needs to store more data
2239than a simple C<op_sv> or whatever. Currently the only op of this type is
2240C<OP_MULTIDEREF> (see below).
2241
2242=item *
2243
2244A new op has been added, C<OP_MULTIDEREF>, which performs one or more
2245nested array and hash lookups where the key is a constant or simple
2246variable. For example the expression C<$a[0]{$k}[$i]>, which previously
2247involved ten C<rv2Xv>, C<Xelem>, C<gvsv> and C<const> ops is now performed
2248by a single C<multideref> op. It can also handle C<local>, C<exists> and
2249C<delete>. A non-simple index expression, such as C<[$i+1]> is still done
77c2376a 2250using C<aelem>/C<helem>, and single-level array lookup with a small constant
eabfc7bc
RS
2251index is still done using C<aelemfast>.
2252
2253=back
2254
2255=head1 Selected Bug Fixes
2256
2257=over 4
2258
2259=item *
2260
2261C<pack("D", $x)> and C<pack("F", $x)> now zero the padding on x86 long double
2262builds. GCC 4.8 and later, under some build options, would either overwrite
2263the zero-initialized padding, or bypass the initialized buffer entirely. This
2264caused F<op/pack.t> to fail.
2265L<[perl #123971]|https://rt.perl.org/Ticket/Display.html?id=123971>
2266
2267=item *
2268
2269Extending an array cloned from a parent thread could result in "Modification of
2270a read-only value attempted" errors when attempting to modify the new elements.
2271L<[perl #124127]|https://rt.perl.org/Ticket/Display.html?id=124127>
2272
2273=item *
2274
2275An assertion failure and subsequent crash with C<< *x=<y> >> has been fixed.
2276L<[perl #123790]|https://rt.perl.org/Ticket/Display.html?id=123790>
2277
2278=item *
2279
19c9b733 2280XXX An optimization for state variable initialization introduced in Perl 5.21.6 has
eabfc7bc
RS
2281been reverted because it was found to exacerbate some other existing buggy
2282behaviour.
2283L<[perl #124160]|https://rt.perl.org/Ticket/Display.html?id=124160>
2284
2285=item *
2286
19c9b733 2287XXX The extension of another optimization to cover more ops in Perl 5.21 has also
eabfc7bc
RS
2288been reverted to its Perl 5.20 state as a temporary fix for regression issues
2289that it caused.
2290L<[perl #123790]|https://rt.perl.org/Ticket/Display.html?id=123790>
2291
2292=item *
2293
eabfc7bc
RS
2294A possible crashing/looping bug has been fixed.
2295L<[perl #124099]|https://rt.perl.org/Ticket/Display.html?id=124099>
2296
2297=item *
2298
2299UTF-8 variable names used in array indexes, unquoted UTF-8 HERE-document
2300terminators and UTF-8 function names all now work correctly.
2301L<[perl #124113]|https://rt.perl.org/Ticket/Display.html?id=124113>
2302
2303=item *
2304
2305Repeated global pattern matches in scalar context on large tainted strings were
2306exponentially slow depending on the current match position in the string.
2307L<[perl #123202]|https://rt.perl.org/Ticket/Display.html?id=123202>
2308
2309=item *
2310
2311Various crashes due to the parser getting confused by syntax errors have been
2312fixed.
2313L<[perl #123801]|https://rt.perl.org/Ticket/Display.html?id=123801>
2314L<[perl #123802]|https://rt.perl.org/Ticket/Display.html?id=123802>
2315L<[perl #123955]|https://rt.perl.org/Ticket/Display.html?id=123955>
2316L<[perl #123995]|https://rt.perl.org/Ticket/Display.html?id=123995>
2317
2318=item *
2319
4ec8e6f0 2320C<split> in the scope of lexical C<$>_ has been fixed not to fail assertions.
eabfc7bc
RS
2321L<[perl #123763]|https://rt.perl.org/Ticket/Display.html?id=123763>
2322
2323=item *
2324
2325C<my $x : attr> syntax inside various list operators no longer fails
2326assertions.
2327L<[perl #123817]|https://rt.perl.org/Ticket/Display.html?id=123817>
2328
2329=item *
2330
4ec8e6f0
KW
2331An C<@> sign in quotes followed by a non-ASCII digit (which is not a valid
2332identifier) would cause the parser to crash, instead of simply trying the C<@> as
eabfc7bc
RS
2333literal. This has been fixed.
2334L<[perl #123963]|https://rt.perl.org/Ticket/Display.html?id=123963>
2335
2336=item *
2337
2338C<*bar::=*foo::=*glob_with_hash> has been crashing since Perl 5.14, but no
2339longer does.
2340L<[perl #123847]|https://rt.perl.org/Ticket/Display.html?id=123847>
2341
2342=item *
2343
2344C<foreach> in scalar context was not pushing an item on to the stack, resulting
4ec8e6f0 2345in bugs. (S<C<print 4, scalar do { foreach(@x){} } + 1>> would print 5.) It has
eabfc7bc
RS
2346been fixed to return C<undef>.
2347L<[perl #124004]|https://rt.perl.org/Ticket/Display.html?id=124004>
2348
2349=item *
2350
eabfc7bc
RS
2351A regression in the behaviour of the C<readline> built-in function, caused by
2352the introduction of the C<< <<>> >> operator, has been fixed.
2353L<[perl #123990]|https://rt.perl.org/Ticket/Display.html?id=123990>
2354
2355=item *
2356
2357Several cases of data used to store environment variable contents in core C
2358code being potentially overwritten before being used have been fixed.
2359L<[perl #123748]|https://rt.perl.org/Ticket/Display.html?id=123748>
2360
2361=item *
2362
a75e6a3a
SH
2363Patterns starting with C</.*/> are now fast again.
2364L<[perl #123743]|https://rt.perl.org/Ticket/Display.html?id=123743>.
eabfc7bc
RS
2365
2366=item *
2367
2368The original visible value of C<$/> is now preserved when it is set to
2369an invalid value. Previously if you set C<$/> to a reference to an
2370array, for example, perl would produce a runtime error and not set
2371C<PL_rs>, but perl code that checked C<$/> would see the array
a75e6a3a
SH
2372reference.
2373L<[perl #123218]|https://rt.perl.org/Ticket/Display.html?id=123218>.
eabfc7bc
RS
2374
2375=item *
2376
2377In a regular expression pattern, a POSIX class, like C<[:ascii:]>, must
93780ae6 2378be inside a bracketed character class, like C<qr/[[:ascii:]]/>. A
eabfc7bc
RS
2379warning is issued when something looking like a POSIX class is not
2380inside a bracketed class. That warning wasn't getting generated when
2381the POSIX class was negated: C<[:^ascii:]>. This is now fixed.
2382
2383=item *
2384
93780ae6 2385Fix a couple of size calculation overflows.
a75e6a3a 2386L<[perl #123554]|https://rt.perl.org/Ticket/Display.html?id=123554>.
eabfc7bc
RS
2387
2388=item *
2389
eabfc7bc 2390Perl 5.14.0 introduced a bug whereby C<eval { LABEL: }> would crash. This
a75e6a3a
SH
2391has been fixed.
2392L<[perl #123652]|https://rt.perl.org/Ticket/Display.html?id=123652>.
eabfc7bc
RS
2393
2394=item *
2395
2396Various crashes due to the parser getting confused by syntax errors have
a75e6a3a
SH
2397been fixed.
2398L<[perl #123617]|https://rt.perl.org/Ticket/Display.html?id=123617>.
2399L<[perl #123737]|https://rt.perl.org/Ticket/Display.html?id=123737>.
2400L<[perl #123753]|https://rt.perl.org/Ticket/Display.html?id=123753>.
2401L<[perl #123677]|https://rt.perl.org/Ticket/Display.html?id=123677>.
eabfc7bc
RS
2402
2403=item *
2404
2405Code like C</$a[/> used to read the next line of input and treat it as
2406though it came immediately after the opening bracket. Some invalid code
2407consequently would parse and run, but some code caused crashes, so this is
a75e6a3a
SH
2408now disallowed.
2409L<[perl #123712]|https://rt.perl.org/Ticket/Display.html?id=123712>.
eabfc7bc
RS
2410
2411=item *
2412
a75e6a3a
SH
2413Fix argument underflow for C<pack>.
2414L<[perl #123874]|https://rt.perl.org/Ticket/Display.html?id=123874>.
eabfc7bc
RS
2415
2416=item *
2417
2418Fix handling of non-strict C<\x{}>. Now C<\x{}> is equivalent to C<\x{0}>
2419instead of faulting.
2420
2421=item *
2422
2423C<stat -t> is now no longer treated as stackable, just like C<-t stat>.
a75e6a3a 2424L<[perl #123816]|https://rt.perl.org/Ticket/Display.html?id=123816>.
eabfc7bc
RS
2425
2426=item *
2427
2428The following no longer causes a SEGV: C<qr{x+(y(?0))*}>.
2429
2430=item *
2431
2432Fixed infinite loop in parsing backrefs in regexp patterns.
2433
2434=item *
2435
2436Several minor bug fixes in behavior of Inf and NaN, including
2437warnings when stringifying Inf-like or NaN-like strings. For example,
2438"NaNcy" doesn't numify to NaN anymore.
2439
2440=item *
2441
a75e6a3a
SH
2442Only stringy classnames are now shared. This fixes some failures in L<autobox>.
2443L<[perl #100819]|https://rt.cpan.org/Ticket/Display.html?id=100819>.
eabfc7bc
RS
2444
2445=item *
2446
2447A bug in regular expression patterns that could lead to segfaults and
2448other crashes has been fixed. This occurred only in patterns compiled
2449with C<"/i">, while taking into account the current POSIX locale (this usually
2450means they have to be compiled within the scope of C<S<"use locale">>),
2451and there must be a string of at least 128 consecutive bytes to match.
a75e6a3a 2452L<[perl #123539]|https://rt.perl.org/Ticket/Display.html?id=123539>.
eabfc7bc
RS
2453
2454=item *
2455
2456C<s///> now works on very long strings instead of dying with 'Substitution
a75e6a3a
SH
2457loop'.
2458L<[perl #103260]|https://rt.perl.org/Ticket/Display.html?id=103260>.
2459L<[perl #123071]|https://rt.perl.org/Ticket/Display.html?id=123071>.
eabfc7bc
RS
2460
2461=item *
2462
a75e6a3a
SH
2463C<gmtime> no longer crashes with not-a-number values.
2464L<[perl #123495]|https://rt.perl.org/Ticket/Display.html?id=123495>.
eabfc7bc
RS
2465
2466=item *
2467
4ec8e6f0 2468C<\()> (reference to an empty list) and C<y///> with lexical C<$_> in scope
eabfc7bc
RS
2469could do a bad write past the end of the stack. They have been fixed
2470to extend the stack first.
2471
2472=item *
2473
2474C<prototype()> with no arguments used to read the previous item on the
2475stack, so C<print "foo", prototype()> would print foo's prototype. It has
4ec8e6f0 2476been fixed to infer C<$_> instead.
a75e6a3a 2477L<[perl #123514]|https://rt.perl.org/Ticket/Display.html?id=123514>.
eabfc7bc
RS
2478
2479=item *
2480
2481Some cases of lexical state subs inside predeclared subs could crash but no
2482longer do.
2483
2484=item *
2485
2486Some cases of nested lexical state subs inside anonymous subs could cause
2487'Bizarre copy' errors or possibly even crash.
2488
2489=item *
2490
2491When trying to emit warnings, perl's default debugger (F<perl5db.pl>) was
2492sometimes giving 'Undefined subroutine &DB::db_warn called' instead. This
a75e6a3a
SH
2493bug, which started to occur in Perl 5.18, has been fixed.
2494L<[perl #123553]|https://rt.perl.org/Ticket/Display.html?id=123553>.
eabfc7bc
RS
2495
2496=item *
2497
2498Certain syntax errors in substitutions, such as C<< s/${E<lt>E<gt>{})// >>, would
2499crash, and had done so since Perl 5.10. (In some cases the crash did not
2500start happening till 5.16.) The crash has, of course, been fixed.
a75e6a3a 2501L<[perl #123542]|https://rt.perl.org/Ticket/Display.html?id=123542>.
eabfc7bc
RS
2502
2503=item *
2504
2505A repeat expression like C<33 x ~3> could cause a large buffer
2506overflow since the new output buffer size was not correctly handled by
2507SvGROW(). An expression like this now properly produces a memory wrap
a75e6a3a
SH
2508panic.
2509L<[perl #123554]|https://rt.perl.org/Ticket/Display.html?id=123554>.
eabfc7bc
RS
2510
2511=item *
2512
2513C<< formline("@...", "a"); >> would crash. The C<FF_CHECKNL> case in
2514pp_formline() didn't set the pointer used to mark the chop position,
2515which led to the C<FF_MORE> case crashing with a segmentation fault.
a75e6a3a
SH
2516This has been fixed.
2517L<[perl #123538]|https://rt.perl.org/Ticket/Display.html?id=123538>.
eabfc7bc
RS
2518
2519=item *
2520
2521A possible buffer overrun and crash when parsing a literal pattern during
a75e6a3a
SH
2522regular expression compilation has been fixed.
2523L<[perl #123604]|https://rt.perl.org/Ticket/Display.html?id=123604>.
eabfc7bc
RS
2524
2525=item *
2526
4ec8e6f0 2527C<fchmod()> and C<futimes()> now set C<$!> when they fail due to being
a75e6a3a
SH
2528passed a closed file handle.
2529L<[perl #122703]|https://rt.perl.org/Ticket/Display.html?id=122703>.
eabfc7bc
RS
2530
2531=item *
2532
eabfc7bc 2533op_free() no longer crashes due to a stack overflow when freeing a
a75e6a3a
SH
2534deeply recursive op tree.
2535L<[perl #108276]|https://rt.perl.org/Ticket/Display.html?id=108276>.
eabfc7bc
RS
2536
2537=item *
2538
2539scalarvoid() would crash due to a stack overflow when processing a
a75e6a3a
SH
2540deeply recursive op tree.
2541L<[perl #108276]|https://rt.perl.org/Ticket/Display.html?id=108276>.
eabfc7bc
RS
2542
2543=item *
2544
2545In Perl 5.20.0, C<$^N> accidentally had the internal UTF8 flag turned off
2546if accessed from a code block within a regular expression, effectively
a75e6a3a
SH
2547UTF8-encoding the value. This has been fixed.
2548L<[perl #123135]|https://rt.perl.org/Ticket/Display.html?id=123135>.
eabfc7bc
RS
2549
2550=item *
2551
2552A failed C<semctl> call no longer overwrites existing items on the stack,
2553causing C<(semctl(-1,0,0,0))[0]> to give an "uninitialized" warning.
2554
2555=item *
2556
2557C<else{foo()}> with no space before C<foo> is now better at assigning the
a75e6a3a
SH
2558right line number to that statement.
2559L<[perl #122695]|https://rt.perl.org/Ticket/Display.html?id=122695>.
eabfc7bc
RS
2560
2561=item *
2562
2563Sometimes the assignment in C<@array = split> gets optimised and C<split>
2564itself writes directly to the array. This caused a bug, preventing this
2565assignment from being used in lvalue context. So
2566C<(@a=split//,"foo")=bar()> was an error. (This bug probably goes back to
2567Perl 3, when the optimisation was added.) This optimisation, and the bug,
19c9b733 2568started to happen in more cases in XXX 5.21.5. It has now been fixed.
a75e6a3a 2569L<[perl #123057]|https://rt.perl.org/Ticket/Display.html?id=123057>.
eabfc7bc
RS
2570
2571=item *
2572
2573When argument lists that fail the checks installed by subroutine
2574signatures, the resulting error messages now give the file and line number
a75e6a3a
SH
2575of the caller, not of the called subroutine.
2576L<[perl #121374]|https://rt.perl.org/Ticket/Display.html?id=121374>.
eabfc7bc
RS
2577
2578=item *
2579
2580Flip-flop operators (C<..> and C<...> in scalar context) used to maintain
2581a separate state for each recursion level (the number of times the
2582enclosing sub was called recursively), contrary to the documentation. Now
a75e6a3a
SH
2583each closure has one internal state for each flip-flop.
2584L<[perl #122829]|https://rt.perl.org/Ticket/Display.html?id=122829>.
eabfc7bc
RS
2585
2586=item *
2587
2588C<use>, C<no>, statement labels, special blocks (C<BEGIN>) and pod are now
2589permitted as the first thing in a C<map> or C<grep> block, the block after
2590C<print> or C<say> (or other functions) returning a handle, and within
a75e6a3a
SH
2591C<${...}>, C<@{...}>, etc.
2592L<[perl #122782]|https://rt.perl.org/Ticket/Display.html?id=122782>.
eabfc7bc
RS
2593
2594=item *
2595
2596The repetition operator C<x> now propagates lvalue context to its left-hand
2597argument when used in contexts like C<foreach>. That allows
4ec8e6f0 2598S<C<for(($#that_array)x2) { ... }>> to work as expected if the loop modifies
eabfc7bc
RS
2599$_.
2600
2601=item *
2602
2603C<(...) x ...> in scalar context used to corrupt the stack if one operand
2604were an object with "x" overloading, causing erratic behaviour.
a75e6a3a 2605L<[perl #121827]|https://rt.perl.org/Ticket/Display.html?id=121827>.
eabfc7bc
RS
2606
2607=item *
2608
2609Assignment to a lexical scalar is often optimised away (as mentioned under
2610L</Performance Enhancements>). Various bugs related to this optimisation
2611have been fixed. Certain operators on the right-hand side would sometimes
2612fail to assign the value at all or assign the wrong value, or would call
2613STORE twice or not at all on tied variables. The operators affected were
2614C<$foo++>, C<$foo-->, and C<-$foo> under C<use integer>, C<chomp>, C<chr>
2615and C<setpgrp>.
2616
2617=item *
2618
2619List assignments were sometimes buggy if the same scalar ended up on both
2620sides of the assignment due to used of C<tied>, C<values> or C<each>. The
2621result would be the wrong value getting assigned.
2622
2623=item *
2624
2625C<setpgrp($nonzero)> (with one argument) was accidentally changed in 5.16
2626to mean C<setpgrp(0)>. This has been fixed.
2627
2628=item *
2629
2630C<__SUB__> could return the wrong value or even corrupt memory under the
4ec8e6f0 2631debugger (the C<-d> switch) and in subs containing C<eval $string>.
eabfc7bc
RS
2632
2633=item *
2634
4ec8e6f0 2635When S<C<sub () { $var }>> becomes inlinable, it now returns a different
eabfc7bc
RS
2636scalar each time, just as a non-inlinable sub would, though Perl still
2637optimises the copy away in cases where it would make no observable
2638difference.
2639
2640=item *
2641
4ec8e6f0 2642S<C<my sub f () { $var }>> and S<C<sub () : attr { $var }>> are no longer
eabfc7bc
RS
2643eligible for inlining. The former would crash; the latter would just
2644throw the attributes away. An exception is made for the little-known
2645":method" attribute, which does nothing much.
2646
2647=item *
2648
2649Inlining of subs with an empty prototype is now more consistent than
2650before. Previously, a sub with multiple statements, all but the last
2651optimised away, would be inlinable only if it were an anonymous sub
2652containing a string C<eval> or C<state> declaration or closing over an
2653outer lexical variable (or any anonymous sub under the debugger). Now any
2654sub that gets folded to a single constant after statements have been
2655optimised away is eligible for inlining. This applies to things like C<sub
2656() { jabber() if DEBUG; 42 }>.
2657
2658Some subroutines with an explicit C<return> were being made inlinable,
2659contrary to the documentation, Now C<return> always prevents inlining.
2660
2661=item *
2662
2663On some systems, such as VMS, C<crypt> can return a non-ASCII string. If a
2664scalar assigned to had contained a UTF8 string previously, then C<crypt>
2665would not turn off the UTF8 flag, thus corrupting the return value. This
2666would happen with C<$lexical = crypt ...>.
2667
2668=item *
2669
2670C<crypt> no longer calls C<FETCH> twice on a tied first argument.
2671
2672=item *
2673
2674An unterminated here-doc on the last line of a quote-like operator
2675(C<qq[${ <<END }]>, C</(?{ <<END })/>) no longer causes a double free. It
2676started doing so in 5.18.
2677
2678=item *
2679
2680Fixed two assertion failures introduced into C<-DPERL_OP_PARENT>
a75e6a3a
SH
2681builds.
2682L<[perl #108276]|https://rt.perl.org/Ticket/Display.html?id=108276>.
eabfc7bc
RS
2683
2684=item *
2685
4ec8e6f0 2686C<index()> and C<rindex()> no longer crash when used on strings over 2GB in
eabfc7bc
RS
2687size.
2688L<[perl #121562]|https://rt.perl.org/Ticket/Display.html?id=121562>.
2689
2690=item *
2691
2692A small previously intentional memory leak in PERL_SYS_INIT/PERL_SYS_INIT3 on
2693Win32 builds was fixed. This might affect embedders who repeatedly create and
2694destroy perl engines within the same process.
2695
2696=item *
2697
2698C<POSIX::localeconv()> now returns the data for the program's underlying
2699locale even when called from outside the scope of S<C<use locale>>.
2700
2701=item *
2702
2703C<POSIX::localeconv()> now works properly on platforms which don't have
2704C<LC_NUMERIC> and/or C<LC_MONETARY>, or for which Perl has been compiled
2705to disregard either or both of these locale categories. In such
2706circumstances, there are now no entries for the corresponding values in
2707the hash returned by C<localeconv()>.
2708
2709=item *
2710
2711C<POSIX::localeconv()> now marks appropriately the values it returns as
6a3ea89b 2712UTF-8 or not. Previously they were always returned as bytes, even if
eabfc7bc
RS
2713they were supposed to be encoded as UTF-8.
2714
2715=item *
2716
2717On Microsoft Windows, within the scope of C<S<use locale>>, the following
2718POSIX character classes gave results for many locales that did not
2719conform to the POSIX standard:
2720C<[[:alnum:]]>,
2721C<[[:alpha:]]>,
2722C<[[:blank:]]>,
2723C<[[:digit:]]>,
2724C<[[:graph:]]>,
2725C<[[:lower:]]>,
2726C<[[:print:]]>,
2727C<[[:punct:]]>,
2728C<[[:upper:]]>,
2729C<[[:word:]]>,
2730and
2731C<[[:xdigit:]]>.
f1c9eac6 2732This was because the underlying Microsoft implementation does not
eabfc7bc
RS
2733follow the standard. Perl now takes special precautions to correct for
2734this.
2735
2736=item *
2737
2738Many issues have been detected by L<Coverity|http://www.coverity.com/> and
2739fixed.
2740
2741=item *
2742
2743system() and friends should now work properly on more Android builds.
2744
4ec8e6f0 2745Due to an oversight, the value specified through C<-Dtargetsh> to F<Configure>
eabfc7bc 2746would end up being ignored by some of the build process. This caused perls
4ec8e6f0 2747cross-compiled for Android to end up with defective versions of C<system()>,
eabfc7bc
RS
2748exec() and backticks: the commands would end up looking for C</bin/sh>
2749instead of C</system/bin/sh>, and so would fail for the vast majority
2750of devices, leaving C<$!> as C<ENOENT>.
2751
2752=item *
2753
2754C<qr(...\(...\)...)>,
2755C<qr[...\[...\]...]>,
2756and
2757C<qr{...\{...\}...}>
2758now work. Previously it was impossible to escape these three
2759left-characters with a backslash within a regular expression pattern
2760where otherwise they would be considered metacharacters, and the pattern
2761opening delimiter was the character, and the closing delimiter was its
2762mirror character.
2763
2764=item *
2765
2766C<< s///e >> on tainted utf8 strings got C<< pos() >> messed up. This bug,
a75e6a3a
SH
2767introduced in 5.20, is now fixed.
2768L<[perl #122148]|https://rt.perl.org/Ticket/Display.html?id=122148>.
eabfc7bc
RS
2769
2770=item *
2771
2772A non-word boundary in a regular expression (C<< \B >>) did not always
2773match the end of the string; in particular C<< q{} =~ /\B/ >> did not
a75e6a3a
SH
2774match. This bug, introduced in perl 5.14, is now fixed.
2775L<[perl #122090]|https://rt.perl.org/Ticket/Display.html?id=122090>.
eabfc7bc
RS
2776
2777=item *
2778
2779C<< " P" =~ /(?=.*P)P/ >> should match, but did not. This is now fixed.
a75e6a3a 2780L<[perl #122171]|https://rt.perl.org/Ticket/Display.html?id=122171>.
eabfc7bc
RS
2781
2782=item *
2783
2784Failing to compile C<use Foo> in an eval could leave a spurious
2785C<BEGIN> subroutine definition, which would produce a "Subroutine
2786BEGIN redefined" warning on the next use of C<use>, or other C<BEGIN>
a75e6a3a
SH
2787block.
2788L<[perl #122107]|https://rt.perl.org/Ticket/Display.html?id=122107>.
eabfc7bc
RS
2789
2790=item *
2791
2792C<method { BLOCK } ARGS> syntax now correctly parses the arguments if they
a75e6a3a
SH
2793begin with an opening brace.
2794L<[perl #46947]|https://rt.perl.org/Ticket/Display.html?id=46947>.
eabfc7bc
RS
2795
2796=item *
2797
2798External libraries and Perl may have different ideas of what the locale is.
2799This is problematic when parsing version strings if the locale's numeric
2800separator has been changed. Version parsing has been patched to ensure
a75e6a3a
SH
2801it handles the locales correctly.
2802L<[perl #121930]|https://rt.perl.org/Ticket/Display.html?id=121930>.
eabfc7bc
RS
2803
2804=item *
2805
2806A bug has been fixed where zero-length assertions and code blocks inside of a
a75e6a3a
SH
2807regex could cause C<pos> to see an incorrect value.
2808L<[perl #122460]|https://rt.perl.org/Ticket/Display.html?id=122460>.
eabfc7bc
RS
2809
2810=item *
2811
2812Constant dereferencing now works correctly for typeglob constants. Previously
2813the glob was stringified and its name looked up. Now the glob itself is used.
2814L<[perl #69456]|https://rt.perl.org/Ticket/Display.html?id=69456>
2815
2816=item *
2817
4ec8e6f0
KW
2818When parsing a funny character (C<$> C<@> C<%> C<&)> followed by braces,
2819the parser no
eabfc7bc
RS
2820longer tries to guess whether it is a block or a hash constructor (causing a
2821syntax error when it guesses the latter), since it can only be a block.
2822
2823=item *
2824
4ec8e6f0 2825S<C<undef $reference>> now frees the referent immediately, instead of hanging on
eabfc7bc
RS
2826to it until the next statement.
2827L<[perl #122556]|https://rt.perl.org/Ticket/Display.html?id=122556>
2828
2829=item *
2830
2831Various cases where the name of a sub is used (autoload, overloading, error
2832messages) used to crash for lexical subs, but have been fixed.
2833
2834=item *
2835
2836Bareword lookup now tries to avoid vivifying packages if it turns out the
2837bareword is not going to be a subroutine name.
2838
2839=item *
2840
2841Compilation of anonymous constants (e.g., C<sub () { 3 }>) no longer deletes
2842any subroutine named C<__ANON__> in the current package. Not only was
2843C<*__ANON__{CODE}> cleared, but there was a memory leak, too. This bug goes
2844back to Perl 5.8.0.
2845
2846=item *
2847
2848Stub declarations like C<sub f;> and C<sub f ();> no longer wipe out constants
2849of the same name declared by C<use constant>. This bug was introduced in Perl
28505.10.0.
2851
2852=item *
2853
eabfc7bc
RS
2854C<qr/[\N{named sequence}]/> now works properly in many instances. Some names
2855known to C<\N{...}> refer to a sequence of multiple characters, instead of the
2856usual single character. Bracketed character classes generally only match
2857single characters, but now special handling has been added so that they can
2858match named sequences, but not if the class is inverted or the sequence is
2859specified as the beginning or end of a range. In these cases, the only
2860behavior change from before is a slight rewording of the fatal error message
2861given when this class is part of a C<?[...])> construct. When the C<[...]>
2862stands alone, the same non-fatal warning as before is raised, and only the
2863first character in the sequence is used, again just as before.
2864
2865=item *
2866
2867Tainted constants evaluated at compile time no longer cause unrelated
2868statements to become tainted.
2869L<[perl #122669]|https://rt.perl.org/Ticket/Display.html?id=122669>
2870
2871=item *
2872
4ec8e6f0 2873S<C<open $$fh, ...>>, which vivifies a handle with a name like C<"main::_GEN_0">, was
eabfc7bc
RS
2874not giving the handle the right reference count, so a double free could happen.
2875
2876=item *
2877
2878When deciding that a bareword was a method name, the parser would get confused
4ec8e6f0
KW
2879if an C<our> sub with the same name existed, and look up the method in the
2880package of the C<our> sub, instead of the package of the invocant.
eabfc7bc
RS
2881
2882=item *
2883
2884The parser no longer gets confused by C<\U=> within a double-quoted string. It
2885used to produce a syntax error, but now compiles it correctly.
2886L<[perl #80368]|https://rt.perl.org/Ticket/Display.html?id=80368>
2887
2888=item *
2889
2890It has always been the intention for the C<-B> and C<-T> file test operators to
2891treat UTF-8 encoded files as text. (L<perlfunc|perlfunc/-X FILEHANDLE> has
2892been updated to say this.) Previously, it was possible for some files to be
2893considered UTF-8 that actually weren't valid UTF-8. This is now fixed. The
2894operators now work on EBCDIC platforms as well.
2895
2896=item *
2897
2898Under some conditions warning messages raised during regular expression pattern
2899compilation were being output more than once. This has now been fixed.
2900
2901=item *
2902
2903A regression has been fixed that was introduced in Perl 5.20.0 (fixed in Perl
29045.20.1 as well as here) in which a UTF-8 encoded regular expression pattern
2905that contains a single ASCII lowercase letter does not match its uppercase
2906counterpart.
2907L<[perl #122655]|https://rt.perl.org/Ticket/Display.html?id=122655>
2908
2909=item *
2910
2911Constant folding could incorrectly suppress warnings if lexical warnings (C<use
2912warnings> or C<no warnings>) were not in effect and C<$^W> were false at
2913compile time and true at run time.
2914
2915=item *
2916
2917Loading UTF8 tables during a regular expression match could cause assertion
2918failures under debugging builds if the previous match used the very same
2919regular expression.
2920L<[perl #122747]|https://rt.perl.org/Ticket/Display.html?id=122747>
2921
2922=item *
2923
2924Thread cloning used to work incorrectly for lexical subs, possibly causing
2925crashes or double frees on exit.
2926
2927=item *
2928
2929Since Perl 5.14.0, deleting C<$SomePackage::{__ANON__}> and then undefining an
2930anonymous subroutine could corrupt things internally, resulting in
2931L<Devel::Peek> crashing or L<B.pm|B> giving nonsensical data. This has been
2932fixed.
2933
2934=item *
2935
4ec8e6f0
KW
2936S<C<(caller $n)[3]>> now reports names of lexical subs, instead of treating them
2937as C<"(unknown)">.
eabfc7bc
RS
2938
2939=item *
2940
2941C<sort subname LIST> now supports lexical subs for the comparison routine.
2942
2943=item *
2944
2945Aliasing (e.g., via C<*x = *y>) could confuse list assignments that mention the
2946two names for the same variable on either side, causing wrong values to be
2947assigned.
2948L<[perl #15667]|https://rt.perl.org/Ticket/Display.html?id=15667>
2949
2950=item *
2951
2952Long here-doc terminators could cause a bad read on short lines of input. This
2953has been fixed. It is doubtful that any crash could have occurred. This bug
2954goes back to when here-docs were introduced in Perl 3.000 twenty-five years
2955ago.
2956
2957=item *
2958
2959An optimization in C<split> to treat C<split/^/> like C<split/^/m> had the
2960unfortunate side-effect of also treating C<split/\A/> like C<split/^/m>, which
2961it should not. This has been fixed. (Note, however, that C<split/^x/> does
2962not behave like C<split/^x/m>, which is also considered to be a bug and will be
2963fixed in a future version.)
2964L<[perl #122761]|https://rt.perl.org/Ticket/Display.html?id=122761>
2965
2966=item *
2967
4ec8e6f0 2968The little-known S<C<my Class $var>> syntax (see L<fields> and L<attributes>)
eabfc7bc
RS
2969could get confused in the scope of C<use utf8> if C<Class> were a constant
2970whose value contained Latin-1 characters.
2971
2972=item *
2973
2974Locking and unlocking values via L<Hash::Util> or C<Internals::SvREADONLY>
2975no longer has any effect on values that are read-only to begin.
2976Previously, unlocking such values could result in crashes, hangs or
2977other erratic behaviour.
2978
2979=item *
2980
eabfc7bc
RS
2981The flip-flop operator (C<..> in scalar context) would return the same
2982scalar each time, unless the containing subroutine was called recursively.
a75e6a3a
SH
2983Now it always returns a new scalar.
2984L<[perl #122829]|https://rt.perl.org/Ticket/Display.html?id=122829>.
eabfc7bc
RS
2985
2986=item *
2987
2988Some unterminated C<(?(...)...)> constructs in regular expressions would
2989either crash or give erroneous error messages. C</(?(1)/> is one such
2990example.
2991
2992=item *
2993
4ec8e6f0 2994S<C<pack "w", $tied>> no longer calls FETCH twice.
eabfc7bc
RS
2995
2996=item *
2997
4ec8e6f0
KW
2998List assignments like S<C<($x, $z) = (1, $y)>> now work correctly if C<$x> and
2999C<$y> have been aliased by C<foreach>.
eabfc7bc
RS
3000
3001=item *
3002
3003Some patterns including code blocks with syntax errors, such as
3004C</ (?{(^{})/>, would hang or fail assertions on debugging builds. Now
3005they produce errors.
3006
3007=item *
3008
3009An assertion failure when parsing C<sort> with debugging enabled has been
a75e6a3a
SH
3010fixed.
3011L<[perl #122771]|https://rt.perl.org/Ticket/Display.html?id=122771>.
eabfc7bc
RS
3012
3013=item *
3014
4ec8e6f0 3015S<C<*a = *b; @a = split //, $b[1]>> could do a bad read and produce junk
eabfc7bc
RS
3016results.
3017
3018=item *
3019
4ec8e6f0 3020In S<C<() = @array = split>>, the S<C<() =>> at the beginning no longer confuses
eabfc7bc
RS
3021the optimizer, making it assume a limit of 1.
3022
3023=item *
3024
3025Fatal warnings no longer prevent the output of syntax errors.
a75e6a3a 3026L<[perl #122966]|https://rt.perl.org/Ticket/Display.html?id=122966>.
eabfc7bc
RS
3027
3028=item *
3029
3030Fixed a NaN double to long double conversion error on VMS. For quiet NaNs
3031(and only on Itanium, not Alpha) negative infinity instead of NaN was
3032produced.
3033
3034=item *
3035
3036Fixed the issue that caused C<< make distclean >> to leave files behind
a75e6a3a
SH
3037that shouldn't.
3038L<[perl #122820]|https://rt.perl.org/Ticket/Display.html?id=122820>.
eabfc7bc
RS
3039
3040=item *
3041
a75e6a3a
SH
3042AIX now sets the length in C<< getsockopt >> correctly.
3043L<[perl #120835]|https://rt.perl.org/Ticket/Display.html?id=120835>.
3044L<[cpan #91183]|https://rt.cpan.org/Ticket/Display.html?id=91183>.
3045L<[cpan #85570]|https://rt.cpan.org/Ticket/Display.html?id=85570>.
eabfc7bc
RS
3046
3047=item *
3048
3049During the pattern optimization phase, we no longer recurse into
4ec8e6f0 3050C<GOSUB>/C<GOSTART> when not C<SCF_DO_SUBSTR>. This prevents the optimizer
a75e6a3a
SH
3051to run "forever" and exhaust all memory.
3052L<[perl #122283]|https://rt.perl.org/Ticket/Display.html?id=122283>.
eabfc7bc
RS
3053
3054=item *
3055
3056F<< t/op/crypt.t >> now performs SHA-256 algorithm if the default one
a75e6a3a
SH
3057is disabled.
3058L<[perl #121591]|https://rt.perl.org/Ticket/Display.html?id=121591>.
eabfc7bc
RS
3059
3060=item *
3061
3062Fixed an off-by-one error when setting the size of shared array.
a75e6a3a 3063L<[perl #122950]|https://rt.perl.org/Ticket/Display.html?id=122950>.
eabfc7bc
RS
3064
3065=item *
3066
3067Fixed a bug that could cause perl to execute an infinite loop during
a75e6a3a
SH
3068compilation.
3069L<[perl #122995]|https://rt.perl.org/Ticket/Display.html?id=122995>.
eabfc7bc
RS
3070
3071=item *
3072
3073On Win32, restoring in a child pseudo-process a variable that was
3074C<local()>ed in a parent pseudo-process before the C<fork> happened caused
3075memory corruption and a crash in the child pseudo-process (and therefore OS
a75e6a3a
SH
3076process).
3077L<[perl #40565]|https://rt.perl.org/Ticket/Display.html?id=40565>.
eabfc7bc
RS
3078
3079=item *
3080
3081Calling C<write> on a format with a C<^**> field could produce a panic
4ec8e6f0 3082in C<sv_chop()> if there were insufficient arguments or if the variable
a75e6a3a
SH
3083used to fill the field was empty.
3084L<[perl #123245]|https://rt.perl.org/Ticket/Display.html?id=123245>.
eabfc7bc
RS
3085
3086=item *
3087
3088Non-ASCII lexical sub names (use in error messages) on longer have extra
3089junk on the end.
3090
3091=item *
3092
3093The C<\@> subroutine prototype no longer flattens parenthesized arrays
3094(taking a reference to each element), but takes a reference to the array
a75e6a3a
SH
3095itself.
3096L<[perl #47363]|https://rt.perl.org/Ticket/Display.html?id=47363>.
eabfc7bc
RS
3097
3098=item *
3099
3100A block containing nothing except a C-style C<for> loop could corrupt the
3101stack, causing lists outside the block to lose elements or have elements
3102overwritten. This could happen with C<map { for(...){...} } ...> and with
a75e6a3a
SH
3103lists containing C<do { for(...){...} }>.
3104L<[perl #123286]|https://rt.perl.org/Ticket/Display.html?id=123286>.
eabfc7bc
RS
3105
3106=item *
3107
3108C<scalar()> now propagates lvalue context, so that
4ec8e6f0 3109S<C<for(scalar($#foo)) { ... }>> can modify C<$#foo> through C<$_>.
eabfc7bc
RS
3110
3111=item *
3112
3113C<qr/@array(?{block})/> no longer dies with "Bizarre copy of ARRAY".
a75e6a3a 3114L<[perl #123344]|https://rt.perl.org/Ticket/Display.html?id=123344>.
eabfc7bc
RS
3115
3116=item *
3117
4ec8e6f0 3118S<C<eval '$variable'>> in nested named subroutines would sometimes look up a
eabfc7bc
RS
3119global variable even with a lexical variable in scope.
3120
3121=item *
3122
3123In perl 5.20.0, C<sort CORE::fake> where 'fake' is anything other than a
3124keyword started chopping of the last 6 characters and treating the result
3125as a sort sub name. The previous behaviour of treating "CORE::fake" as a
a75e6a3a
SH
3126sort sub name has been restored.
3127L<[perl #123410]|https://rt.perl.org/Ticket/Display.html?id=123410>.
eabfc7bc
RS
3128
3129=item *
3130
3131Outside of C<use utf8>, a single-character Latin-1 lexical variable is
4ec8e6f0 3132disallowed. The error message for it, "Can't use global C<$foo>...", was
eabfc7bc
RS
3133giving garbage instead of the variable name.
3134
3135=item *
3136
3137C<readline> on a nonexistent handle was causing C<${^LAST_FH}> to produce a
3138reference to an undefined scalar (or fail an assertion). Now
3139C<${^LAST_FH}> ends up undefined.
3140
3141=item *
3142
3143C<(...)x...> in void context now applies scalar context to the left-hand
3144argument, instead of the context the current sub was called in.
a75e6a3a 3145L<[perl #123020]|https://rt.perl.org/Ticket/Display.html?id=123020>.
eabfc7bc
RS
3146
3147=back
3148
3149=head1 Known Problems
3150
3151=over 4
3152
3153=item *
3154
3155A goal is for Perl to be able to be recompiled to work reasonably well on any
3156Unicode version. In Perl 5.22, though, the earliest such version is Unicode
31575.1 (current is 7.0).
3158
3159=item *
3160
3161EBCDIC platforms
3162
3163=over 4
3164
3165=item *
3166
ce93e38b
KW
3167The C<cmp> (and hence C<sort>) operators do not necessarily give the
3168correct results when both operands are UTF-EBCDIC encoded strings and
3169there is a mixture of ASCII and/or control characters, along with other
3170characters.
3171
3172=item *
3173
3174Ranges containing C<\N{...}> in the C<tr///> (and C<y///>)
3175transliteration operators are treated differently than the equivalent
3176ranges in regular expression pattersn. They should, but don't, cause
3177the values in the ranges to all be treated as Unicode code points, and
3178not native ones. (L<perlre/Version 8 Regular Expressions> gives
3179details as to how it should work.)
3180
3181=item *
3182
eabfc7bc
RS
3183Encode and encoding are mostly broken.
3184
3185=item *
3186
0590bd99 3187Many CPAN modules that are shipped with core show failing tests.
eabfc7bc
RS
3188
3189=item *
3190
3191C<pack>/C<unpack> with C<"U0"> format may not work properly.
3192
3193=back
3194
3195=item *
3196
3197The following modules are known to have test failures with this version of
3198Perl. Patches have been submitted, so there will hopefully be new releases
3199soon:
3200
3201=over
3202
3203=item *
3204
3205L<B::Generate> version 1.50
3206
3207=item *
3208
3209L<B::Utils> version 0.25
3210
3211=item *
3212
3213L<Dancer> version 1.3130
3214
3215=item *
3216
3217L<Data::Alias> version 1.18
3218
3219=item *
3220
3221L<Data::Util> version 0.63
3222
3223=item *
3224
ba520a57
RS
3225L<Devel::Spy> version 0.07
3226
3227=item *
3228
2621aeba
RS
3229L<invoker> version 0.34
3230
3231=item *
3232
eabfc7bc
RS
3233L<Lexical::Var> version 0.009
3234
3235=item *
3236
3237L<Mason> version 2.22
3238
3239=item *
3240
6be597e7
RS
3241L<NgxQueue> version 0.02
3242
3243=item *
3244
eabfc7bc
RS
3245L<Padre> version 1.00
3246
3247=item *
3248
3249L<Parse::Keyword> 0.08
3250
3251=back
3252
3253=back
2a7a05b4 3254
30aa8e3f
AC
3255=head1 Obituary
3256
3257Brian McCauley died on May 8, 2015. He was a frequent poster to Usenet, Perl
3258Monks, and other Perl forums, and made several CPAN contributions under the
3259nick NOBULL, including to the Perl FAQ. He attended almost every
3260YAPC::Europe, and indeed, helped organise YAPC::Europe 2006 and the QA
3261Hackathon 2009. His wit and his delight in intricate systems were
3262particularly apparent in his love of board games; many Perl mongers will
3263have fond memories of playing Fluxx and other games with Brian. He will be
3264missed.
3265
7f9fef93 3266=head1 Acknowledgements
2a7a05b4 3267
7f9fef93 3268XXX Generate this with:
2a7a05b4 3269
eabfc7bc 3270 perl Porting/acknowledgements.pl v5.20.0..HEAD
f5b73711 3271
44691e6f
AB
3272=head1 Reporting Bugs
3273
e08634c5
SH
3274If you find what you think is a bug, you might check the articles recently
3275posted to the comp.lang.perl.misc newsgroup and the perl bug database at
e5998677
SH
3276https://rt.perl.org/ . There may also be information at
3277http://www.perl.org/ , the Perl Home Page.
44691e6f 3278
e08634c5
SH
3279If you believe you have an unreported bug, please run the L<perlbug> program
3280included with your release. Be sure to trim your bug down to a tiny but
3281sufficient test case. Your bug report, along with the output of C<perl -V>,
3282will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
44691e6f
AB
3283
3284If the bug you are reporting has security implications, which make it
e08634c5
SH
3285inappropriate to send to a publicly archived mailing list, then please send it
3286to perl5-security-report@perl.org. This points to a closed subscription
3287unarchived mailing list, which includes all the core committers, who will be
3288able to help assess the impact of issues, figure out a resolution, and help
f9001595 3289co-ordinate the release of patches to mitigate or fix the problem across all
e08634c5
SH
3290platforms on which Perl is supported. Please only use this address for
3291security issues in the Perl core, not for modules independently distributed on
3292CPAN.
44691e6f
AB
3293
3294=head1 SEE ALSO
3295
e08634c5
SH
3296The F<Changes> file for an explanation of how to view exhaustive details on
3297what changed.
44691e6f
AB
3298
3299The F<INSTALL> file for how to build Perl.
3300
3301The F<README> file for general stuff.
3302
3303The F<Artistic> and F<Copying> files for copyright information.
3304
3305=cut