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