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