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