This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta: Add some details for Module changes
[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
50ea4745 119=head2 Better heuristics on older platforms for determining locale UTF-8ness
eabfc7bc
RS
120
121On platforms that implement neither the C99 standard nor the POSIX 2001
50ea4745 122standard, determining if the current locale is UTF-8 or not depends on
eabfc7bc
RS
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
3209f716
KW
138This feature is experimental and must be enabled via S<C<use feature
139'refaliasing'>>. It will warn unless the C<experimental::refaliasing>
eabfc7bc
RS
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
dfd03a6a
DIM
197propagate the value in computations, and on output normalize them to the strings
198C<Inf>, C<-Inf>, and 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
3209f716 208S<C<printf "%a">>. See L<perldata/Scalar value constructors> for more
d140c31c 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
3209f716 295of C<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
3209f716 300E.g. S<C<\N{TOOE<nbsp>E<nbsp>MANY SPACES}>> or S<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
d1197d77 313=head2 Splitting the tokens C<(?> and C<(*> in regular expressions is now a fatal compilation error.
eabfc7bc
RS
314
315These had been deprecated since v5.18.
316
43831b1f
DM
317=head2 C<qr/foo/x> now ignores all Unicode pattern white space
318
319The C</x> regular expression modifier allows the pattern to contain
320white space and comments (both of which are ignored) for improved
321readability. Until now, not all the white space characters that Unicode
322designates for this purpose were handled. The additional ones now
323recognized are
324
325 U+0085 NEXT LINE
326 U+200E LEFT-TO-RIGHT MARK
327 U+200F RIGHT-TO-LEFT MARK
328 U+2028 LINE SEPARATOR
329 U+2029 PARAGRAPH SEPARATOR
eabfc7bc
RS
330
331The use of these characters with C</x> outside bracketed character
332classes and when not preceded by a backslash has raised a deprecation
43831b1f 333warning since v5.18. Now they will be ignored.
eabfc7bc 334
43831b1f 335=head2 Comment lines within S<C<(?[ ])>> are now ended only by a C<\n>
eabfc7bc
RS
336
337S<C<(?[ ])>> is an experimental feature, introduced in v5.18. It operates
43831b1f 338as if C</x> is always enabled. But there was a difference: comment
eabfc7bc
RS
339lines (following a C<#> character) were terminated by anything matching
340C<\R> which includes all vertical whitespace, such as form feeds. For
341consistency, this is now changed to match what terminates comment lines
342outside S<C<(?[ ])>>, namely a C<\n> (even if escaped), which is the
343same as what terminates a heredoc string and formats.
344
345=head2 C<(?[...])> operators now follow standard Perl precedence
346
347This experimental feature allows set operations in regular expression patterns.
348Prior to this, the intersection operator had the same precedence as the other
349binary operators. Now it has higher precedence. This could lead to different
350outcomes than existing code expects (though the documentation has always noted
351that this change might happen, recommending fully parenthesizing the
352expressions). See L<perlrecharclass/Extended Bracketed Character Classes>.
353
4ec8e6f0 354=head2 Omitting C<%> and C<@> on hash and array names is no longer permitted
c14a43b7 355
4ec8e6f0 356Really old Perl let you omit the C<@> on array names and the C<%> on hash
eabfc7bc 357names in some spots. This has issued a deprecation warning since Perl
93780ae6 3585.000, and is no longer permitted.
c14a43b7 359
d140c31c 360=head2 C<"$!"> text is now in English outside the scope of C<use locale>
eabfc7bc
RS
361
362Previously, the text, unlike almost everything else, always came out
363based on the current underlying locale of the program. (Also affected
d140c31c
AC
364on some systems is C<"$^E">.) For programs that are unprepared to
365handle locale differences, this can cause garbage text to be displayed.
366It's better to display text that is translatable via some tool than
367garbage text which is much harder to figure out.
eabfc7bc
RS
368
369=head2 C<"$!"> text will be returned in UTF-8 when appropriate
370
371The stringification of C<$!> and C<$^E> will have the UTF-8 flag set
372when the text is actually non-ASCII UTF-8. This will enable programs
373that are set up to be locale-aware to properly output messages in the
374user's native language. Code that needs to continue the 5.20 and
375earlier behavior can do the stringification within the scopes of both
3b50e657
KW
376S<C<use bytes>> and S<C<use locale ":messages">>. Within these two
377scopes, no other Perl operations will
eabfc7bc 378be affected by locale; only C<$!> and C<$^E> stringification. The
d140c31c 379C<bytes> pragma causes the UTF-8 flag to not be set, just as in previous
a75e6a3a
SH
380Perl releases. This resolves
381L<[perl #112208]|https://rt.perl.org/Ticket/Display.html?id=112208>.
eabfc7bc
RS
382
383=head2 Support for C<?PATTERN?> without explicit operator has been removed
384
d140c31c
AC
385The C<m?PATTERN?> construct, which allows matching a regex only once,
386previously had an alternative form that was written directly with a question
387mark delimiter, omitting the explicit C<m> operator. This usage has produced
388a deprecation warning since 5.14.0. It is now a syntax error, so that the
389question mark can be available for use in new operators.
eabfc7bc
RS
390
391=head2 C<defined(@array)> and C<defined(%hash)> are now fatal errors
392
393These have been deprecated since v5.6.1 and have raised deprecation
394warnings since v5.16.
395
01842271 396=head2 Using a hash or an array as a reference are now fatal errors
eabfc7bc 397
43831b1f 398For example, C<< %foo->{"bar"} >> now causes a fatal compilation
eabfc7bc
RS
399error. These have been deprecated since before v5.8, and have raised
400deprecation warnings since then.
401
402=head2 Changes to the C<*> prototype
403
404The C<*> character in a subroutine's prototype used to allow barewords to take
43831b1f
DM
405precedence over most, but not all, subroutine names. It was never
406consistent and exhibited buggy behaviour.
eabfc7bc
RS
407
408Now it has been changed, so subroutines always take precedence over barewords,
409which brings it into conformity with similarly prototyped built-in functions:
410
411 sub splat(*) { ... }
412 sub foo { ... }
413 splat(foo); # now always splat(foo())
414 splat(bar); # still splat('bar') as before
415 close(foo); # close(foo())
416 close(bar); # close('bar')
c14a43b7 417
7f9fef93 418=head1 Deprecations
47cb8ddb 419
eabfc7bc 420=head2 Setting C<${^ENCODING}> to anything but C<undef>
c14a43b7 421
d140c31c
AC
422This variable allows Perl scripts to be written in an encoding other than
423ASCII or UTF-8. However, it affects all modules globally, leading
eabfc7bc
RS
424to wrong answers and segmentation faults. New scripts should be written
425in UTF-8; old scripts should be converted to UTF-8, which is easily done
726f20d2 426with the L<piconv> utility.
c14a43b7 427
eabfc7bc 428=head2 Use of non-graphic characters in single-character variable names
51c2f40f 429
eabfc7bc
RS
430The syntax for single-character variable names is more lenient than
431for longer variable names, allowing the one-character name to be a
432punctuation character or even invisible (a non-graphic). Perl v5.20
433deprecated the ASCII-range controls as such a name. Now, all
434non-graphic characters that formerly were allowed are deprecated.
d140c31c
AC
435The practical effect of this occurs only when not under C<S<use
436utf8>>, and affects just the C1 controls (code points 0x80 through
eabfc7bc 4370xFF), NO-BREAK SPACE, and SOFT HYPHEN.
83a5d6b6 438
eabfc7bc 439=head2 Inlining of C<sub () { $var }> with observable side-effects
abec5bed 440
4ec8e6f0
KW
441In many cases Perl makes S<C<sub () { $var }>> into an inlinable constant
442subroutine, capturing the value of C<$var> at the time the C<sub> expression
eabfc7bc 443is evaluated. This can break the closure behaviour in those cases where
43831b1f
DM
444C<$var> is subsequently modified, since the subroutine won't return the
445changed value. (Note that this all only applies to anonymous subroutines
3209f716 446with an empty prototype (S<C<sub ()>>).)
abec5bed 447
eabfc7bc
RS
448This usage is now deprecated in those cases where the variable could be
449modified elsewhere. Perl detects those cases and emits a deprecation
450warning. Such code will likely change in the future and stop producing a
451constant.
abec5bed 452
eabfc7bc
RS
453If your variable is only modified in the place where it is declared, then
454Perl will continue to make the sub inlinable with no warnings.
c14a43b7 455
eabfc7bc
RS
456 sub make_constant {
457 my $var = shift;
458 return sub () { $var }; # fine
459 }
c14a43b7 460
eabfc7bc
RS
461 sub make_constant_deprecated {
462 my $var;
463 $var = shift;
464 return sub () { $var }; # deprecated
465 }
c14a43b7 466
eabfc7bc
RS
467 sub make_constant_deprecated2 {
468 my $var = shift;
469 log_that_value($var); # could modify $var
470 return sub () { $var }; # deprecated
471 }
c14a43b7 472
4ec8e6f0 473In the second example above, detecting that C<$var> is assigned to only once
eabfc7bc
RS
474is too hard to detect. That it happens in a spot other than the C<my>
475declaration is enough for Perl to find it suspicious.
7f9fef93 476
eabfc7bc
RS
477This deprecation warning happens only for a simple variable for the body of
478the sub. (A C<BEGIN> block or C<use> statement inside the sub is ignored,
479because it does not become part of the sub's body.) For more complex
4ec8e6f0 480cases, such as S<C<sub () { do_something() if 0; $var }>> the behaviour has
eabfc7bc
RS
481changed such that inlining does not happen if the variable is modifiable
482elsewhere. Such cases should be rare.
c14a43b7 483
eabfc7bc 484=head2 Use of multiple /x regexp modifiers
c14a43b7 485
eabfc7bc 486It is now deprecated to say something like any of the following:
c14a43b7 487
eabfc7bc
RS
488 qr/foo/xx;
489 /(?xax:foo)/;
490 use re qw(/amxx);
be39acb2 491
eabfc7bc
RS
492That is, now C<x> should only occur once in any string of contiguous
493regular expression pattern modifiers. We do not believe there are any
494occurrences of this in all of CPAN. This is in preparation for a future
d140c31c 495Perl release having C</xx> permit white-space for readability in
eabfc7bc
RS
496bracketed character classes (those enclosed in square brackets:
497C<[...]>).
c14a43b7 498
d1197d77 499=head2 Using a NO-BREAK space in a character alias for C<\N{...}> is now deprecated
60dcce55 500
eabfc7bc
RS
501This non-graphic character is essentially indistinguishable from a
502regular space, and so should not be allowed. See
503L<charnames/CUSTOM ALIASES>.
60dcce55 504
eabfc7bc
RS
505=head2 A literal C<"{"> should now be escaped in a pattern
506
507If you want a literal left curly bracket (also called a left brace) in a
508regular expression pattern, you should now escape it by either
509preceding it with a backslash (C<"\{">) or enclosing it within square
510brackets C<"[{]">, or by using C<\Q>; otherwise a deprecation warning
511will be raised. This was first announced as forthcoming in the v5.16
512release; it will allow future extensions to the language to happen.
513
514=head2 Making all warnings fatal is discouraged
515
516The documentation for L<fatal warnings|warnings/Fatal Warnings> notes that
d140c31c 517C<< use warnings FATAL => 'all' >> is discouraged, and provides stronger
eabfc7bc
RS
518language about the risks of fatal warnings in general.
519
520=head1 Performance Enhancements
79a77127 521
7f9fef93 522=over 4
abec5bed
DIM
523
524=item *
525
43831b1f 526If a method or class name is known at compile time, a hash is precomputed
eabfc7bc
RS
527to speed up run-time method lookup. Also, compound method names like
528C<SUPER::new> are parsed at compile time, to save having to parse them at
529run time.
9749148e 530
eabfc7bc 531=item *
9749148e 532
eabfc7bc
RS
533Array and hash lookups (especially nested ones) that use only constants
534or simple variables as keys, are now considerably faster. See
535L</Internal Changes> for more details.
abec5bed
DIM
536
537=item *
538
eabfc7bc
RS
539C<(...)x1>, C<("constant")x0> and C<($scalar)x0> are now optimised in list
540context. If the right-hand argument is a constant 1, the repetition
541operator disappears. If the right-hand argument is a constant 0, the whole
6a3ea89b 542expression is optimised to the empty list, so long as the left-hand
d140c31c
AC
543argument is a simple scalar or constant. (That is, C<(foo())x0> is not
544subject to this optimisation.)
6bb5549b 545
eabfc7bc 546=item *
7f9fef93 547
eabfc7bc
RS
548C<substr> assignment is now optimised into 4-argument C<substr> at the end
549of a subroutine (or as the argument to C<return>). Previously, this
550optimisation only happened in void context.
abec5bed 551
eabfc7bc 552=item *
7f9fef93 553
43831b1f
DM
554In C<"\L...">, C<"\Q...">, etc., the extra "stringify" op is now optimised
555away, making these just as fast as C<lcfirst>, C<quotemeta>, etc.
2e4abf26 556
eabfc7bc 557=item *
83a5d6b6 558
eabfc7bc
RS
559Assignment to an empty list is now sometimes faster. In particular, it
560never calls C<FETCH> on tied arguments on the right-hand side, whereas it
561used to sometimes.
562
563=item *
83a5d6b6 564
d140c31c
AC
565There is a performance improvement of up to 20% when C<length> is applied to
566a non-magical, non-tied string, and either C<use bytes> is in scope or the
567string doesn't use UTF-8 internally.
338906ce 568
eabfc7bc 569=item *
5de148ee 570
d140c31c
AC
571On most perl builds with 64-bit integers, memory usage for non-magical,
572non-tied scalars containing only a floating point value has been reduced
573by between 8 and 32 bytes, depending on OS.
5de148ee 574
eabfc7bc 575=item *
5de148ee 576
d140c31c
AC
577In C<@array = split>, the assignment can be optimized away, so that C<split>
578writes directly to the array. This optimisation was happening only for
43831b1f
DM
579package arrays other than C<@_>, and only sometimes. Now this
580optimisation happens almost all the time.
5de148ee 581
eabfc7bc 582=item *
7f9fef93 583
43831b1f 584C<join> is now subject to constant folding. So for example
3209f716 585S<C<join "-", "a", "b">> is converted at compile-time to C<"a-b">.
43831b1f 586Moreover, C<join> with a scalar or constant for the separator and a
d140c31c 587single-item list to join is simplified to a stringification, and the
43831b1f 588separator doesn't even get evaluated.
5de148ee 589
eabfc7bc 590=item *
47cb8ddb 591
eabfc7bc 592C<qq(@array)> is implemented using two ops: a stringify op and a join op.
4ec8e6f0 593If the C<qq> contains nothing but a single array, the stringification is
eabfc7bc 594optimized away.
47cb8ddb
SH
595
596=item *
597
4ec8e6f0
KW
598S<C<our $var>> and S<C<our($s,@a,%h)>> in void context are no longer evaluated at
599run time. Even a whole sequence of S<C<our $foo;>> statements will simply be
eabfc7bc 600skipped over. The same applies to C<state> variables.
47cb8ddb 601
eabfc7bc 602=item *
47cb8ddb 603
eabfc7bc
RS
604Many internal functions have been refactored to improve performance and reduce
605their memory footprints.
eabfc7bc
RS
606L<[perl #121436]|https://rt.perl.org/Ticket/Display.html?id=121436>
607L<[perl #121906]|https://rt.perl.org/Ticket/Display.html?id=121906>
608L<[perl #121969]|https://rt.perl.org/Ticket/Display.html?id=121969>
47cb8ddb 609
eabfc7bc 610=item *
47cb8ddb 611
eabfc7bc 612C<-T> and C<-B> filetests will return sooner when an empty file is detected.
a75e6a3a 613L<[perl #121489]|https://rt.perl.org/Ticket/Display.html?id=121489>
47cb8ddb 614
eabfc7bc 615=item *
5de148ee 616
01842271 617Hash lookups where the key is a constant are faster.
be39acb2
SH
618
619=item *
620
d140c31c 621Subroutines with an empty prototype and a body containing just C<undef> are now
eabfc7bc
RS
622eligible for inlining.
623L<[perl #122728]|https://rt.perl.org/Ticket/Display.html?id=122728>
be39acb2 624
eabfc7bc 625=item *
be39acb2 626
43831b1f
DM
627Subroutines in packages no longer need to be stored in typeglobs:
628declaring a subroutine will now put a simple sub reference directly in the
629stash if possible, saving memory. The typeglob still notionally exists,
630so accessing it will cause the stash entry to be upgraded to a typeglob
631(i.e. this is just an internal implementation detail).
632This optimization does not currently apply to XSUBs or exported
633subroutines, and method calls will undo it, since they cache things in
634typeglobs.
eabfc7bc 635L<[perl #120441]|https://rt.perl.org/Ticket/Display.html?id=120441>
7f9fef93 636
eabfc7bc 637=item *
be39acb2 638
eabfc7bc
RS
639The functions C<utf8::native_to_unicode()> and C<utf8::unicode_to_native()>
640(see L<utf8>) are now optimized out on ASCII platforms. There is now not even
641a minimal performance hit in writing code portable between ASCII and EBCDIC
642platforms.
be39acb2
SH
643
644=item *
645
eabfc7bc 646Win32 Perl uses 8 KB less of per-process memory than before for every perl
43831b1f 647process, because some data is now memory mapped from disk and shared
d140c31c 648between processes from the same perl binary.
be39acb2
SH
649
650=back
651
eabfc7bc 652=head1 Modules and Pragmata
83a5d6b6 653
9189be1b
KW
654=head2 Updated Modules and Pragmata
655
f5b63a6e
RS
656Many of the libraries distributed with perl have been upgraded since v5.20.0.
657For a complete list of changes, run:
83a5d6b6 658
f5b63a6e 659 corelist --diff 5.20.0 5.22.0
338906ce 660
f5b63a6e 661You can substitute your favorite version in place of 5.20.0, too.
cd7bac54 662
9189be1b
KW
663Some notable changes include:
664
665=over 4
666
667=item *
668
669L<CPAN> has been upgraded to version 2.10.
670
671Add support for C<Cwd::getdcwd()> and introduce workaround for a misbehaviour
672seen on Strawberry Perl 5.20.1.
673
674Fix C<chdir()> after building dependencies bug.
675
676Introduce experimental support for plugins/hooks.
677
678Integrate the App::Cpan sources.
679
680Do not check recursion on optional dependencies.
681
682Sanity check F<META.yml> to contain a hash.
683L<[cpan #95271]|https://rt.cpan.org/Ticket/Display.html?id=95271>
684
685=item *
686
687L<utf8> has been upgraded to version 1.17
688
689A mismatch between the documentation and the code in utf8::downgrade()
690was fixed in favour of the documentation. The optional second argument
691is now correctly treated as a perl boolean (true/false semantics) and
692not as an integer.
693
694=item *
695
696L<Module::Metadata> has been upgraded to version 1.000024.
697
698Support installations on older perls with an L<ExtUtils::MakeMaker> earlier
699than 6.63_03
700
701=item *
702
703L<perl5db.pl> has been upgraded to version 1.49.
704
705The debugger would cause an assertion failure.
706L<[perl #124127]|https://rt.perl.org/Ticket/Display.html?id=124127>
707
708C<fork()> in the debugger under C<tmux> will now create a new window for
709the forked process. L<[perl
710#121333]|https://rt.perl.org/Ticket/Display.html?id=121333>
711
712The debugger now saves the current working directory on startup and
713restores it when you restart your program with C<R> or C<rerun>. L<[perl
714#121509]|https://rt.perl.org/Ticket/Display.html?id=121509>
715
716=item *
717
718L<Unicode::Collate> has been upgraded to version 1.07.
719
720Version 0.67's improved discontiguous contractions is invalidated by default
721and is supported as a parameter 'long_contraction'.
722
723=item *
724
725L<Unicode::Normalize> has been upgraded to version 1.18.
726
727The XSUB implementation has been removed in favour of pure Perl.
728
729=item *
730
731L<Math::BigInt> has been upgraded to version 1.9996.
732
733Synchronize POD changes from the CPAN release.
734C<< Math::BigFloat->blog(x) >> would sometimes return blog(2*x) when
735the accuracy was greater than 70 digits.
736The result of C<< Math::BigFloat->bdiv() >> in list context now
737satisfies C<< x = quotient * divisor + remainder >>.
738
739Correct handling of subclasses.
740L<[cpan #96254]|https://rt.cpan.org/Ticket/Display.html?id=96254>
741L<[cpan #96329]|https://rt.cpan.org/Ticket/Display.html?id=96329>
742
743=item *
744
745L<UNIVERSAL> has been upgraded to version 1.12.
746
747L<B::Op_private> provides detailed information about the flags used in the
748C<op_private> field of perl opcodes.
749
750=item *
751
752L<Archive::Tar> has been upgraded to version 2.02.
753
754Tests can now be run in parallel.
755
756=item *
757
758L<constant> has been upgraded to version 1.32.
759
760It now accepts fully-qualified constant names, allowing constants to be defined
761in packages other than the caller.
762
763=item *
764
765L<CPAN::Meta::Requirements> has been upgraded to version 2.128.
766
767Works around limitations in version::vpp detecting v-string magic and adds
768support for forthcoming L<ExtUtils::MakeMaker> bootstrap F<version.pm> for
769Perls older than 5.10.0.
770
771=item *
772
773L<Data::Dumper> has been upgraded to version 2.154.
774
775Fixes CVE-2014-4330 by adding a configuration variable/option to limit
776recursion when dumping deep data structures.
777
778Changes to resolve Coverity issues.
779XS dumps incorrectly stored the name of code references stored in a
780GLOB.
781L<[perl #122070]|https://rt.perl.org/Ticket/Display.html?id=122070>
782
783=item *
784
785L<experimental> has been upgraded to version 0.010.
786
787Hardcodes features for Perls older than 5.15.7.
788
789=item *
790
791L<ExtUtils::CBuilder> has been upgraded to version 0.280219.
792
793Fixes a regression on Android.
794L<[perl #122675]|https://rt.perl.org/Ticket/Display.html?id=122675>
795
796=item *
797
798L<ExtUtils::Manifest> has been upgraded to version 1.68.
799
800Fixes a bug with C<maniread()>'s handling of quoted filenames and improves
801C<manifind()> to follow symlinks.
802L<[perl #122415]|https://rt.perl.org/Ticket/Display.html?id=122415>
803
804=item *
805
806L<File::Find> has been upgraded to version 1.28.
807
808C<find()> and C<finddepth()> will now warn if passed inappropriate or
809misspelled options.
810
811=item *
812
813L<HTTP::Tiny> has been upgraded to version 0.049.
814
815C<keep_alive> is now fork-safe and thread-safe.
816
817=item *
818
819L<IO> has been upgraded to version 1.34.
820
821The XS implementation has been fixed for the sake of older Perls.
822
823=item *
824
825L<IO::Socket::IP> has been upgraded to version 0.32.
826
827A better fix for subclassing C<connect()>.
828L<[cpan #95983]|https://rt.cpan.org/Ticket/Display.html?id=95983>
829L<[cpan #97050]|https://rt.cpan.org/Ticket/Display.html?id=97050>
830
831Implements Timeout for C<connect()>.
832L<[cpan #92075]|https://rt.cpan.org/Ticket/Display.html?id=92075>
833
834=item *
835
836L<Locale::Codes> has been upgraded to version 3.32.
837
838Fixed a bug in the scripts used to extract data from spreadsheets that
839prevented the SHP currency code from being found.
840L<[cpan #94229]|https://rt.cpan.org/Ticket/Display.html?id=94229>
841
842New codes have been added.
843
844=item *
845
846L<overload> has been upgraded to version 1.23.
847
848A redundant C<ref $sub> check has been removed.
849
850=item *
851
852L<Pod::Perldoc> has been upgraded to version 3.24.
853
854Filehandles opened for reading or writing now have C<:encoding(UTF-8)> set.
855L<[cpan #98019]|https://rt.cpan.org/Ticket/Display.html?id=98019>
856
857=item *
858
859The Scalar List Utils has been upgraded to version 1.41.
860
861A new module, L<Sub::Util>, has been added, containing functions related to
862CODE refs, including C<subname> (inspired by Sub::Identity) and C<set_subname>
863(copied and renamed from Sub::Name).
864The use of C<GetMagic> in C<List::Util::reduce()> has also been fixed.
865L<[cpan #63211]|https://rt.cpan.org/Ticket/Display.html?id=63211>
866
867=item *
868
869L<Time::Piece> has been upgraded to version 1.29.
870
871When pretty printing negative Time::Seconds, the "minus" is no longer lost.
872
873=item *
874
875L<version> has been upgraded to version 0.9909.
876
877Numerous changes. See the F<Changes> file in the CPAN distribution for
878details.
879
880=item *
881
882L<attributes> has been upgraded to version 0.24.
883
884The usage of C<memEQs> in the XS has been corrected.
885L<[perl #122701]|https://rt.perl.org/Ticket/Display.html?id=122701>
886
887Avoid reading beyond the end of a buffer. [perl #122629]
888
889=item *
890
891L<B::Concise> has been upgraded to version 0.994.
892
893Null ops that are part of the execution chain are now given sequence
894numbers.
895
896Private flags for nulled ops are now dumped with mnemonics as they would be
897for the non-nulled counterparts.
898
899=item *
900
901L<DynaLoader> has been upgraded to version 1.27.
902
903Remove C<dl_nonlazy> global if unused in Dynaloader. [perl #122926]
904
905=item *
906
907L<Fcntl> has been upgraded to version 1.13.
908
909Add support for the Linux pipe buffer size fcntl() commands.
910
911=item *
912
913The libnet collection of modules has been upgraded to version 3.02.
914
915Support for IPv6 and SSL to Net::FTP, Net::NNTP, Net::POP3 and Net::SMTP.
916Improvements in Net::SMTP authentication.
917
918=item *
919
920L<POSIX> has been upgraded to version 1.45.
921
922The C99 math functions and constants (for example C<acosh>, C<isinf>, C<isnan>, C<round>,
923C<trunc>; C<M_E>, C<M_SQRT2>, C<M_PI>) have been added.
924
925POSIX::tmpnam() now produces a deprecation warning. [perl #122005]
926
927=item *
928
929L<XSLoader> has been upgraded to version 0.18.
930
931Allow XSLoader to load modules from a different namespace.
932[perl #122455]
933
934=item *
935
936L<B::Op_private> has been upgraded to version 5.021006.
937
938It now includes a hash named C<%ops_using>, list all op types that use a
939particular private flag.
940
941=item *
942
943L<IO::Socket> has been upgraded to version 1.38.
944
945Document the limitations of the connected() method. [perl #123096]
946
947=item *
948
949The PathTools module collection has been upgraded to version 3.53.
950
951A warning from the B<gcc> compiler is now avoided when building the XS.
952
953Don't turn leading C<//> into C</> on Cygwin. [perl #122635]
954
955=item *
956
957L<ExtUtils::ParseXS> has been upgraded to version 3.27.
958
959Only declare C<file> unused if we actually define it.
960Improve generated C<RETVAL> code generation to avoid repeated
961references to C<ST(0)>. [perl #123278]
962Broaden and document the C</OBJ$/> to C</REF$/> typemap optimization
963for the C<DESTROY> method. [perl #123418]
964
965=item *
966
967L<B> has been upgraded to version 1.55.
968
969It provides a new C<B::safename> function, based on the existing
970C<< B::GV->SAFENAME >>, that converts "\cOPEN" to "^OPEN".
971
972Nulled COPs are now of class C<B::COP>, rather than C<B::OP>.
973
974C<B::REGEXP> objects now provide a C<qr_anoncv> method for accessing the
975implicit CV associated with C<qr//> things containing code blocks, and a
976C<compflags> method that returns the pertinent flags originating from the
977C<qr//blahblah> op.
978
979C<B::PMOP> now provides a C<pmregexp> method returning a C<B::REGEXP> object.
980Two new classes, C<B::PADNAME> and C<B::PADNAMELIST>, have been introduced.
981
982A bug where, after an ithread creation or psuedofork, special/immortal SVs in
983the child ithread/psuedoprocess did not have the correct class of
984C<B::SPECIAL>, has been fixed.
985The C<id> and C<outid> PADLIST methods have been added.
986
987=item *
988
989L<File::Glob> has been upgraded to version 1.24.
990
991Avoid SvIV() expanding to call get_sv() three times in a few
992places. [perl #123606]
993
994=item *
995
996L<Safe> has been upgraded to version 2.39.
997
998C<reval> was not propagating void context properly.
999
1000=item *
1001
1002L<SDBM_File> has been upgraded to version 1.13.
1003
1004Simplified the build process. [perl #123413]
1005
1006=item *
1007
1008L<B::Deparse> has been upgraded to version 1.35.
1009
1010It now deparses C<+sub : attr { ... }> correctly at the start of a
1011statement. Without the initial C<+>, C<sub> would be a statement label.
1012
1013C<BEGIN> blocks are now emitted in the right place most of the time, but
1014the change unfortunately introduced a regression, in that C<BEGIN> blocks
1015occurring just before the end of the enclosing block may appear below it
1016instead. XXX So this change may need to be reverted if it cannot be fixed
1017before Perl 5.22. [perl #77452]
1018
1019C<B::Deparse> no longer puts erroneous C<local> here and there, such as for
1020C<LIST = tr/a//d>. [perl #119815]
1021
1022Adjacent C<use> statements are no longer accidentally nested if one
1023contains a C<do> block. [perl #115066]
1024
1025Parenthesised arrays in lists passed to C<\> are now correctly deparsed
1026with parentheses (e.g., C<\(@a, (@b), @c)> now retains the parentheses
1027around @b), this preserving the flattening behaviour of referenced
1028parenthesised arrays. Formerly, it only worked for one array: C<\(@a)>.
1029
1030C<local our> is now deparsed correctly, with the C<our> included.
1031
1032C<for($foo; !$bar; $baz) {...}> was deparsed without the C<!> (or C<not>).
1033This has been fixed.
1034
1035Core keywords that conflict with lexical subroutines are now deparsed with
1036the C<CORE::> prefix.
1037
1038C<foreach state $x (...) {...}> now deparses correctly with C<state> and
1039not C<my>.
1040
1041C<our @array = split(...)> now deparses correctly with C<our> in those
1042cases where the assignment is optimized away.
1043
1044It now deparses C<our(I<LIST>)> and typed lexical (C<my Dog $spot>) correctly.
1045
1046Deparse C<$#_> as that instead of as C<$#{_}>.
1047L<[perl #123947]|https://rt.perl.org/Ticket/Display.html?id=123947>
1048
1049C<< <<>> >> is now correctly deparsed.
1050
1051BEGIN blocks at the end of the enclosing scope are now deparsed in the
1052right place. [perl #77452]
1053
1054BEGIN blocks were sometimes deparsed as __ANON__, but are now always called
1055BEGIN.
1056
1057Lexical subroutines are now fully deparsed. [perl #116553]
1058
1059Deparsing of C<$lexical =~ //> was accidentally broken in 1.30 (perl
10605.21.6), omitting the C<$lexical =~>, but has now been fixed.
1061
1062C<Anything =~ y///r> with C</r> no longer omits the left-hand operand.
1063
1064The op trees that make up regexp code blocks are now deparsed for real.
1065Formerly, the original string that made up the regular expression was used.
1066That caused problems with C<qr/(?{E<lt>E<lt>heredoc})/> and multiline code blocks,
1067which were deparsed incorrectly. [perl #123217] [perl #115256]
1068
1069C<$;> at the end of a statement no longer loses its semicolon.
1070[perl #123357]
1071
1072Some cases of subroutine declarations stored in the stash in shorthand form
1073were being omitted.
1074
1075Non-ASCII characters are now consistently escaped in strings, instead of
1076some of the time. (There are still outstanding problems with regular
1077expressions and identifiers that have not been fixed.)
1078
1079When prototype sub calls are deparsed with C<&> (e.g., under the B<-P>
1080option), C<scalar> is now added where appropriate, to force the scalar
1081context implied by the prototype.
1082
1083C<require(foo())>, C<do(foo())>, C<goto(foo())> and similar constructs with
1084loop controls are now deparsed correctly. The outer parentheses are not
1085optional.
1086
1087Whitespace is no longer escaped in regular expressions, because it was
1088getting erroneously escaped within C<(?x:...)> sections.
1089
1090C<sub foo { foo() }> is now deparsed with those mandatory parentheses.
1091
1092C</@array/> is now deparsed as a regular expression, and not just
1093C<@array>.
1094
1095C</@{-}/>, C</@{+}/> and C<$#{1}> are now deparsed with the braces, which
1096are mandatory in these cases.
1097
1098In deparsing feature bundles, B::Deparse was emitting C<no feature;> first
1099instead of C<no feature ':all';>. This has been fixed.
1100
1101C<chdir FH> is now deparsed without quotation marks.
1102
1103C<\my @a> is now deparsed without parentheses. (Parenthese would flatten
1104the array.)
1105
1106C<system> and C<exec> followed by a block are now deparsed correctly.
1107Formerly there was an erroneous C<do> before the block.
1108
1109C<< use constant QR =E<gt> qr/.../flags >> followed by C<"" =~ QR> is no longer
1110without the flags.
1111
1112Deparsing C<BEGIN { undef &foo }> with the B<-w> switch enabled started to
1113emit 'uninitialized' warnings in Perl 5.14. This has been fixed.
1114
1115Deparsing calls to subs with a C<(;+)> prototype resulted in an infinite
1116loop. The C<(;$>) C<(_)> and C<(;_)> prototypes were given the wrong
1117precedence, causing C<foo($aE<lt>$b)> to be deparsed without the parentheses.
1118
1119Deparse now provides a defined state sub in inner subs.
1120Since version Perl 5.21.6, Deparse would croak on special constants, but
1121this has now been fixed.
1122
1123=item *
1124
1125L<bigint>, L<bignum>, L<bigrat> have been upgraded to version 0.39.
1126
1127Document in CAVEATS that using strings as numbers won't always invoke
1128the big number overloading, and how to invoke it. [rt.perl.org #123064]
1129
1130=item *
1131
1132L<Carp> has been upgraded to version 1.35.
1133
1134Carp::Heavy now ignores version mismatches with Carp if Carp is newer
1135than 1.12, since Carp::Heavy's guts were merged into Carp at that
1136point.
1137L<[perl #121574]|https://rt.perl.org/Ticket/Display.html?id=121574>
1138
1139Carp now handles non-ASCII platforms better.
1140Off-by-one error fix for Perl E<lt> 5.14.
1141
1142=item *
1143
1144L<Encode> has been upgraded to version 2.70.
1145
1146C<piconv> now has better error handling when the encoding name is nonexistent,
1147and a build breakage when upgrading L<Encode> in perl-5.8.2 and earlier has
1148been fixed.
1149
1150Building in C++ mode on Windows now works.
1151
1152=item *
1153
1154L<Errno> has been upgraded to version 1.23.
1155
1156Add C<-P> to the preprocessor command-line on GCC 5. GCC added extra
1157line directives, breaking parsing of error code definitions. [rt.perl.org
1158#123784]
1159
1160=item *
1161
1162L<PerlIO::scalar> has been upgraded to version 0.22.
1163
1164Reading from a position well past the end of the scalar now correctly
1165returns end of file. [perl #123443]
1166
1167Seeking to a negative position still fails, but no longer leaves the
1168file position set to a negation location.
1169
1170C<eof()> on a C<PerlIO::scalar> handle now properly returns true when
1171the file position is past the 2GB mark on 32-bit systems.
1172
1173Attempting to write at file positions impossible for the platform now
1174fail early rather than wrapping at 4GB.
1175
1176=item *
1177
1178L<Unicode::UCD> has been upgraded to version 0.61.
1179
1180A new function L<property_values()|Unicode::UCD/prop_values()>
1181has been added to return a given property's possible values.
1182
1183A new function L<charprop()|Unicode::UCD/charprop()>
1184has been added to return the value of a given property for a given code
1185point.
1186
1187A new function L<charprops_all()|Unicode::UCD/charprops_all()>
1188has been added to return the values of all Unicode properties for a
1189given code point.
1190
1191A bug has been fixed so that L<propaliases()|Unicode::UCD/prop_aliases()>
1192returns the correct short and long names for the Perl extensions where
1193it was incorrect.
1194
1195A bug has been fixed so that
1196L<prop_value_aliases()|Unicode::UCD/prop_value_aliases()>
1197returns C<undef> instead of a wrong result for properties that are Perl
1198extensions.
1199
1200This module now works on EBCDIC platforms.
1201
1202=item *
1203
1204L<Win32> has been upgraded to version 0.51.
1205
1206GetOSName() now supports Windows 8.1, and building in C++ mode now works.
1207
1208=item *
1209
1210L<Win32API::File> has been upgraded to version 0.1202
1211
1212Building in C++ mode now works.
1213
1214=back
1215
f5b63a6e 1216=head2 Removed Modules and Pragmata
391823f2 1217
f5b63a6e
RS
1218The following modules (and associated modules) have been removed from the core
1219perl distribution:
eabfc7bc
RS
1220
1221=over 4
1222
1223=item *
1224
f5b63a6e 1225L<CGI>
69e954a5 1226
7f9fef93 1227=item *
86e0176a 1228
f5b63a6e 1229L<Module::Build>
69e954a5 1230
e5998677 1231=back
20b5e916 1232
eabfc7bc
RS
1233=head1 Documentation
1234
1235=head2 New Documentation
532ecd00 1236
eabfc7bc 1237=head3 L<perlunicook>
d76c14eb 1238
eabfc7bc
RS
1239This document, by Tom Christiansen, provides examples of handling Unicode in
1240Perl.
1241
1242=head2 Changes to Existing Documentation
1243
7595828f
KW
1244=head3 L<perlaix>
1245
1246=over 4
1247
1248=item *
1249
1250A note on long doubles has been added.
1251
1252=back
1253
1254
eabfc7bc 1255=head3 L<perlapi>
d547bad0 1256
e5998677 1257=over 4
d547bad0 1258
8a95d307
FC
1259=item *
1260
eabfc7bc 1261Note that C<SvSetSV> doesn't do set magic.
532ecd00 1262
eabfc7bc 1263=item *
532ecd00 1264
6ba7438b 1265C<sv_usepvn_flags> - fix documentation to mention the use of C<Newx> instead of
eabfc7bc 1266C<malloc>.
532ecd00 1267
eabfc7bc 1268L<[perl #121869]|https://rt.perl.org/Ticket/Display.html?id=121869>
532ecd00 1269
eabfc7bc 1270=item *
532ecd00 1271
eabfc7bc 1272Clarify where C<NUL> may be embedded or is required to terminate a string.
532ecd00 1273
eabfc7bc 1274=item *
532ecd00 1275
d140c31c
AC
1276Some documentation that was previously missing due to formatting errors is
1277now included.
532ecd00 1278
eabfc7bc 1279=item *
532ecd00 1280
3b50e657
KW
1281Entries are now organized into groups rather than by the file where they
1282are found.
532ecd00 1283
eabfc7bc 1284=item *
532ecd00 1285
3b50e657
KW
1286Alphabetical sorting of entries is now done consistently (automatically
1287by the POD generator) to make entries easier to find when scanning.
eabfc7bc
RS
1288
1289=back
338906ce 1290
eabfc7bc 1291=head3 L<perldata>
338906ce 1292
e5998677 1293=over 4
338906ce 1294
eabfc7bc 1295=item *
2f304be9 1296
eabfc7bc
RS
1297The syntax of single-character variable names has been brought
1298up-to-date and more fully explained.
9749148e 1299
7595828f
KW
1300=item *
1301
1302Hexadecimal floating point numbers are described, as are infinity and
1303NaN.
1304
7f9fef93 1305=back
9749148e 1306
eabfc7bc 1307=head3 L<perlebcdic>
47cb8ddb 1308
7f9fef93 1309=over 4
47cb8ddb 1310
eabfc7bc 1311=item *
47cb8ddb 1312
eabfc7bc
RS
1313This document has been significantly updated in the light of recent
1314improvements to EBCDIC support.
47cb8ddb 1315
7f9fef93 1316=back
47cb8ddb 1317
7595828f
KW
1318=head3 L<perlfilter>
1319
1320=over 4
1321
1322=item *
1323
1324Added a L<LIMITATIONS|perlfilter/LIMITATIONS> section.
1325
1326=back
1327
1328
eabfc7bc 1329=head3 L<perlfunc>
be39acb2 1330
eabfc7bc 1331=over 4
be39acb2 1332
eabfc7bc 1333=item *
be39acb2 1334
eabfc7bc 1335Mention that C<study()> is currently a no-op.
be39acb2
SH
1336
1337=item *
1338
eabfc7bc
RS
1339Calling C<delete> or C<exists> on array values is now described as "strongly
1340discouraged" rather than "deprecated".
be39acb2 1341
eabfc7bc 1342=item *
7f9fef93 1343
eabfc7bc 1344Improve documentation of C<< our >>.
be39acb2 1345
eabfc7bc 1346=item *
be39acb2 1347
eabfc7bc
RS
1348C<-l> now notes that it will return false if symlinks aren't supported by the
1349file system.
be39acb2 1350
eabfc7bc 1351L<[perl #121523]|https://rt.perl.org/Ticket/Display.html?id=121523>
be39acb2
SH
1352
1353=item *
1354
eabfc7bc 1355Note that C<exec LIST> and C<system LIST> may fall back to the shell on
d140c31c
AC
1356Win32. Only the indirect-object syntax C<exec PROGRAM LIST> and
1357C<system PROGRAM LIST> will reliably avoid using the shell.
eabfc7bc
RS
1358
1359This has also been noted in L<perlport>.
1360
1361L<[perl #122046]|https://rt.perl.org/Ticket/Display.html?id=122046>
be39acb2 1362
7f9fef93 1363=back
be39acb2 1364
eabfc7bc
RS
1365=head3 L<perlguts>
1366
1367=over 4
1368
1369=item *
1370
1371The OOK example has been updated to account for COW changes and a change in the
1372storage of the offset.
1373
1374=item *
be39acb2 1375
eabfc7bc 1376Details on C level symbols and libperl.t added.
be39acb2 1377
ce93e38b
KW
1378=item *
1379
1380Information on Unicode handling has been added
1381
1382=item *
1383
1384Information on EBCDIC handling has been added
1385
eabfc7bc
RS
1386=back
1387
7595828f
KW
1388=head3 L<perlhack>
1389
1390=over 4
1391
1392=item *
1393
1394A note has been added about running on platforms with non-ASCII
1395character sets
1396
1397=item *
1398
1399A note has been added about performance testing
1400
1401=back
1402
eabfc7bc 1403=head3 L<perlhacktips>
7f9fef93
SH
1404
1405=over 4
be39acb2
SH
1406
1407=item *
1408
d140c31c
AC
1409Documentation has been added illustrating the perils of assuming that
1410there is no change to the contents of static memory pointed to by the
1411return values of Perl's wrappers for C library functions.
eabfc7bc
RS
1412
1413=item *
1414
d140c31c
AC
1415Replacements for C<tmpfile>, C<atoi>, C<strtol>, and C<strtoul> are now
1416recommended.
eabfc7bc
RS
1417
1418=item *
1419
1420Updated documentation for the C<test.valgrind> C<make> target.
1421
1422L<[perl #121431]|https://rt.perl.org/Ticket/Display.html?id=121431>
be39acb2 1423
7595828f
KW
1424=item *
1425
1426Information is given about writing test files portably to non-ASCII
1427platforms.
1428
1429=item *
1430
1431A note has been added about how to get a C language stack backtrace.
1432
1433=back
1434
1435=head3 L<perlhpux>
1436
1437=over 4
1438
1439=item *
1440
1441Note that the message "Redeclaration of "sendpath" with a different
1442storage class specifier" is harmless.
1443
1444=back
1445
1446=head3 L<perllocale>
1447
1448=over 4
1449
1450=item *
1451
1452Updated for the enhancements in v5.22, along with some clarifications.
1453
a9c3e753 1454=back
ea13b07e 1455
eabfc7bc 1456=head3 L<perlmodstyle>
0d42058e 1457
7f9fef93
SH
1458=over 4
1459
1460=item *
2a7a05b4 1461
eabfc7bc
RS
1462Instead of pointing to the module list, we are now pointing to
1463L<PrePAN|http://prepan.org/>.
2a7a05b4 1464
7f9fef93
SH
1465=back
1466
7595828f
KW
1467=head3 L<perlop>
1468
1469=over 4
1470
1471=item *
1472
1473Updated for the enhancements in v5.22, along with some clarifications.
1474
1475=back
1476
1477=head3 L<perlpodspec>
1478
1479=over 4
1480
1481=item *
1482
1483The specification of the pod language is changing so that the default
1484encoding of pods that aren't in UTF-8 (unless otherwise indicated) is
1485CP1252 instead of ISO 8859-1 (Latin1).
1486
1487=back
1488
eabfc7bc
RS
1489=head3 L<perlpolicy>
1490
1491=over 4
1492
1493=item *
1494
1495We now have a code of conduct for the I<< p5p >> mailing list, as documented
1496in L<< perlpolicy/STANDARDS OF CONDUCT >>.
2a7a05b4 1497
eabfc7bc
RS
1498=item *
1499
1500The conditions for marking an experimental feature as non-experimental are now
1501set out.
1502
7595828f
KW
1503=item *
1504
1505Clarification has been made as to what sorts of changes are permissible in
1506maintenance releases.
1507
eabfc7bc
RS
1508=back
1509
1510=head3 L<perlport>
1511
1512=over 4
1513
1514=item *
1515
d140c31c 1516Out-of-date VMS-specific information has been fixed and/or simplified.
eabfc7bc 1517
ce93e38b
KW
1518=item *
1519
1520Notes about EBCDIC have been added.
1521
eabfc7bc
RS
1522=back
1523
1524=head3 L<perlre>
1525
1526=over 4
1527
1528=item *
1529
d140c31c 1530The description of the C</x> modifier has been clarified to note that
7595828f
KW
1531comments cannot be continued onto the next line by escaping them; and
1532there is now a list of all the characters that are considered whitespace
1533by this modifier.
1534
1535=item *
1536
1537The new C</n> modifier is described.
1538
1539=item *
1540
1541A note has been added on how to make bracketed character class ranges
1542portable to non-ASCII machines.
eabfc7bc
RS
1543
1544=back
1545
1546=head3 L<perlrebackslash>
1547
1548=over 4
1549
1550=item *
1551
1552Added documentation of C<\b{sb}>, C<\b{wb}>, C<\b{gcb}>, and C<\b{g}>.
1553
1554=back
1555
1556=head3 L<perlrecharclass>
1557
1558=over 4
1559
1560=item *
1561
1562Clarifications have been added to L<perlrecharclass/Character Ranges>
3b50e657 1563to the effect C<[A-Z]>, C<[a-z]>, C<[0-9]> and
eabfc7bc
RS
1564any subranges thereof in regular expression bracketed character classes
1565are guaranteed to match exactly what a naive English speaker would
1566expect them to match, even on platforms (such as EBCDIC) where special
1567handling is required to accomplish this.
1568
1569=item *
1570
1571The documentation of Bracketed Character Classes has been expanded to cover the
1572improvements in C<qr/[\N{named sequence}]/> (see under L</Selected Bug Fixes>).
1573
1574=back
1575
7595828f
KW
1576=head3 L<perlref>
1577
1578=over 4
1579
1580=item *
1581
1582A new section has been added
1583L<Assigning to References|perlref/Assigning to References>
1584
1585=back
1586
eabfc7bc
RS
1587=head3 L<perlsec>
1588
1589=over 4
1590
1591=item *
1592
1593Comments added on algorithmic complexity and tied hashes.
1594
1595=back
1596
1597=head3 L<perlsyn>
1598
1599=over 4
1600
1601=item *
1602
1603An ambiguity in the documentation of the C<...> statement has been corrected.
1604L<[perl #122661]|https://rt.perl.org/Ticket/Display.html?id=122661>
1605
1606=item *
1607
1608The empty conditional in C<< for >> and C<< while >> is now documented
1609in L<< perlsyn >>.
1610
1611=back
1612
1613=head3 L<perlunicode>
1614
1615=over 4
1616
1617=item *
1618
ce93e38b 1619This has had extensive revisions to bring it up-to-date with current
7595828f
KW
1620Unicode support and to make it more readable. Notable is that Unicode
16217.0 changed what it should do with non-characters. Perl retains the old
1622way of handling for reasons of backward compatibility. See
1623L<perlunicode/Noncharacter code points>.
eabfc7bc
RS
1624
1625=back
1626
1627=head3 L<perluniintro>
1628
1629=over 4
1630
1631=item *
1632
1633Advice for how to make sure your strings and regular expression patterns are
ce93e38b 1634interpreted as Unicode has been updated.
eabfc7bc
RS
1635
1636=back
1637
1638=head3 L<perlvar>
1639
1640=over 4
1641
1642=item *
1643
7595828f
KW
1644C<$]> is no longer listed as being deprecated. Instead, discussion has
1645been added on the advantages and disadvantages of using it versus
1646C<$^V>.
1647
1648=item *
1649
1650C<${^ENCODING}> is now marked as deprecated.
1651
1652=item *
1653
1654The entry for C<%^H> has been clarified to indicate it can only handle
1655simple values.
eabfc7bc
RS
1656
1657=back
1658
1659=head3 L<perlvms>
1660
1661=over 4
1662
1663=item *
1664
1665Out-of-date and/or incorrect material has been removed.
1666
1667=item *
1668
1669Updated documentation on environment and shell interaction in VMS.
1670
1671=back
1672
1673=head3 L<perlxs>
1674
1675=over 4
1676
1677=item *
1678
1679Added a discussion of locale issues in XS code.
1680
1681=back
1682
1683=head1 Diagnostics
1684
1685The following additions or changes have been made to diagnostic output,
1686including warnings and fatal error messages. For the complete list of
1687diagnostic messages, see L<perldiag>.
1688
1689=head2 New Diagnostics
1690
1691=head3 New Errors
1692
1693=over 4
1694
1695=item *
1696
1697L<Bad symbol for scalar|perldiag/"Bad symbol for scalar">
1698
1699(P) An internal request asked to add a scalar entry to something that
1700wasn't a symbol table entry.
1701
1702=item *
1703
1704L<Can't use a hash as a reference|perldiag/"Can't use a hash as a reference">
1705
1706(F) You tried to use a hash as a reference, as in
1707C<< %foo->{"bar"} >> or C<< %$ref->{"hello"} >>. Versions of perl E<lt>= 5.6.1
1708used to allow this syntax, but shouldn't have.
1709
1710=item *
1711
1712L<Can't use an array as a reference|perldiag/"Can't use an array as a reference">
1713
1714(F) You tried to use an array as a reference, as in
1715C<< @foo->[23] >> or C<< @$ref->[99] >>. Versions of perl E<lt>= 5.6.1 used to
1716allow this syntax, but shouldn't have.
1717
1718=item *
1719
1720L<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()?)">
1721
4ec8e6f0 1722(F) C<defined()> is not useful on arrays because it
eabfc7bc 1723checks for an undefined I<scalar> value. If you want to see if the
4ec8e6f0 1724array is empty, just use S<C<if (@array) { # not empty }>> for example.
eabfc7bc
RS
1725
1726=item *
1727
1728L<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()?)">
1729
1730(F) C<defined()> is not usually right on hashes.
1731
4ec8e6f0 1732Although S<C<defined %hash>> is false on a plain not-yet-used hash, it
eabfc7bc 1733becomes true in several non-obvious circumstances, including iterators,
4ec8e6f0
KW
1734weak references, stash names, even remaining true after S<C<undef %hash>>.
1735These things make S<C<defined %hash>> fairly useless in practice, so it now
eabfc7bc
RS
1736generates a fatal error.
1737
1738If a check for non-empty is what you wanted then just put it in boolean
1739context (see L<perldata/Scalar values>):
1740
1741 if (%hash) {
1742 # not empty
1743 }
1744
4ec8e6f0 1745If you had S<C<defined %Foo::Bar::QUUX>> to check whether such a package
eabfc7bc
RS
1746variable exists then that's never really been reliable, and isn't
1747a good way to enquire about the features of a package, or whether
1748it's loaded, etc.
1749
1750=item *
1751
1752L<Cannot chr %f|perldiag/"Cannot chr %f">
1753
c21a1c59
RS
1754(F) You passed an invalid number (like an infinity or not-a-number) to
1755C<chr>.
1756
eabfc7bc
RS
1757=item *
1758
1759L<Cannot compress %f in pack|perldiag/"Cannot compress %f in pack">
1760
c21a1c59
RS
1761(F) You tried converting an infinity or not-a-number to an unsigned
1762character, which makes no sense.
1763
eabfc7bc
RS
1764=item *
1765
1766L<Cannot pack %f with '%c'|perldiag/"Cannot pack %f with '%c'">
1767
c21a1c59
RS
1768(F) You tried converting an infinity or not-a-number to a character,
1769which makes no sense.
1770
eabfc7bc
RS
1771=item *
1772
1773L<Cannot print %f with '%c'|perldiag/"Cannot printf %f with '%c'">
1774
4ec8e6f0
KW
1775(F) You tried printing an infinity or not-a-number as a character (C<%c>),
1776which makes no sense. Maybe you meant C<'%s'>, or just stringifying it?
c21a1c59 1777
eabfc7bc
RS
1778=item *
1779
1780L<charnames alias definitions may not contain a sequence of multiple spaces|perldiag/"charnames alias definitions may not contain a sequence of multiple spaces">
1781
1782(F) You defined a character name which had multiple space
1783characters in a row. Change them to single spaces. Usually these
1784names are defined in the C<:alias> import argument to C<use charnames>, but
1785they could be defined by a translator installed into C<$^H{charnames}>.
1786See L<charnames/CUSTOM ALIASES>.
1787
1788=item *
1789
1790L<charnames alias definitions may not contain trailing white-space|perldiag/"charnames alias definitions may not contain trailing white-space">
1791
1792(F) You defined a character name which ended in a space
1793character. Remove the trailing space(s). Usually these names are
1794defined in the C<:alias> import argument to C<use charnames>, but they
1795could be defined by a translator installed into C<$^H{charnames}>.
1796See L<charnames/CUSTOM ALIASES>.
1797
1798=item *
1799
1800L<:const is not permitted on named subroutines|perldiag/":const is not permitted on named subroutines">
1801
1802(F) The "const" attribute causes an anonymous subroutine to be run and
f5b97b22 1803its value captured at the time that it is cloned. Named subroutines are
eabfc7bc
RS
1804not cloned like this, so the attribute does not make sense on them.
1805
1806=item *
1807
1808L<Hexadecimal float: internal error|perldiag/"Hexadecimal float: internal error">
1809
1810(F) Something went horribly bad in hexadecimal float handling.
1811
1812=item *
1813
1814L<Hexadecimal float: unsupported long double format|perldiag/"Hexadecimal float: unsupported long double format">
1815
1816(F) You have configured Perl to use long doubles but
1817the internals of the long double format are unknown,
1818therefore the hexadecimal float output is impossible.
1819
1820=item *
1821
1822L<Illegal suidscript|perldiag/"Illegal suidscript">
1823
1824(F) The script run under suidperl was somehow illegal.
1825
1826=item *
1827
1828L<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/">
1829
1830(F) The two-character sequence C<"(?"> in
1831this context in a regular expression pattern should be an
1832indivisible token, with nothing intervening between the C<"(">
1833and the C<"?">, but you separated them.
1834
1835=item *
1836
1837L<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/">
1838
1839(F) The two-character sequence C<"(*"> in
1840this context in a regular expression pattern should be an
1841indivisible token, with nothing intervening between the C<"(">
1842and the C<"*">, but you separated them.
1843
1844=item *
1845
1846L<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/">
1847
1848(F) The pattern looks like a {min,max} quantifier, but the min or max could not
1849be parsed as a valid number - either it has leading zeroes, or it represents
1850too big a number to cope with. The S<<-- HERE> shows where in the regular
1851expression the problem was discovered. See L<perlre>.
1852
1853=back
1854
1855=head3 New Warnings
1856
1857=over 4
1858
1859=item *
1860
43831b1f
DM
1861L<\C is deprecated in regex|perldiag/"\C is deprecated in regex; marked by <-- HERE in m/%s/">
1862
1863(D deprecated) The C<< /\C/ >> character class was deprecated in v5.20, and
1864now emits a warning. It is intended that it will become an error in v5.24.
1865This character class matches a single byte even if it appears within a
50ea4745 1866multi-byte character, breaks encapsulation, and can corrupt UTF-8
43831b1f
DM
1867strings.
1868
1869=item *
1870
eabfc7bc
RS
1871L<'%s' is an unknown bound type in regex|perldiag/"'%s' is an unknown bound type in regex; marked by <-- HERE in m/%s/">
1872
1873You used C<\b{...}> or C<\B{...}> and the C<...> is not known to
1874Perl. The current valid ones are given in
1875L<perlrebackslash/\b{}, \b, \B{}, \B>.
1876
1877=item *
1878
1879L<"%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>>
1880
1881(W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
1882
1883You specified a character that has the given plainer way of writing it,
1884and which is also portable to platforms running with different character
1885sets.
1886
1887=item *
1888
1889L<Argument "%s" treated as 0 in increment (++)|perldiag/"Argument "%s" treated
1890as 0 in increment (++)">
1891
1892(W numeric) The indicated string was fed as an argument to the C<++> operator
1893which expects either a number or a string matching C</^[a-zA-Z]*[0-9]*\z/>.
1894See L<perlop/Auto-increment and Auto-decrement> for details.
1895
1896=item *
1897
1898L<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/">
1899
1900(W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
1901
1902In a bracketed character class in a regular expression pattern, you
1903had a range which has exactly one end of it specified using C<\N{}>, and
1904the other end is specified using a non-portable mechanism. Perl treats
1905the range as a Unicode range, that is, all the characters in it are
1906considered to be the Unicode characters, and which may be different code
1907points on some platforms Perl runs on. For example, C<[\N{U+06}-\x08]>
1908is treated as if you had instead said C<[\N{U+06}-\N{U+08}]>, that is it
1909matches the characters whose code points in Unicode are 6, 7, and 8.
1910But that C<\x08> might indicate that you meant something different, so
1911the warning gets raised.
1912
1913=item *
1914
eabfc7bc
RS
1915L<:const is experimental|perldiag/":const is experimental">
1916
1917(S experimental::const_attr) The "const" attribute is experimental.
1918If you want to use the feature, disable the warning with C<no warnings
1919'experimental::const_attr'>, but know that in doing so you are taking
1920the risk that your code may break in a future Perl version.
1921
1922=item *
1923
1924L<gmtime(%f) failed|perldiag/"gmtime(%f) failed">
1925
1926(W overflow) You called C<gmtime> with a number that it could not handle:
1927too large, too small, or NaN. The returned value is C<undef>.
1928
1929=item *
1930
1931L<Hexadecimal float: exponent overflow|perldiag/"Hexadecimal float: exponent overflow">
1932
1933(W overflow) The hexadecimal floating point has larger exponent
1934than the floating point supports.
1935
1936=item *
1937
1938L<Hexadecimal float: exponent underflow|perldiag/"Hexadecimal float: exponent underflow">
1939
1940(W overflow) The hexadecimal floating point has smaller exponent
1941than the floating point supports.
1942
1943=item *
1944
1945L<Hexadecimal float: mantissa overflow|perldiag/"Hexadecimal float: mantissa overflow">
1946
1947(W overflow) The hexadecimal floating point literal had more bits in
1948the mantissa (the part between the 0x and the exponent, also known as
1949the fraction or the significand) than the floating point supports.
1950
1951=item *
1952
1953L<Hexadecimal float: precision loss|perldiag/"Hexadecimal float: precision loss">
1954
1955(W overflow) The hexadecimal floating point had internally more
1956digits than could be output. This can be caused by unsupported
1957long double formats, or by 64-bit integers not being available
1958(needed to retrieve the digits under some configurations).
1959
eabfc7bc
RS
1960=item *
1961
1962L<localtime(%f) failed|perldiag/"localtime(%f) failed">
1963
1964(W overflow) You called C<localtime> with a number that it could not handle:
1965too large, too small, or NaN. The returned value is C<undef>.
1966
1967=item *
1968
1969L<Negative repeat count does nothing|perldiag/"Negative repeat count does nothing">
1970
1971(W numeric) You tried to execute the
1972L<C<x>|perlop/Multiplicative Operators> repetition operator fewer than 0
1973times, which doesn't make sense.
1974
1975=item *
1976
1977L<NO-BREAK SPACE in a charnames alias definition is deprecated|perldiag/"NO-BREAK SPACE in a charnames alias definition is deprecated">
1978
1979(D deprecated) You defined a character name which contained a no-break
1980space character. Change it to a regular space. Usually these names are
1981defined in the C<:alias> import argument to C<use charnames>, but they
1982could be defined by a translator installed into C<$^H{charnames}>. See
1983L<charnames/CUSTOM ALIASES>.
1984
1985=item *
1986
1987L<Non-finite repeat count does nothing|perldiag/"Non-finite repeat count does nothing">
1988
1989(W numeric) You tried to execute the
1990L<C<x>|perlop/Multiplicative Operators> repetition operator C<Inf> (or
3209f716 1991C<-Inf>) or NaN times, which doesn't make sense.
eabfc7bc
RS
1992
1993=item *
1994
1995L<PerlIO layer ':win32' is experimental|perldiag/"PerlIO layer ':win32' is experimental">
1996
1997(S experimental::win32_perlio) The C<:win32> PerlIO layer is
1998experimental. If you want to take the risk of using this layer,
1999simply disable this warning:
2000
2001 no warnings "experimental::win32_perlio";
2002
2003=item *
2004
2005L<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>">
2006
2007(W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
2008
2009Stricter rules help to find typos and other errors. Perhaps you didn't
2010even intend a range here, if the C<"-"> was meant to be some other
2011character, or should have been escaped (like C<"\-">). If you did
2012intend a range, the one that was used is not portable between ASCII and
2013EBCDIC platforms, and doesn't have an obvious meaning to a casual
2014reader.
2015
2016 [3-7] # OK; Obvious and portable
2017 [d-g] # OK; Obvious and portable
2018 [A-Y] # OK; Obvious and portable
2019 [A-z] # WRONG; Not portable; not clear what is meant
2020 [a-Z] # WRONG; Not portable; not clear what is meant
2021 [%-.] # WRONG; Not portable; not clear what is meant
2022 [\x41-Z] # WRONG; Not portable; not obvious to non-geek
2023
2024(You can force portability by specifying a Unicode range, which means that
2025the endpoints are specified by
2026L<C<\N{...}>|perlrecharclass/Character Ranges>, but the meaning may
2027still not be obvious.)
2028The stricter rules require that ranges that start or stop with an ASCII
93780ae6 2029character that is not a control have all their endpoints be a literal
eabfc7bc
RS
2030character, and not some escape sequence (like C<"\x41">), and the ranges
2031must be all digits, or all uppercase letters, or all lowercase letters.
2032
2033=item *
2034
2035L<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/">
2036
2037(W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
2038
2039Stricter rules help to find typos and other errors. You included a
2040range, and at least one of the end points is a decimal digit. Under the
2041stricter rules, when this happens, both end points should be digits in
2042the same group of 10 consecutive digits.
2043
2044=item *
2045
2046L<Redundant argument in %s|perldiag/Redundant argument in %s>
2047
f5b97b22
DM
2048(W redundant) You called a function with more arguments than were
2049needed, as indicated by information within other arguments you supplied
2050(e.g. a printf format). Currently only emitted when a printf-type format
2051required fewer arguments than were supplied, but might be used in the
2052future for e.g. L<perlfunc/pack>.
eabfc7bc 2053
a75e6a3a
SH
2054The warnings category C<< redundant >> is new. See also
2055L<[perl #121025]|https://rt.perl.org/Ticket/Display.html?id=121025>.
eabfc7bc
RS
2056
2057=item *
2058
2059L<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">
2060
2061You are matching a regular expression using locale rules,
2062and a Unicode boundary is being matched, but the locale is not a Unicode
2063one. This doesn't make sense. Perl will continue, assuming a Unicode
2064(UTF-8) locale, but the results could well be wrong except if the locale
2065happens to be ISO-8859-1 (Latin1) where this message is spurious and can
2066be ignored.
2067
2068=item *
2069
2070L<< 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>" >>
2071
2072You used a Unicode boundary (C<\b{...}> or C<\B{...}>) in a
2073portion of a regular expression where the character set modifiers C</a>
2074or C</aa> are in effect. These two modifiers indicate an ASCII
2075interpretation, and this doesn't make sense for a Unicode definition.
2076The generated regular expression will compile so that the boundary uses
2077all of Unicode. No other portion of the regular expression is affected.
2078
2079=item *
2080
2081L<The bitwise feature is experimental|perldiag/"The bitwise feature is experimental">
2082
2083This warning is emitted if you use bitwise
2084operators (C<& | ^ ~ &. |. ^. ~.>) with the "bitwise" feature enabled.
2085Simply suppress the warning if you want to use the feature, but know
2086that in doing so you are taking the risk of using an experimental
2087feature which may change or be removed in a future Perl version:
2088
2089 no warnings "experimental::bitwise";
2090 use feature "bitwise";
2091 $x |.= $y;
2092
2093=item *
2094
2095L<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/">
2096
2097(D deprecated, regexp) You used a literal C<"{"> character in a regular
2098expression pattern. You should change to use C<"\{"> instead, because a future
2099version of Perl (tentatively v5.26) will consider this to be a syntax error. If
2100the pattern delimiters are also braces, any matching right brace
2101(C<"}">) should also be escaped to avoid confusing the parser, for
2102example,
2103
2104 qr{abc\{def\}ghi}
2105
2106=item *
2107
2108L<Use of literal non-graphic characters in variable names is deprecated|perldiag/"Use of literal non-graphic characters in variable names is deprecated">
2109
b0511669
DM
2110(D deprecated) Using literal non-graphic (including control)
2111characters in the source to refer to the ^FOO variables, like C<$^X> and
2112C<${^GLOBAL_PHASE}> is now deprecated.
2113
eabfc7bc
RS
2114=item *
2115
2116L<Useless use of attribute "const"|perldiag/Useless use of attribute "const">
2117
2118(W misc) The "const" attribute has no effect except
2119on anonymous closure prototypes. You applied it to
2120a subroutine via L<attributes.pm|attributes>. This is only useful
2121inside an attribute handler for an anonymous subroutine.
2122
2123=item *
2124
2125L<E<quot>use re 'strict'E<quot> is experimental|perldiag/"use re 'strict'" is experimental>
2126
2127(S experimental::re_strict) The things that are different when a regular
2128expression pattern is compiled under C<'strict'> are subject to change
3b50e657
KW
2129in future Perl releases in incompatible ways; there are also proposals
2130to change how to enable strict checking instead of using this subpragma.
2131This means that a pattern that compiles today may not in a future Perl
2132release. This warning is to alert you to that risk.
eabfc7bc
RS
2133
2134=item *
2135
caa16dbd
TC
2136L<Warning: unable to close filehandle properly: %s|perldiag/"Warning: unable to close filehandle properly: %s">
2137
eabfc7bc
RS
2138L<Warning: unable to close filehandle %s properly: %s|perldiag/"Warning: unable to close filehandle %s properly: %s">
2139
3b50e657 2140(S io) Previously, perl silently ignored any errors when doing an implicit
b0511669
DM
2141close of a filehandle, i.e. where the reference count of the filehandle
2142reached zero and the user's code hadn't already called C<close()>; e.g.
2143
2144 {
2145 open my $fh, '>', $file or die "open: '$file': $!\n";
2146 print $fh, $data or die;
2147 } # implicit close here
2148
3b50e657 2149In a situation such as disk full, due to buffering, the error may only be
b0511669
DM
2150detected during the final close, so not checking the result of the close is
2151dangerous.
2152
2153So perl now warns in such situations.
caa16dbd 2154
eabfc7bc
RS
2155=item *
2156
2157L<Wide character (U+%X) in %s|perldiag/"Wide character (U+%X) in %s">
2158
2159(W locale) While in a single-byte locale (I<i.e.>, a non-UTF-8
2160one), a multi-byte character was encountered. Perl considers this
50ea4745 2161character to be the specified Unicode code point. Combining non-UTF-8
eabfc7bc
RS
2162locales and Unicode is dangerous. Almost certainly some characters
2163will have two different representations. For example, in the ISO 8859-7
2164(Greek) locale, the code point 0xC3 represents a Capital Gamma. But so
2165also does 0x393. This will make string comparisons unreliable.
2166
2167You likely need to figure out how this multi-byte character got mixed up
2168with your single-byte locale (or perhaps you thought you had a UTF-8
2169locale, but Perl disagrees).
2170
2171=item *
2172
2173The following two warnings for C<tr///> used to be skipped if the
2174transliteration contained wide characters, but now they occur regardless of
2175whether there are wide characters or not:
2176
2177L<Useless use of E<sol>d modifier in transliteration operator|perldiag/"Useless use of /d modifier in transliteration operator">
2178
2179L<Replacement list is longer than search list|perldiag/Replacement list is longer than search list>
2180
2181=item *
2182
2183A new C<locale> warning category has been created, with the following warning
2184messages currently in it:
2185
2186=over 4
2187
2188=item *
2189
2190L<Locale '%s' may not work well.%s|perldiag/Locale '%s' may not work well.%s>
2191
b0511669
DM
2192(W locale) You are using the named locale, which is a non-UTF-8 one, and
2193which Perl has determined is not fully compatible with Perl. The second
2194C<%s> gives a reason.
2195
eabfc7bc
RS
2196=item *
2197
2198L<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".>
2199
b0511669
DM
2200(W locale) You are 1) running under "C<use locale>"; 2) the current
2201locale is not a UTF-8 one; 3) you tried to do the designated case-change
2202operation on the specified Unicode character; and 4) the result of this
2203operation would mix Unicode and locale rules, which likely conflict.
2204
eabfc7bc
RS
2205=back
2206
b0511669
DM
2207=item *
2208
2209L<Missing or undefined argument to require|perldiag/Missing or undefined argument to require>
2210
3209f716
KW
2211(F) You tried to call C<require> with no argument or with an undefined
2212value as an argument. C<require> expects either a package name or a
b0511669
DM
2213file-specification as an argument. See L<perlfunc/require>.
2214
3209f716 2215Formerly, C<require> with no argument or C<undef> warned about a Null filename.
b0511669 2216
eabfc7bc
RS
2217=back
2218
2219=head2 Changes to Existing Diagnostics
2220
2221=over 4
2222
2223=item *
2224
2225<> should be quotes
2226
2227This warning has been changed to
2228L<< <> at require-statement should be quotes|perldiag/"<> at require-statement should be quotes" >>
2229to make the issue more identifiable.
2230
2231=item *
2232
2233L<Argument "%s" isn't numeric%s|perldiag/"Argument "%s" isn't numeric%s">
b0511669
DM
2234
2235The L<perldiag> entry for this warning has added this clarifying note:
eabfc7bc 2236
4ec8e6f0 2237 Note that for the Inf and NaN (infinity and not-a-number) the
77c2376a
KW
2238 definition of "numeric" is somewhat unusual: the strings themselves
2239 (like "Inf") are considered numeric, and anything following them is
2240 considered non-numeric.
eabfc7bc
RS
2241
2242=item *
2243
2244L<Global symbol "%s" requires explicit package name|perldiag/"Global symbol "%s" requires explicit package name (did you forget to declare "my %s"?)">
2245
2246This message has had '(did you forget to declare "my %s"?)' appended to it, to
2247make it more helpful to new Perl programmers.
2248L<[perl #121638]|https://rt.perl.org/Ticket/Display.html?id=121638>
2249
2250=item *
2251
2252'"my" variable &foo::bar can't be in a package' has been reworded to say
2253'subroutine' instead of 'variable'.
2254
2255=item *
2256
b0511669
DM
2257L<<< \N{} in character class restricted to one character in regex; marked by
2258S<< <-- HERE >> in mE<sol>%sE<sol>|perldiag/"\N{} in inverted character
2259class or as a range end-point is restricted to one character in regex;
2260marked by <-- HERE in m/%s/" >>>
eabfc7bc 2261
b0511669
DM
2262This message has had I<character class> changed to I<inverted character
2263class or as a range end-point is> to reflect improvements in
2264C<qr/[\N{named sequence}]/> (see under L</Selected Bug Fixes>).
eabfc7bc
RS
2265
2266=item *
2267
2268L<panic: frexp|perldiag/"panic: frexp: %f">
2269
b0511669
DM
2270This message has had ': C<%f>' appended to it, to show what the offending
2271floating point number is.
eabfc7bc
RS
2272
2273=item *
2274
b0511669 2275I<Possible precedence problem on bitwise %c operator> reworded as
eabfc7bc
RS
2276L<Possible precedence problem on bitwise %s operator|perldiag/"Possible precedence problem on bitwise %s operator">.
2277
2278=item *
2279
eabfc7bc
RS
2280L<Unsuccessful %s on filename containing newline|perldiag/"Unsuccessful %s on filename containing newline">
2281
2282This warning is now only produced when the newline is at the end of
2283the filename.
2284
2285=item *
2286
4ec8e6f0 2287"Variable C<%s> will not stay shared" has been changed to say "Subroutine"
eabfc7bc
RS
2288when it is actually a lexical sub that will not stay shared.
2289
2290=item *
2291
2292L<Variable length lookbehind not implemented in regex mE<sol>%sE<sol>|perldiag/"Variable length lookbehind not implemented in regex m/%s/">
2293
b0511669
DM
2294The L<perldiag> entry for this warning has had information about Unicode
2295behaviour added.
eabfc7bc
RS
2296
2297=back
2298
2299=head2 Diagnostic Removals
2300
2301=over
2302
2303=item *
2304
2305"Ambiguous use of -foo resolved as -&foo()"
2306
2307There is actually no ambiguity here, and this impedes the use of negated
2308constants; e.g., C<-Inf>.
2309
2310=item *
2311
2312"Constant is not a FOO reference"
2313
2314Compile-time checking of constant dereferencing (e.g., C<< my_constant->() >>)
2315has been removed, since it was not taking overloading into account.
2316L<[perl #69456]|https://rt.perl.org/Ticket/Display.html?id=69456>
2317L<[perl #122607]|https://rt.perl.org/Ticket/Display.html?id=122607>
2318
2319=back
2320
2321=head1 Utility Changes
2322
b0511669 2323=head2 F<find2perl>, F<s2p> and F<a2p> removal
eabfc7bc
RS
2324
2325=over 4
2326
2327=item *
2328
2329The F<x2p/> directory has been removed from the Perl core.
2330
2331This removes find2perl, s2p and a2p. They have all been released to CPAN as
2332separate distributions (App::find2perl, App::s2p, App::a2p).
2333
2334=back
2335
2336=head2 L<h2ph>
2337
2338=over 4
2339
2340=item *
2341
2342F<h2ph> now handles hexadecimal constants in the compiler's predefined
a75e6a3a
SH
2343macro definitions, as visible in C<$Config{cppsymbols}>.
2344L<[perl #123784]|https://rt.perl.org/Ticket/Display.html?id=123784>.
eabfc7bc
RS
2345
2346=back
2347
2348=head2 L<encguess>
2349
2350=over 4
2351
2352=item *
2353
f1c9eac6 2354No longer depends on non-core modules.
eabfc7bc
RS
2355
2356=back
2357
2358=head1 Configuration and Compilation
2359
2360=over 4
2361
2362=item *
2363
b0511669
DM
2364F<Configure> now checks for C<lrintl()>, C<lroundl()>, C<llrintl()>, and
2365C<llroundl()>.
eabfc7bc
RS
2366
2367=item *
2368
a75e6a3a
SH
2369F<Configure> with C<-Dmksymlinks> should now be faster.
2370L<[perl #122002]|https://rt.perl.org/Ticket/Display.html?id=122002>.
eabfc7bc
RS
2371
2372=item *
2373
b0511669
DM
2374The C<pthreads> and C<cl> libraries will be linked by default if present.
2375This allows XS modules that require threading to work on non-threaded
2376perls. Note that you must still pass C<-Dusethreads> if you want a
2377threaded perl.
eabfc7bc
RS
2378
2379=item *
2380
2381For long doubles (to get more precision and range for floating point numbers)
2382one can now use the GCC quadmath library which implements the quadruple
f1c9eac6
DM
2383precision floating point numbers on x86 and IA-64 platforms. See
2384F<INSTALL> for details.
eabfc7bc
RS
2385
2386=item *
2387
2388MurmurHash64A and MurmurHash64B can now be configured as the internal hash
2389function.
2390
2391=item *
2392
2393C<make test.valgrind> now supports parallel testing.
2394
2395For example:
2396
2397 TEST_JOBS=9 make test.valgrind
2398
2399See L<perlhacktips/valgrind> for more information.
2400
2401L<[perl #121431]|https://rt.perl.org/Ticket/Display.html?id=121431>
2402
2403=item *
2404
2405The MAD (Misc Attribute Decoration) build option has been removed
2406
2407This was an unmaintained attempt at preserving
2408the Perl parse tree more faithfully so that automatic conversion of
2409Perl 5 to Perl 6 would have been easier.
2410
2411This build-time configuration option had been unmaintained for years,
2412and had probably seriously diverged on both Perl 5 and Perl 6 sides.
2413
2414=item *
2415
2416A new compilation flag, C<< -DPERL_OP_PARENT >> is available. For details,
2417see the discussion below at L<< /Internal Changes >>.
2418
43831b1f
DM
2419=item *
2420
2421Pathtools no longer tries to load XS on miniperl. This speeds up building perl
2422slightly.
2423
eabfc7bc
RS
2424=back
2425
2426=head1 Testing
2427
2428=over 4
2429
2430=item *
2431
2432F<t/porting/re_context.t> has been added to test that L<utf8> and its
2433dependencies only use the subset of the C<$1..$n> capture vars that
b0511669
DM
2434C<Perl_save_re_context()> is hard-coded to localize, because that function
2435has no efficient way of determining at runtime what vars to localize.
eabfc7bc
RS
2436
2437=item *
2438
2439Tests for performance issues have been added in the file F<t/perf/taint.t>.
2440
2441=item *
2442
2443Some regular expression tests are written in such a way that they will
2444run very slowly if certain optimizations break. These tests have been
2445moved into new files, F<< t/re/speed.t >> and F<< t/re/speed_thr.t >>,
2446and are run with a C<< watchdog() >>.
2447
2448=item *
2449
2450C<< test.pl >> now allows C<< plan skip_all => $reason >>, to make it
2451more compatible with C<< Test::More >>.
2452
2453=item *
2454
3b50e657 2455A new test script, F<op/infnan.t>, has been added to test if infinity and NaN are
eabfc7bc
RS
2456working correctly. See L</Infinity and NaN (not-a-number) handling improved>.
2457
2458=back
2459
2460=head1 Platform Support
2461
2462=head2 Regained Platforms
2463
2464=over 4
2465
2466=item IRIX and Tru64 platforms are working again.
2467
2468(Some C<make test> failures remain.)
2469
2470=item z/OS running EBCDIC Code Page 1047
2471
2472Core perl now works on this EBCDIC platform. Earlier perls also worked, but,
2473even though support wasn't officially withdrawn, recent perls would not compile
2474and run well. Perl 5.20 would work, but had many bugs which have now been
2475fixed. Many CPAN modules that ship with Perl still fail tests, including
2476Pod::Simple. However the version of Pod::Simple currently on CPAN should work;
2477it was fixed too late to include in Perl 5.22. Work is under way to fix many
2478of the still-broken CPAN modules, which likely will be installed on CPAN when
2479completed, so that you may not have to wait until Perl 5.24 to get a working
2480version.
2481
2482=back
2483
2484=head2 Discontinued Platforms
2485
2486=over 4
2487
2488=item NeXTSTEP/OPENSTEP
2489
f1c9eac6
DM
2490NeXTSTEP was a proprietary operating system bundled with NeXT's
2491workstations in the early to mid 90s; OPENSTEP was an API specification
2492that provided a NeXTSTEP-like environment on a non-NeXTSTEP system. Both
2493are now long dead, so support for building Perl on them has been removed.
eabfc7bc
RS
2494
2495=back
2496
2497=head2 Platform-Specific Notes
2498
2499=over 4
2500
2501=item EBCDIC
2502
3b50e657
KW
2503Special handling is required of the perl interpreter on EBCDIC platforms
2504to get C<qr/[i-j]/> to match only C<"i"> and C<"j">, since there are 7
2505characters between the
eabfc7bc
RS
2506code points for C<"i"> and C<"j">. This special handling had only been
2507invoked when both ends of the range are literals. Now it is also
2508invoked if any of the C<\N{...}> forms for specifying a character by
2509name or Unicode code point is used instead of a literal. See
2510L<perlrecharclass/Character Ranges>.
2511
2512=item HP-UX
2513
2514The archname now distinguishes use64bitint from use64bitall.
2515
2516=item Android
2517
2518Build support has been improved for cross-compiling in general and for
2519Android in particular.
2520
2521=item VMS
2522
2523=over 4
2524
2525=item *
2526
2527When spawning a subprocess without waiting, the return value is now
2528the correct PID.
2529
2530=item *
2531
2532Fix a prototype so linking doesn't fail under the VMS C++ compiler.
2533
2534=item *
2535
2536C<finite>, C<finitel>, and C<isfinite> detection has been added to
2537C<configure.com>, environment handling has had some minor changes, and
2538a fix for legacy feature checking status.
2539
2540=back
2541
2542=item Win32
2543
2544=over 4
2545
2546=item *
2547
2548F<miniperl.exe> is now built with C<-fno-strict-aliasing>, allowing 64-bit
2549builds to complete on GCC 4.8.
2550L<[perl #123976]|https://rt.perl.org/Ticket/Display.html?id=123976>
2551
2552=item *
2553
17fcdc49
TC
2554C<nmake minitest> now works on Win32. Due to dependency issues you
2555need to build C<nmake test-prep> first, and a small number of the
2556tests fail.
2557L<[perl #123394]|https://rt.perl.org/Ticket/Display.html?id=123394>
2558
2559=item *
2560
eabfc7bc
RS
2561Perl can now be built in C++ mode on Windows by setting the makefile macro
2562C<USE_CPLUSPLUS> to the value "define".
2563
2564=item *
2565
d140c31c 2566The list form of piped open has been implemented for Win32. Note: unlike
00eebae1 2567C<system LIST> this does not fall back to the shell.
18f4cc8e 2568L<[perl #121159]|https://rt.perl.org/Ticket/Display.html?id=121159>
eabfc7bc
RS
2569
2570=item *
2571
eabfc7bc
RS
2572New C<DebugSymbols> and C<DebugFull> configuration options added to
2573Windows makefiles.
2574
2575=item *
2576
f1c9eac6 2577Previously compiling XS modules (including CPAN ones) using Visual C++ for
b0511669 2578Win64 resulted in around a dozen warnings per file from F<hv_func.h>. These
f1c9eac6 2579warnings have been silenced.
eabfc7bc
RS
2580
2581=item *
2582
2583Support for building without PerlIO has been removed from the Windows
2584makefiles. Non-PerlIO builds were all but deprecated in Perl 5.18.0 and are
2585already not supported by F<Configure> on POSIX systems.
2586
2587=item *
2588
d140c31c
AC
2589Between 2 and 6 milliseconds and seven I/O calls have been saved per attempt
2590to open a perl module for each path in C<@INC>.
eabfc7bc
RS
2591
2592=item *
2593
2594Intel C builds are now always built with C99 mode on.
2595
2596=item *
2597
2598C<%I64d> is now being used instead of C<%lld> for MinGW.
2599
2600=item *
2601
2602In the experimental C<:win32> layer, a crash in C<open> was fixed. Also
3209f716 2603opening F</dev/null> (which works under Win32 Perl's default C<:unix>
d140c31c 2604layer) was implemented for C<:win32>.
eabfc7bc
RS
2605L<[perl #122224]|https://rt.perl.org/Ticket/Display.html?id=122224>
2606
2607=item *
2608
2609A new makefile option, C<USE_LONG_DOUBLE>, has been added to the Windows
2610dmake makefile for gcc builds only. Set this to "define" if you want perl to
2611use long doubles to give more accuracy and range for floating point numbers.
2612
2613=back
2614
2615=item OpenBSD
2616
2617On OpenBSD, Perl will now default to using the system C<malloc> due to the
2618security features it provides. Perl's own malloc wrapper has been in use
2619since v5.14 due to performance reasons, but the OpenBSD project believes
2620the tradeoff is worth it and would prefer that users who need the speed
2621specifically ask for it.
2622
2623L<[perl #122000]|https://rt.perl.org/Ticket/Display.html?id=122000>.
2624
2625=item Solaris
2626
2627=over 4
2628
2629=item *
2630
2631We now look for the Sun Studio compiler in both F</opt/solstudio*> and
2632F</opt/solarisstudio*>.
2633
2634=item *
2635
2636Builds on Solaris 10 with C<-Dusedtrace> would fail early since make
2637didn't follow implied dependencies to build C<perldtrace.h>. Added an
2638explicit dependency to C<depend>.
2639L<[perl #120120]|https://rt.perl.org/Ticket/Display.html?id=120120>
2640
2641=item *
2642
d140c31c
AC
2643C<c99> options have been cleaned up; hints look for C<solstudio>
2644as well as C<SUNWspro>; and support for native C<setenv> has been added.
eabfc7bc
RS
2645
2646=back
2647
2648=back
2649
2650=head1 Internal Changes
2651
2652=over 4
2653
2654=item *
2655
bad0181b
DM
2656Experimental support has been added to allow ops in the optree to locate
2657their parent, if any. This is enabled by the non-default build option
2658C<-DPERL_OP_PARENT>. It is envisaged that this will eventually become
b0511669 2659enabled by default, so XS code which directly accesses the C<op_sibling>
bad0181b 2660field of ops should be updated to be future-proofed.
eabfc7bc
RS
2661
2662On C<PERL_OP_PARENT> builds, the C<op_sibling> field has been renamed
bad0181b
DM
2663C<op_sibparent> and a new flag, C<op_moresib>, added. On the last op in a
2664sibling chain, C<op_moresib> is false and C<op_sibparent> points to the
b0511669 2665parent (if any) rather than being C<NULL>.
bad0181b 2666
b0511669 2667To make existing code work transparently whether using C<PERL_OP_PARENT>
bad0181b
DM
2668or not, a number of new macros and functions have been added that should
2669be used, rather than directly manipulating C<op_sibling>.
2670
2671For the case of just reading C<op_sibling> to determine the next sibling,
2672two new macros have been added. A simple scan through a sibling chain
2673like this:
2674
b0511669 2675 for (; kid->op_sibling; kid = kid->op_sibling) { ... }
bad0181b
DM
2676
2677should now be written as:
2678
b0511669 2679 for (; OpHAS_SIBLING(kid); kid = OpSIBLING(kid)) { ... }
bad0181b 2680
d140c31c 2681For altering optrees, a general-purpose function C<op_sibling_splice()>
bad0181b
DM
2682has been added, which allows for manipulation of a chain of sibling ops.
2683By analogy with the Perl function C<splice()>, it allows you to cut out
2684zero or more ops from a sibling chain and replace them with zero or more
2685new ops. It transparently handles all the updating of sibling, parent,
2686op_last pointers etc.
2687
2688If you need to manipulate ops at a lower level, then three new macros,
2689C<OpMORESIB_set>, C<OpLASTSIB_set> and C<OpMAYBESIB_set> are intended to
2690be a low-level portable way to set C<op_sibling> / C<op_sibparent> while
2691also updating C<op_moresib>. The first sets the sibling pointer to a new
2692sibling, the second makes the op the last sibling, and the third
2693conditionally does the first or second action. Note that unlike
2694C<op_sibling_splice()> these macros won't maintain consistency in the
2695parent at the same time (e.g. by updating C<op_first> and C<op_last> where
2696appropriate).
2697
d140c31c 2698A C-level C<Perl_op_parent()> function and a Perl-level C<B::OP::parent()>
bad0181b 2699method have been added. The C function only exists under
b0511669 2700C<PERL_OP_PARENT> builds (using it is build-time error on vanilla
bad0181b 2701perls). C<B::OP::parent()> exists always, but on a vanilla build it
b0511669 2702always returns C<NULL>. Under C<PERL_OP_PARENT>, they return the parent
bad0181b
DM
2703of the current op, if any. The variable C<$B::OP::does_parent> allows you
2704to determine whether C<B> supports retrieving an op's parent.
2705
b0511669 2706C<PERL_OP_PARENT> was introduced in 5.21.2, but the interface was
bad0181b
DM
2707changed considerably in 5.21.11. If you updated your code before the
27085.21.11 changes, it may require further revision. The main changes after
27095.21.2 were:
eabfc7bc 2710
bad0181b 2711=over 4
eabfc7bc
RS
2712
2713=item *
2714
bad0181b
DM
2715The C<OP_SIBLING> and C<OP_HAS_SIBLING> macros have been renamed
2716C<OpSIBLING> and C<OpHAS_SIBLING> for consistency with other
2717op-manipulating macros.
eabfc7bc
RS
2718
2719=item *
2720
bad0181b
DM
2721The C<op_lastsib> field has been renamed C<op_moresib>, and its meaning
2722inverted.
eabfc7bc
RS
2723
2724=item *
2725
bad0181b
DM
2726The macro C<OpSIBLING_set> has been removed, and has been superseded by
2727C<OpMORESIB_set> et al.
eabfc7bc
RS
2728
2729=item *
2730
bad0181b
DM
2731The C<op_sibling_splice()> function now accepts a null C<parent> argument
2732where the splicing doesn't affect the first or last ops in the sibling
2733chain
eabfc7bc
RS
2734
2735=back
2736
2737=item *
2738
2739Macros have been created to allow XS code to better manipulate the POSIX locale
2740category C<LC_NUMERIC>. See L<perlapi/Locale-related functions and macros>.
2741
2742=item *
2743
2744The previous C<atoi> et al replacement function, C<grok_atou>, has now been
2745superseded by C<grok_atoUV>. See L<perlclib> for details.
2746
2747=item *
2748
b0511669
DM
2749A new function, C<Perl_sv_get_backrefs()>, has been added which allows you
2750retrieve the weak references, if any, which point at an SV.
eabfc7bc
RS
2751
2752=item *
2753
b0511669 2754The C<screaminstr()> function has been removed. Although marked as
f1c9eac6
DM
2755public API, it was undocumented and had no usage in CPAN modules. Calling
2756it has been fatal since 5.17.0.
eabfc7bc
RS
2757
2758=item *
2759
b0511669
DM
2760The C<newDEFSVOP()>, C<block_start()>, C<block_end()> and C<intro_my()>
2761functions have been added to the API.
eabfc7bc
RS
2762
2763=item *
2764
2765The internal C<convert> function in F<op.c> has been renamed
2766C<op_convert_list> and added to the API.
2767
2768=item *
2769
b0511669
DM
2770The C<sv_magic()> function no longer forbids "ext" magic on read-only
2771values. After all, perl can't know whether the custom magic will modify
2772the SV or not.
a75e6a3a 2773L<[perl #123103]|https://rt.perl.org/Ticket/Display.html?id=123103>.
eabfc7bc
RS
2774
2775=item *
2776
d140c31c
AC
2777Accessing L<perlapi/CvPADLIST> on an XSUB is now forbidden.
2778
cca58a48
DM
2779The C<CvPADLIST> field has been reused for a different internal purpose
2780for XSUBs. So in particular, you can no longer rely on it being NULL as a
2781test of whether a CV is an XSUB. Use C<CvISXSUB()> instead.
2782
eabfc7bc
RS
2783=item *
2784
b0511669 2785SVs of type C<SVt_NV> are now sometimes bodiless when the build
cca58a48 2786configuration and platform allow it: specifically, when C<< sizeof(NV) <=
b0511669 2787sizeof(IV) >>. "Bodiless" means that the NV value is stored directly in
cca58a48
DM
2788the head of an SV, without requiring a separate body to be allocated. This
2789trick has already been used for IVs since 5.9.2 (though in the case of
2790IVs, it is always used, regardless of platform and build configuration).
eabfc7bc
RS
2791
2792=item *
2793
b0511669 2794The C<$DB::single>, C<$DB::signal> and C<$DB::trace> variables now have set- and
d140c31c 2795get-magic that stores their values as IVs, and those IVs are used when
b0511669 2796testing their values in C<pp_dbstate()>. This prevents perl from
f1c9eac6 2797recursing infinitely if an overloaded object is assigned to any of those
a75e6a3a
SH
2798variables.
2799L<[perl #122445]|https://rt.perl.org/Ticket/Display.html?id=122445>.
eabfc7bc
RS
2800
2801=item *
2802
b0511669 2803C<Perl_tmps_grow()>, which is marked as public API but is undocumented, has
d140c31c 2804been removed from the public API. This change does not affect XS code that
b0511669 2805uses the C<EXTEND_MORTAL> macro to pre-extend the mortal stack.
eabfc7bc
RS
2806
2807=item *
2808
b0511669
DM
2809Perl's internals no longer sets or uses the C<SVs_PADMY> flag.
2810C<SvPADMY()> now returns a true value for anything not marked C<PADTMP>
2811and C<SVs_PADMY> is now defined as 0.
eabfc7bc
RS
2812
2813=item *
2814
d140c31c 2815The macros C<SETsv> and C<SETsvUN> have been removed. They were no longer used
b0511669
DM
2816in the core since commit 6f1401dc2a five years ago, and have not been
2817found present on CPAN.
eabfc7bc
RS
2818
2819=item *
2820
2821The C<< SvFAKE >> bit (unused on HVs) got informally reserved by
2822David Mitchell for future work on vtables.
2823
2824=item *
2825
b0511669 2826The C<sv_catpvn_flags()> function accepts C<SV_CATBYTES> and C<SV_CATUTF8>
50ea4745 2827flags, which specify whether the appended string is bytes or UTF-8,
b0511669
DM
2828respectively. (These flags have in fact been present since 5.16.0, but
2829were formerly not regarded as part of the API.)
eabfc7bc
RS
2830
2831=item *
2832
f1c9eac6 2833A new opcode class, C<< METHOP >>, has been introduced. It holds
d140c31c 2834information used at runtime for improve the performance
eabfc7bc
RS
2835of class/object method calls.
2836
d140c31c 2837C<< OP_METHOD >> and C<< OP_METHOD_NAMED >> have changed from being
eabfc7bc
RS
2838C<< UNOP/SVOP >> to being C<< METHOP >>.
2839
2840=item *
2841
b0511669
DM
2842C<cv_name()> is a new API function that can be passed a CV or GV. It
2843returns an SV containing the name of the subroutine, for use in
2844diagnostics.
eabfc7bc 2845
eabfc7bc
RS
2846L<[perl #116735]|https://rt.perl.org/Ticket/Display.html?id=116735>
2847L<[perl #120441]|https://rt.perl.org/Ticket/Display.html?id=120441>
2848
2849=item *
2850
b0511669
DM
2851C<cv_set_call_checker_flags()> is a new API function that works like
2852C<cv_set_call_checker()>, except that it allows the caller to specify
2853whether the call checker requires a full GV for reporting the subroutine's
2854name, or whether it could be passed a CV instead. Whatever value is
2855passed will be acceptable to C<cv_name()>. C<cv_set_call_checker()>
2856guarantees there will be a GV, but it may have to create one on the fly,
2857which is inefficient.
eabfc7bc
RS
2858L<[perl #116735]|https://rt.perl.org/Ticket/Display.html?id=116735>
2859
2860=item *
2861
2862C<CvGV> (which is not part of the API) is now a more complex macro, which may
b0511669 2863call a function and reify a GV. For those cases where it has been used as a
eabfc7bc
RS
2864boolean, C<CvHASGV> has been added, which will return true for CVs that
2865notionally have GVs, but without reifying the GV. C<CvGV> also returns a GV
2866now for lexical subs.
2867L<[perl #120441]|https://rt.perl.org/Ticket/Display.html?id=120441>
2868
2869=item *
2870
d140c31c
AC
2871The L<perlapi/sync_locale> function has been added to the public API.
2872Changing the program's locale should be avoided by XS code. Nevertheless,
2873certain non-Perl libraries called from XS need to do so, such as C<Gtk>.
2874When this happens, Perl needs to be told that the locale has
eabfc7bc
RS
2875changed. Use this function to do so, before returning to Perl.
2876
2877=item *
2878
2879The defines and labels for the flags in the C<op_private> field of OPs are now
2880auto-generated from data in F<regen/op_private>. The noticeable effect of this
2881is that some of the flag output of C<Concise> might differ slightly, and the
3209f716 2882flag output of S<C<perl -Dx>> may differ considerably (they both use the same set
d140c31c
AC
2883of labels now). Also, debugging builds now have a new assertion in
2884C<op_free()> to ensure that the op doesn't have any unrecognized flags set in
eabfc7bc
RS
2885C<op_private>.
2886
2887=item *
2888
eabfc7bc
RS
2889The deprecated variable C<PL_sv_objcount> has been removed.
2890
2891=item *
2892
2893Perl now tries to keep the locale category C<LC_NUMERIC> set to "C"
2894except around operations that need it to be set to the program's
2895underlying locale. This protects the many XS modules that cannot cope
2896with the decimal radix character not being a dot. Prior to this
2897release, Perl initialized this category to "C", but a call to
2898C<POSIX::setlocale()> would change it. Now such a call will change the
2899underlying locale of the C<LC_NUMERIC> category for the program, but the
ce93e38b
KW
2900locale exposed to XS code will remain "C". There are new macros
2901to manipulate the LC_NUMERIC locale, including
2902C<STORE_LC_NUMERIC_SET_TO_NEEDED> and
2903C<STORE_LC_NUMERIC_FORCE_TO_UNDERLYING>.
2904See L<perlapi/Locale-related functions and macros>.
eabfc7bc
RS
2905
2906=item *
2907
2908A new macro L<C<isUTF8_CHAR>|perlapi/isUTF8_CHAR> has been written which
2909efficiently determines if the string given by its parameters begins
2910with a well-formed UTF-8 encoded character.
2911
2912=item *
2913
b0511669 2914The following private API functions had their context parameter removed:
eabfc7bc
RS
2915C<Perl_cast_ulong>, C<Perl_cast_i32>, C<Perl_cast_iv>, C<Perl_cast_uv>,
2916C<Perl_cv_const_sv>, C<Perl_mg_find>, C<Perl_mg_findext>, C<Perl_mg_magical>,
2917C<Perl_mini_mktime>, C<Perl_my_dirfd>, C<Perl_sv_backoff>, C<Perl_utf8_hop>.
2918
cca58a48
DM
2919Note that the prefix-less versions of those functions that are part of the
2920public API, such as C<cast_i32()>, remain unaffected.
eabfc7bc
RS
2921
2922=item *
2923
b0511669
DM
2924The C<PADNAME> and C<PADNAMELIST> types are now separate types, and no
2925longer simply aliases for SV and AV.
a75e6a3a 2926L<[perl #123223]|https://rt.perl.org/Ticket/Display.html?id=123223>.
eabfc7bc
RS
2927
2928=item *
2929
50ea4745 2930Pad names are now always UTF-8. The C<PadnameUTF8> macro always returns
eabfc7bc
RS
2931true. Previously, this was effectively the case already, but any support
2932for two different internal representations of pad names has now been
2933removed.
2934
2935=item *
2936
eabfc7bc
RS
2937A new op class, C<UNOP_AUX>, has been added. This is a subclass of
2938C<UNOP> with an C<op_aux> field added, which points to an array of unions
2939of C<UV>, C<SV*> etc. It is intended for where an op needs to store more data
2940than a simple C<op_sv> or whatever. Currently the only op of this type is
2941C<OP_MULTIDEREF> (see below).
2942
2943=item *
2944
2945A new op has been added, C<OP_MULTIDEREF>, which performs one or more
2946nested array and hash lookups where the key is a constant or simple
2947variable. For example the expression C<$a[0]{$k}[$i]>, which previously
2948involved ten C<rv2Xv>, C<Xelem>, C<gvsv> and C<const> ops is now performed
2949by a single C<multideref> op. It can also handle C<local>, C<exists> and
2950C<delete>. A non-simple index expression, such as C<[$i+1]> is still done
77c2376a 2951using C<aelem>/C<helem>, and single-level array lookup with a small constant
eabfc7bc
RS
2952index is still done using C<aelemfast>.
2953
2954=back
2955
2956=head1 Selected Bug Fixes
2957
2958=over 4
2959
2960=item *
2961
33ca8d3c
DM
2962C<pack("D", $x)> and C<pack("F", $x)> now zero the padding on x86 long
2963double builds. Under some build options on GCC 4.8 and later, they used
2964to either overwrite the zero-initialized padding, or bypass the
2965initialized buffer entirely. This caused F<op/pack.t> to fail.
eabfc7bc
RS
2966L<[perl #123971]|https://rt.perl.org/Ticket/Display.html?id=123971>
2967
2968=item *
2969
2970Extending an array cloned from a parent thread could result in "Modification of
2971a read-only value attempted" errors when attempting to modify the new elements.
2972L<[perl #124127]|https://rt.perl.org/Ticket/Display.html?id=124127>
2973
2974=item *
2975
2976An assertion failure and subsequent crash with C<< *x=<y> >> has been fixed.
2977L<[perl #123790]|https://rt.perl.org/Ticket/Display.html?id=123790>
2978
2979=item *
2980
33ca8d3c
DM
2981A possible crashing/looping bug related to compiling lexical subs has been
2982fixed.
eabfc7bc
RS
2983L<[perl #124099]|https://rt.perl.org/Ticket/Display.html?id=124099>
2984
2985=item *
2986
d140c31c
AC
2987UTF-8 now works correctly in function names, in unquoted HERE-document
2988terminators, and in variable names used as array indexes.
eabfc7bc
RS
2989L<[perl #124113]|https://rt.perl.org/Ticket/Display.html?id=124113>
2990
2991=item *
2992
2993Repeated global pattern matches in scalar context on large tainted strings were
2994exponentially slow depending on the current match position in the string.
2995L<[perl #123202]|https://rt.perl.org/Ticket/Display.html?id=123202>
2996
2997=item *
2998
2999Various crashes due to the parser getting confused by syntax errors have been
3000fixed.
3001L<[perl #123801]|https://rt.perl.org/Ticket/Display.html?id=123801>
3002L<[perl #123802]|https://rt.perl.org/Ticket/Display.html?id=123802>
3003L<[perl #123955]|https://rt.perl.org/Ticket/Display.html?id=123955>
3004L<[perl #123995]|https://rt.perl.org/Ticket/Display.html?id=123995>
3005
3006=item *
3007
d140c31c 3008C<split> in the scope of lexical C<$_> has been fixed not to fail assertions.
eabfc7bc
RS
3009L<[perl #123763]|https://rt.perl.org/Ticket/Display.html?id=123763>
3010
3011=item *
3012
3013C<my $x : attr> syntax inside various list operators no longer fails
3014assertions.
3015L<[perl #123817]|https://rt.perl.org/Ticket/Display.html?id=123817>
3016
3017=item *
3018
4ec8e6f0 3019An C<@> sign in quotes followed by a non-ASCII digit (which is not a valid
33ca8d3c
DM
3020identifier) would cause the parser to crash, instead of simply trying the
3021C<@> as literal. This has been fixed.
eabfc7bc
RS
3022L<[perl #123963]|https://rt.perl.org/Ticket/Display.html?id=123963>
3023
3024=item *
3025
3026C<*bar::=*foo::=*glob_with_hash> has been crashing since Perl 5.14, but no
3027longer does.
3028L<[perl #123847]|https://rt.perl.org/Ticket/Display.html?id=123847>
3029
3030=item *
3031
3032C<foreach> in scalar context was not pushing an item on to the stack, resulting
33ca8d3c
DM
3033in bugs. (S<C<print 4, scalar do { foreach(@x){} } + 1>> would print 5.)
3034It has been fixed to return C<undef>.
eabfc7bc
RS
3035L<[perl #124004]|https://rt.perl.org/Ticket/Display.html?id=124004>
3036
3037=item *
3038
eabfc7bc
RS
3039Several cases of data used to store environment variable contents in core C
3040code being potentially overwritten before being used have been fixed.
3041L<[perl #123748]|https://rt.perl.org/Ticket/Display.html?id=123748>
3042
3043=item *
3044
33ca8d3c
DM
3045Some patterns starting with C</.*..../> matched against long strings have
3046been slow since v5.8, and some of the form C</.*..../i> have been slow
3047since v5.18. They are now all fast again.
a75e6a3a 3048L<[perl #123743]|https://rt.perl.org/Ticket/Display.html?id=123743>.
eabfc7bc
RS
3049
3050=item *
3051
3052The original visible value of C<$/> is now preserved when it is set to
3053an invalid value. Previously if you set C<$/> to a reference to an
3054array, for example, perl would produce a runtime error and not set
3055C<PL_rs>, but perl code that checked C<$/> would see the array
a75e6a3a
SH
3056reference.
3057L<[perl #123218]|https://rt.perl.org/Ticket/Display.html?id=123218>.
eabfc7bc
RS
3058
3059=item *
3060
3061In a regular expression pattern, a POSIX class, like C<[:ascii:]>, must
93780ae6 3062be inside a bracketed character class, like C<qr/[[:ascii:]]/>. A
eabfc7bc
RS
3063warning is issued when something looking like a POSIX class is not
3064inside a bracketed class. That warning wasn't getting generated when
3065the POSIX class was negated: C<[:^ascii:]>. This is now fixed.
3066
3067=item *
3068
3209f716 3069Perl 5.14.0 introduced a bug whereby S<C<eval { LABEL: }>> would crash. This
a75e6a3a
SH
3070has been fixed.
3071L<[perl #123652]|https://rt.perl.org/Ticket/Display.html?id=123652>.
eabfc7bc
RS
3072
3073=item *
3074
3075Various crashes due to the parser getting confused by syntax errors have
a75e6a3a
SH
3076been fixed.
3077L<[perl #123617]|https://rt.perl.org/Ticket/Display.html?id=123617>.
3078L<[perl #123737]|https://rt.perl.org/Ticket/Display.html?id=123737>.
3079L<[perl #123753]|https://rt.perl.org/Ticket/Display.html?id=123753>.
3080L<[perl #123677]|https://rt.perl.org/Ticket/Display.html?id=123677>.
eabfc7bc
RS
3081
3082=item *
3083
3084Code like C</$a[/> used to read the next line of input and treat it as
3085though it came immediately after the opening bracket. Some invalid code
3086consequently would parse and run, but some code caused crashes, so this is
a75e6a3a
SH
3087now disallowed.
3088L<[perl #123712]|https://rt.perl.org/Ticket/Display.html?id=123712>.
eabfc7bc
RS
3089
3090=item *
3091
a75e6a3a
SH
3092Fix argument underflow for C<pack>.
3093L<[perl #123874]|https://rt.perl.org/Ticket/Display.html?id=123874>.
eabfc7bc
RS
3094
3095=item *
3096
3097Fix handling of non-strict C<\x{}>. Now C<\x{}> is equivalent to C<\x{0}>
3098instead of faulting.
3099
3100=item *
3101
3102C<stat -t> is now no longer treated as stackable, just like C<-t stat>.
a75e6a3a 3103L<[perl #123816]|https://rt.perl.org/Ticket/Display.html?id=123816>.
eabfc7bc
RS
3104
3105=item *
3106
3107The following no longer causes a SEGV: C<qr{x+(y(?0))*}>.
3108
3109=item *
3110
3111Fixed infinite loop in parsing backrefs in regexp patterns.
3112
3113=item *
3114
3b50e657
KW
3115Several minor bug fixes in behavior of Infinity and NaN, including
3116warnings when stringifying Infinity-like or NaN-like strings. For example,
eabfc7bc
RS
3117"NaNcy" doesn't numify to NaN anymore.
3118
3119=item *
3120
eabfc7bc
RS
3121A bug in regular expression patterns that could lead to segfaults and
3122other crashes has been fixed. This occurred only in patterns compiled
d140c31c
AC
3123with C</i> while taking into account the current POSIX locale (which usually
3124means they have to be compiled within the scope of C<S<use locale>>),
eabfc7bc 3125and there must be a string of at least 128 consecutive bytes to match.
a75e6a3a 3126L<[perl #123539]|https://rt.perl.org/Ticket/Display.html?id=123539>.
eabfc7bc
RS
3127
3128=item *
3129
33ca8d3c
DM
3130C<s///g> now works on very long strings (where there are more than 2
3131billion iterations) instead of dying with 'Substitution loop'.
a75e6a3a
SH
3132L<[perl #103260]|https://rt.perl.org/Ticket/Display.html?id=103260>.
3133L<[perl #123071]|https://rt.perl.org/Ticket/Display.html?id=123071>.
eabfc7bc
RS
3134
3135=item *
3136
a75e6a3a
SH
3137C<gmtime> no longer crashes with not-a-number values.
3138L<[perl #123495]|https://rt.perl.org/Ticket/Display.html?id=123495>.
eabfc7bc
RS
3139
3140=item *
3141
33ca8d3c
DM
3142C<\()> (a reference to an empty list), and C<y///> with lexical C<$_> in
3143scope, could both do a bad write past the end of the stack. They have
3144both been fixed to extend the stack first.
eabfc7bc
RS
3145
3146=item *
3147
3148C<prototype()> with no arguments used to read the previous item on the
3209f716
KW
3149stack, so S<C<print "foo", prototype()>> would print foo's prototype.
3150It has been fixed to infer C<$_> instead.
a75e6a3a 3151L<[perl #123514]|https://rt.perl.org/Ticket/Display.html?id=123514>.
eabfc7bc
RS
3152
3153=item *
3154
33ca8d3c
DM
3155Some cases of lexical state subs declared inside predeclared subs could
3156crash, for example when evalling a string including the name of an outer
3157variable, but no longer do.
eabfc7bc
RS
3158
3159=item *
3160
3161Some cases of nested lexical state subs inside anonymous subs could cause
d140c31c 3162'Bizarre copy' errors or possibly even crashes.
eabfc7bc
RS
3163
3164=item *
3165
3166When trying to emit warnings, perl's default debugger (F<perl5db.pl>) was
3167sometimes giving 'Undefined subroutine &DB::db_warn called' instead. This
a75e6a3a
SH
3168bug, which started to occur in Perl 5.18, has been fixed.
3169L<[perl #123553]|https://rt.perl.org/Ticket/Display.html?id=123553>.
eabfc7bc
RS
3170
3171=item *
3172
d140c31c 3173Certain syntax errors in substitutions, such as C<< s/${<>{})// >>, would
eabfc7bc
RS
3174crash, and had done so since Perl 5.10. (In some cases the crash did not
3175start happening till 5.16.) The crash has, of course, been fixed.
a75e6a3a 3176L<[perl #123542]|https://rt.perl.org/Ticket/Display.html?id=123542>.
eabfc7bc
RS
3177
3178=item *
3179
33ca8d3c 3180Fix a couple of string grow size calculation overflows; in particular,
3209f716 3181a repeat expression like S<C<33 x ~3>> could cause a large buffer
eabfc7bc 3182overflow since the new output buffer size was not correctly handled by
3209f716 3183C<SvGROW()>. An expression like this now properly produces a memory wrap
a75e6a3a
SH
3184panic.
3185L<[perl #123554]|https://rt.perl.org/Ticket/Display.html?id=123554>.
eabfc7bc
RS
3186
3187=item *
3188
3189C<< formline("@...", "a"); >> would crash. The C<FF_CHECKNL> case in
3190pp_formline() didn't set the pointer used to mark the chop position,
3191which led to the C<FF_MORE> case crashing with a segmentation fault.
a75e6a3a
SH
3192This has been fixed.
3193L<[perl #123538]|https://rt.perl.org/Ticket/Display.html?id=123538>.
eabfc7bc
RS
3194
3195=item *
3196
3197A possible buffer overrun and crash when parsing a literal pattern during
a75e6a3a
SH
3198regular expression compilation has been fixed.
3199L<[perl #123604]|https://rt.perl.org/Ticket/Display.html?id=123604>.
eabfc7bc
RS
3200
3201=item *
3202
4ec8e6f0 3203C<fchmod()> and C<futimes()> now set C<$!> when they fail due to being
a75e6a3a
SH
3204passed a closed file handle.
3205L<[perl #122703]|https://rt.perl.org/Ticket/Display.html?id=122703>.
eabfc7bc
RS
3206
3207=item *
3208
33ca8d3c
DM
3209C<op_free()> and C<scalarvoid()> no longer crash due to a stack overflow
3210when freeing a deeply recursive op tree.
a75e6a3a 3211L<[perl #108276]|https://rt.perl.org/Ticket/Display.html?id=108276>.
eabfc7bc
RS
3212
3213=item *
3214
50ea4745 3215In Perl 5.20.0, C<$^N> accidentally had the internal UTF-8 flag turned off
eabfc7bc 3216if accessed from a code block within a regular expression, effectively
50ea4745 3217UTF-8-encoding the value. This has been fixed.
a75e6a3a 3218L<[perl #123135]|https://rt.perl.org/Ticket/Display.html?id=123135>.
eabfc7bc
RS
3219
3220=item *
3221
3222A failed C<semctl> call no longer overwrites existing items on the stack,
33ca8d3c
DM
3223which means that C<(semctl(-1,0,0,0))[0]> no longer gives an
3224"uninitialized" warning.
eabfc7bc
RS
3225
3226=item *
3227
3228C<else{foo()}> with no space before C<foo> is now better at assigning the
a75e6a3a
SH
3229right line number to that statement.
3230L<[perl #122695]|https://rt.perl.org/Ticket/Display.html?id=122695>.
eabfc7bc
RS
3231
3232=item *
3233
d140c31c 3234Sometimes the assignment in C<@array = split> gets optimised so that C<split>
eabfc7bc
RS
3235itself writes directly to the array. This caused a bug, preventing this
3236assignment from being used in lvalue context. So
3237C<(@a=split//,"foo")=bar()> was an error. (This bug probably goes back to
33ca8d3c 3238Perl 3, when the optimisation was added.) It has now been fixed.
a75e6a3a 3239L<[perl #123057]|https://rt.perl.org/Ticket/Display.html?id=123057>.
eabfc7bc
RS
3240
3241=item *
3242
33ca8d3c
DM
3243When an argument list fails the checks specified by a subroutine
3244signature (which is still an experimental feature), the resulting error
3245messages now give the file and line number of the caller, not of the
3246called subroutine.
a75e6a3a 3247L<[perl #121374]|https://rt.perl.org/Ticket/Display.html?id=121374>.
eabfc7bc
RS
3248
3249=item *
3250
33ca8d3c 3251The flip-flop operators (C<..> and C<...> in scalar context) used to maintain
eabfc7bc
RS
3252a separate state for each recursion level (the number of times the
3253enclosing sub was called recursively), contrary to the documentation. Now
a75e6a3a
SH
3254each closure has one internal state for each flip-flop.
3255L<[perl #122829]|https://rt.perl.org/Ticket/Display.html?id=122829>.
eabfc7bc
RS
3256
3257=item *
3258
33ca8d3c
DM
3259The flip-flop operator (C<..> in scalar context) would return the same
3260scalar each time, unless the containing subroutine was called recursively.
3261Now it always returns a new scalar.
3262L<[perl #122829]|https://rt.perl.org/Ticket/Display.html?id=122829>.
3263
3264=item *
3265
eabfc7bc
RS
3266C<use>, C<no>, statement labels, special blocks (C<BEGIN>) and pod are now
3267permitted as the first thing in a C<map> or C<grep> block, the block after
3268C<print> or C<say> (or other functions) returning a handle, and within
a75e6a3a
SH
3269C<${...}>, C<@{...}>, etc.
3270L<[perl #122782]|https://rt.perl.org/Ticket/Display.html?id=122782>.
eabfc7bc
RS
3271
3272=item *
3273
3274The repetition operator C<x> now propagates lvalue context to its left-hand
3275argument when used in contexts like C<foreach>. That allows
4ec8e6f0 3276S<C<for(($#that_array)x2) { ... }>> to work as expected if the loop modifies
eabfc7bc
RS
3277$_.
3278
3279=item *
3280
3281C<(...) x ...> in scalar context used to corrupt the stack if one operand
d140c31c 3282was an object with "x" overloading, causing erratic behaviour.
a75e6a3a 3283L<[perl #121827]|https://rt.perl.org/Ticket/Display.html?id=121827>.
eabfc7bc
RS
3284
3285=item *
3286
33ca8d3c
DM
3287Assignment to a lexical scalar is often optimised away; for example in
3288C<my $x; $x = $y + $z>, the assign operator is optimised away and the add
3289operator writes its result directly to C<$x>. Various bugs related to
3290this optimisation have been fixed. Certain operators on the right-hand
3291side would sometimes fail to assign the value at all or assign the wrong
3292value, or would call STORE twice or not at all on tied variables. The
3293operators affected were C<$foo++>, C<$foo-->, and C<-$foo> under C<use
3294integer>, C<chomp>, C<chr> and C<setpgrp>.
eabfc7bc
RS
3295
3296=item *
3297
3298List assignments were sometimes buggy if the same scalar ended up on both
d140c31c 3299sides of the assignment due to use of C<tied>, C<values> or C<each>. The
eabfc7bc
RS
3300result would be the wrong value getting assigned.
3301
3302=item *
3303
3304C<setpgrp($nonzero)> (with one argument) was accidentally changed in 5.16
3305to mean C<setpgrp(0)>. This has been fixed.
3306
3307=item *
3308
3309C<__SUB__> could return the wrong value or even corrupt memory under the
4ec8e6f0 3310debugger (the C<-d> switch) and in subs containing C<eval $string>.
eabfc7bc
RS
3311
3312=item *
3313
4ec8e6f0 3314When S<C<sub () { $var }>> becomes inlinable, it now returns a different
eabfc7bc
RS
3315scalar each time, just as a non-inlinable sub would, though Perl still
3316optimises the copy away in cases where it would make no observable
3317difference.
3318
3319=item *
3320
4ec8e6f0 3321S<C<my sub f () { $var }>> and S<C<sub () : attr { $var }>> are no longer
eabfc7bc
RS
3322eligible for inlining. The former would crash; the latter would just
3323throw the attributes away. An exception is made for the little-known
3324":method" attribute, which does nothing much.
3325
3326=item *
3327
3328Inlining of subs with an empty prototype is now more consistent than
d140c31c
AC
3329before. Previously, a sub with multiple statements, of which all but the last
3330were optimised away, would be inlinable only if it were an anonymous sub
eabfc7bc
RS
3331containing a string C<eval> or C<state> declaration or closing over an
3332outer lexical variable (or any anonymous sub under the debugger). Now any
3333sub that gets folded to a single constant after statements have been
3334optimised away is eligible for inlining. This applies to things like C<sub
3335() { jabber() if DEBUG; 42 }>.
3336
3337Some subroutines with an explicit C<return> were being made inlinable,
3338contrary to the documentation, Now C<return> always prevents inlining.
3339
3340=item *
3341
3342On some systems, such as VMS, C<crypt> can return a non-ASCII string. If a
50ea4745
DIM
3343scalar assigned to had contained a UTF-8 string previously, then C<crypt>
3344would not turn off the UTF-8 flag, thus corrupting the return value. This
3209f716 3345would happen with S<C<$lexical = crypt ...>>.
eabfc7bc
RS
3346
3347=item *
3348
3349C<crypt> no longer calls C<FETCH> twice on a tied first argument.
3350
3351=item *
3352
3353An unterminated here-doc on the last line of a quote-like operator
3354(C<qq[${ <<END }]>, C</(?{ <<END })/>) no longer causes a double free. It
3355started doing so in 5.18.
3356
3357=item *
3358
4ec8e6f0 3359C<index()> and C<rindex()> no longer crash when used on strings over 2GB in
eabfc7bc
RS
3360size.
3361L<[perl #121562]|https://rt.perl.org/Ticket/Display.html?id=121562>.
3362
3363=item *
3364
3365A small previously intentional memory leak in PERL_SYS_INIT/PERL_SYS_INIT3 on
3366Win32 builds was fixed. This might affect embedders who repeatedly create and
3367destroy perl engines within the same process.
3368
3369=item *
3370
3371C<POSIX::localeconv()> now returns the data for the program's underlying
3372locale even when called from outside the scope of S<C<use locale>>.
3373
3374=item *
3375
3376C<POSIX::localeconv()> now works properly on platforms which don't have
3377C<LC_NUMERIC> and/or C<LC_MONETARY>, or for which Perl has been compiled
3378to disregard either or both of these locale categories. In such
3379circumstances, there are now no entries for the corresponding values in
3380the hash returned by C<localeconv()>.
3381
3382=item *
3383
3384C<POSIX::localeconv()> now marks appropriately the values it returns as
6a3ea89b 3385UTF-8 or not. Previously they were always returned as bytes, even if
eabfc7bc
RS
3386they were supposed to be encoded as UTF-8.
3387
3388=item *
3389
3390On Microsoft Windows, within the scope of C<S<use locale>>, the following
3391POSIX character classes gave results for many locales that did not
3392conform to the POSIX standard:
3393C<[[:alnum:]]>,
3394C<[[:alpha:]]>,
3395C<[[:blank:]]>,
3396C<[[:digit:]]>,
3397C<[[:graph:]]>,
3398C<[[:lower:]]>,
3399C<[[:print:]]>,
3400C<[[:punct:]]>,
3401C<[[:upper:]]>,
3402C<[[:word:]]>,
3403and
3404C<[[:xdigit:]]>.
f1c9eac6 3405This was because the underlying Microsoft implementation does not
eabfc7bc
RS
3406follow the standard. Perl now takes special precautions to correct for
3407this.
3408
3409=item *
3410
3411Many issues have been detected by L<Coverity|http://www.coverity.com/> and
3412fixed.
3413
3414=item *
3415
d140c31c 3416C<system()> and friends should now work properly on more Android builds.
eabfc7bc 3417
4ec8e6f0 3418Due to an oversight, the value specified through C<-Dtargetsh> to F<Configure>
eabfc7bc 3419would end up being ignored by some of the build process. This caused perls
4ec8e6f0 3420cross-compiled for Android to end up with defective versions of C<system()>,
d140c31c 3421C<exec()> and backticks: the commands would end up looking for C</bin/sh>
eabfc7bc
RS
3422instead of C</system/bin/sh>, and so would fail for the vast majority
3423of devices, leaving C<$!> as C<ENOENT>.
3424
3425=item *
3426
3427C<qr(...\(...\)...)>,
3428C<qr[...\[...\]...]>,
3429and
3430C<qr{...\{...\}...}>
3431now work. Previously it was impossible to escape these three
3432left-characters with a backslash within a regular expression pattern
3433where otherwise they would be considered metacharacters, and the pattern
3434opening delimiter was the character, and the closing delimiter was its
3435mirror character.
3436
3437=item *
3438
50ea4745 3439C<< s///e >> on tainted UTF-8 strings corrupted C<< pos() >>. This bug,
a75e6a3a
SH
3440introduced in 5.20, is now fixed.
3441L<[perl #122148]|https://rt.perl.org/Ticket/Display.html?id=122148>.
eabfc7bc
RS
3442
3443=item *
3444
3445A non-word boundary in a regular expression (C<< \B >>) did not always
3446match the end of the string; in particular C<< q{} =~ /\B/ >> did not
a75e6a3a
SH
3447match. This bug, introduced in perl 5.14, is now fixed.
3448L<[perl #122090]|https://rt.perl.org/Ticket/Display.html?id=122090>.
eabfc7bc
RS
3449
3450=item *
3451
3452C<< " P" =~ /(?=.*P)P/ >> should match, but did not. This is now fixed.
a75e6a3a 3453L<[perl #122171]|https://rt.perl.org/Ticket/Display.html?id=122171>.
eabfc7bc
RS
3454
3455=item *
3456
3209f716 3457Failing to compile C<use Foo> in an C<eval> could leave a spurious
eabfc7bc
RS
3458C<BEGIN> subroutine definition, which would produce a "Subroutine
3459BEGIN redefined" warning on the next use of C<use>, or other C<BEGIN>
a75e6a3a
SH
3460block.
3461L<[perl #122107]|https://rt.perl.org/Ticket/Display.html?id=122107>.
eabfc7bc
RS
3462
3463=item *
3464
3465C<method { BLOCK } ARGS> syntax now correctly parses the arguments if they
a75e6a3a
SH
3466begin with an opening brace.
3467L<[perl #46947]|https://rt.perl.org/Ticket/Display.html?id=46947>.
eabfc7bc
RS
3468
3469=item *
3470
3471External libraries and Perl may have different ideas of what the locale is.
3472This is problematic when parsing version strings if the locale's numeric
3473separator has been changed. Version parsing has been patched to ensure
a75e6a3a
SH
3474it handles the locales correctly.
3475L<[perl #121930]|https://rt.perl.org/Ticket/Display.html?id=121930>.
eabfc7bc
RS
3476
3477=item *
3478
3479A bug has been fixed where zero-length assertions and code blocks inside of a
a75e6a3a
SH
3480regex could cause C<pos> to see an incorrect value.
3481L<[perl #122460]|https://rt.perl.org/Ticket/Display.html?id=122460>.
eabfc7bc
RS
3482
3483=item *
3484
3b50e657 3485Dereferencing of constants now works correctly for typeglob constants. Previously
eabfc7bc
RS
3486the glob was stringified and its name looked up. Now the glob itself is used.
3487L<[perl #69456]|https://rt.perl.org/Ticket/Display.html?id=69456>
3488
3489=item *
3490
d140c31c 3491When parsing a sigil (C<$> C<@> C<%> C<&)> followed by braces,
4ec8e6f0 3492the parser no
eabfc7bc
RS
3493longer tries to guess whether it is a block or a hash constructor (causing a
3494syntax error when it guesses the latter), since it can only be a block.
3495
3496=item *
3497
4ec8e6f0 3498S<C<undef $reference>> now frees the referent immediately, instead of hanging on
eabfc7bc
RS
3499to it until the next statement.
3500L<[perl #122556]|https://rt.perl.org/Ticket/Display.html?id=122556>
3501
3502=item *
3503
3504Various cases where the name of a sub is used (autoload, overloading, error
3505messages) used to crash for lexical subs, but have been fixed.
3506
3507=item *
3508
3509Bareword lookup now tries to avoid vivifying packages if it turns out the
3510bareword is not going to be a subroutine name.
3511
3512=item *
3513
3514Compilation of anonymous constants (e.g., C<sub () { 3 }>) no longer deletes
3515any subroutine named C<__ANON__> in the current package. Not only was
3516C<*__ANON__{CODE}> cleared, but there was a memory leak, too. This bug goes
3517back to Perl 5.8.0.
3518
3519=item *
3520
3521Stub declarations like C<sub f;> and C<sub f ();> no longer wipe out constants
3522of the same name declared by C<use constant>. This bug was introduced in Perl
35235.10.0.
3524
3525=item *
3526
33ca8d3c
DM
3527C<qr/[\N{named sequence}]/> now works properly in many instances.
3528
3529Some names
eabfc7bc
RS
3530known to C<\N{...}> refer to a sequence of multiple characters, instead of the
3531usual single character. Bracketed character classes generally only match
3532single characters, but now special handling has been added so that they can
3533match named sequences, but not if the class is inverted or the sequence is
3534specified as the beginning or end of a range. In these cases, the only
3535behavior change from before is a slight rewording of the fatal error message
3536given when this class is part of a C<?[...])> construct. When the C<[...]>
3537stands alone, the same non-fatal warning as before is raised, and only the
3538first character in the sequence is used, again just as before.
3539
3540=item *
3541
3542Tainted constants evaluated at compile time no longer cause unrelated
3543statements to become tainted.
3544L<[perl #122669]|https://rt.perl.org/Ticket/Display.html?id=122669>
3545
3546=item *
3547
33ca8d3c
DM
3548S<C<open $$fh, ...>>, which vivifies a handle with a name like
3549C<"main::_GEN_0">, was not giving the handle the right reference count, so
3550a double free could happen.
eabfc7bc
RS
3551
3552=item *
3553
3554When deciding that a bareword was a method name, the parser would get confused
4ec8e6f0
KW
3555if an C<our> sub with the same name existed, and look up the method in the
3556package of the C<our> sub, instead of the package of the invocant.
eabfc7bc
RS
3557
3558=item *
3559
3560The parser no longer gets confused by C<\U=> within a double-quoted string. It
3561used to produce a syntax error, but now compiles it correctly.
3562L<[perl #80368]|https://rt.perl.org/Ticket/Display.html?id=80368>
3563
3564=item *
3565
3566It has always been the intention for the C<-B> and C<-T> file test operators to
3567treat UTF-8 encoded files as text. (L<perlfunc|perlfunc/-X FILEHANDLE> has
3568been updated to say this.) Previously, it was possible for some files to be
3569considered UTF-8 that actually weren't valid UTF-8. This is now fixed. The
3570operators now work on EBCDIC platforms as well.
3571
3572=item *
3573
3574Under some conditions warning messages raised during regular expression pattern
3575compilation were being output more than once. This has now been fixed.
3576
3577=item *
3578
d140c31c
AC
3579Perl 5.20.0 introduced a regression in which a UTF-8 encoded regular
3580expression pattern that contains a single ASCII lowercase letter did not
3581match its uppercase counterpart. That has been fixed in both 5.20.1 and
35825.22.0.
eabfc7bc
RS
3583L<[perl #122655]|https://rt.perl.org/Ticket/Display.html?id=122655>
3584
3585=item *
3586
33ca8d3c
DM
3587Constant folding could incorrectly suppress warnings if lexical warnings
3588(C<use warnings> or C<no warnings>) were not in effect and C<$^W> were
3589false at compile time and true at run time.
eabfc7bc
RS
3590
3591=item *
3592
1e45139a 3593Loading Unicode tables during a regular expression match could cause assertion
eabfc7bc
RS
3594failures under debugging builds if the previous match used the very same
3595regular expression.
3596L<[perl #122747]|https://rt.perl.org/Ticket/Display.html?id=122747>
3597
3598=item *
3599
3600Thread cloning used to work incorrectly for lexical subs, possibly causing
3601crashes or double frees on exit.
3602
3603=item *
3604
3605Since Perl 5.14.0, deleting C<$SomePackage::{__ANON__}> and then undefining an
3606anonymous subroutine could corrupt things internally, resulting in
3607L<Devel::Peek> crashing or L<B.pm|B> giving nonsensical data. This has been
3608fixed.
3609
3610=item *
3611
33ca8d3c
DM
3612S<C<(caller $n)[3]>> now reports names of lexical subs, instead of
3613treating them as C<"(unknown)">.
eabfc7bc
RS
3614
3615=item *
3616
d140c31c
AC
3617C<sort subname LIST> now supports using a lexical sub as the comparison
3618routine.
eabfc7bc
RS
3619
3620=item *
3621
3209f716 3622Aliasing (e.g., via S<C<*x = *y>>) could confuse list assignments that mention the
eabfc7bc
RS
3623two names for the same variable on either side, causing wrong values to be
3624assigned.
3625L<[perl #15667]|https://rt.perl.org/Ticket/Display.html?id=15667>
3626
3627=item *
3628
3629Long here-doc terminators could cause a bad read on short lines of input. This
3630has been fixed. It is doubtful that any crash could have occurred. This bug
3631goes back to when here-docs were introduced in Perl 3.000 twenty-five years
3632ago.
3633
3634=item *
3635
3209f716
KW
3636An optimization in C<split> to treat S<C<split /^/>> like S<C<split /^/m>> had the
3637unfortunate side-effect of also treating S<C<split /\A/>> like S<C<split /^/m>>,
3638which it should not. This has been fixed. (Note, however, that S<C<split /^x/>>
3639does not behave like S<C<split /^x/m>>, which is also considered to be a bug and
d140c31c 3640will be fixed in a future version.)
eabfc7bc
RS
3641L<[perl #122761]|https://rt.perl.org/Ticket/Display.html?id=122761>
3642
3643=item *
3644
4ec8e6f0 3645The little-known S<C<my Class $var>> syntax (see L<fields> and L<attributes>)
eabfc7bc
RS
3646could get confused in the scope of C<use utf8> if C<Class> were a constant
3647whose value contained Latin-1 characters.
3648
3649=item *
3650
3651Locking and unlocking values via L<Hash::Util> or C<Internals::SvREADONLY>
33ca8d3c 3652no longer has any effect on values that were read-only to begin with.
eabfc7bc
RS
3653Previously, unlocking such values could result in crashes, hangs or
3654other erratic behaviour.
3655
3656=item *
3657
eabfc7bc
RS
3658Some unterminated C<(?(...)...)> constructs in regular expressions would
3659either crash or give erroneous error messages. C</(?(1)/> is one such
3660example.
3661
3662=item *
3663
4ec8e6f0 3664S<C<pack "w", $tied>> no longer calls FETCH twice.
eabfc7bc
RS
3665
3666=item *
3667
4ec8e6f0
KW
3668List assignments like S<C<($x, $z) = (1, $y)>> now work correctly if C<$x> and
3669C<$y> have been aliased by C<foreach>.
eabfc7bc
RS
3670
3671=item *
3672
3673Some patterns including code blocks with syntax errors, such as
3209f716 3674S<C</ (?{(^{})/>>, would hang or fail assertions on debugging builds. Now
eabfc7bc
RS
3675they produce errors.
3676
3677=item *
3678
3679An assertion failure when parsing C<sort> with debugging enabled has been
a75e6a3a
SH
3680fixed.
3681L<[perl #122771]|https://rt.perl.org/Ticket/Display.html?id=122771>.
eabfc7bc
RS
3682
3683=item *
3684
4ec8e6f0 3685S<C<*a = *b; @a = split //, $b[1]>> could do a bad read and produce junk
eabfc7bc
RS
3686results.
3687
3688=item *
3689
4ec8e6f0 3690In S<C<() = @array = split>>, the S<C<() =>> at the beginning no longer confuses
d140c31c 3691the optimizer into assuming a limit of 1.
eabfc7bc
RS
3692
3693=item *
3694
3695Fatal warnings no longer prevent the output of syntax errors.
a75e6a3a 3696L<[perl #122966]|https://rt.perl.org/Ticket/Display.html?id=122966>.
eabfc7bc
RS
3697
3698=item *
3699
d140c31c 3700Fixed a NaN double-to-long-double conversion error on VMS. For quiet NaNs
eabfc7bc
RS
3701(and only on Itanium, not Alpha) negative infinity instead of NaN was
3702produced.
3703
3704=item *
3705
d140c31c
AC
3706Fixed the issue that caused C<< make distclean >> to incorrectly leave some
3707files behind.
a75e6a3a 3708L<[perl #122820]|https://rt.perl.org/Ticket/Display.html?id=122820>.
eabfc7bc
RS
3709
3710=item *
3711
a75e6a3a
SH
3712AIX now sets the length in C<< getsockopt >> correctly.
3713L<[perl #120835]|https://rt.perl.org/Ticket/Display.html?id=120835>.
3714L<[cpan #91183]|https://rt.cpan.org/Ticket/Display.html?id=91183>.
3715L<[cpan #85570]|https://rt.cpan.org/Ticket/Display.html?id=85570>.
eabfc7bc
RS
3716
3717=item *
3718
6acea139
KW
3719The optimization phase of a regexp compilation could run "forever" and
3720exhaust all memory under certain circumstances; now fixed.
a75e6a3a 3721L<[perl #122283]|https://rt.perl.org/Ticket/Display.html?id=122283>.
eabfc7bc
RS
3722
3723=item *
3724
33ca8d3c
DM
3725The test script F<< t/op/crypt.t >> now uses the SHA-256 algorithm if the
3726default one is disabled, rather than giving failures.
a75e6a3a 3727L<[perl #121591]|https://rt.perl.org/Ticket/Display.html?id=121591>.
eabfc7bc
RS
3728
3729=item *
3730
d140c31c 3731Fixed an off-by-one error when setting the size of a shared array.
a75e6a3a 3732L<[perl #122950]|https://rt.perl.org/Ticket/Display.html?id=122950>.
eabfc7bc
RS
3733
3734=item *
3735
d140c31c 3736Fixed a bug that could cause perl to enter an infinite loop during
3b50e657 3737compilation. In particular, a C<while(1)> within a sublist, e.g.
33ca8d3c
DM
3738
3739 sub foo { () = ($a, my $b, ($c, do { while(1) {} })) }
3740
3741The bug was introduced in 5.20.0
a75e6a3a 3742L<[perl #122995]|https://rt.perl.org/Ticket/Display.html?id=122995>.
eabfc7bc
RS
3743
3744=item *
3745
cca58a48 3746On Win32, if a variable was C<local>-ized in a pseudo-process that later
d140c31c
AC
3747forked, restoring the original value in the child pseudo-process caused
3748memory corruption and a crash in the child pseudo-process (and therefore the
3749OS process).
a75e6a3a 3750L<[perl #40565]|https://rt.perl.org/Ticket/Display.html?id=40565>.
eabfc7bc
RS
3751
3752=item *
3753
3754Calling C<write> on a format with a C<^**> field could produce a panic
4ec8e6f0 3755in C<sv_chop()> if there were insufficient arguments or if the variable
a75e6a3a
SH
3756used to fill the field was empty.
3757L<[perl #123245]|https://rt.perl.org/Ticket/Display.html?id=123245>.
eabfc7bc
RS
3758
3759=item *
3760
d140c31c
AC
3761Non-ASCII lexical sub names now appear without trailing junk when they
3762appear in error messages.
eabfc7bc
RS
3763
3764=item *
3765
3766The C<\@> subroutine prototype no longer flattens parenthesized arrays
3767(taking a reference to each element), but takes a reference to the array
a75e6a3a
SH
3768itself.
3769L<[perl #47363]|https://rt.perl.org/Ticket/Display.html?id=47363>.
eabfc7bc
RS
3770
3771=item *
3772
3773A block containing nothing except a C-style C<for> loop could corrupt the
3774stack, causing lists outside the block to lose elements or have elements
3775overwritten. This could happen with C<map { for(...){...} } ...> and with
a75e6a3a
SH
3776lists containing C<do { for(...){...} }>.
3777L<[perl #123286]|https://rt.perl.org/Ticket/Display.html?id=123286>.
eabfc7bc
RS
3778
3779=item *
3780
3781C<scalar()> now propagates lvalue context, so that
4ec8e6f0 3782S<C<for(scalar($#foo)) { ... }>> can modify C<$#foo> through C<$_>.
eabfc7bc
RS
3783
3784=item *
3785
3786C<qr/@array(?{block})/> no longer dies with "Bizarre copy of ARRAY".
a75e6a3a 3787L<[perl #123344]|https://rt.perl.org/Ticket/Display.html?id=123344>.
eabfc7bc
RS
3788
3789=item *
3790
4ec8e6f0 3791S<C<eval '$variable'>> in nested named subroutines would sometimes look up a
eabfc7bc
RS
3792global variable even with a lexical variable in scope.
3793
3794=item *
3795
3796In perl 5.20.0, C<sort CORE::fake> where 'fake' is anything other than a
33ca8d3c 3797keyword, started chopping off the last 6 characters and treating the result
eabfc7bc 3798as a sort sub name. The previous behaviour of treating "CORE::fake" as a
a75e6a3a
SH
3799sort sub name has been restored.
3800L<[perl #123410]|https://rt.perl.org/Ticket/Display.html?id=123410>.
eabfc7bc
RS
3801
3802=item *
3803
3804Outside of C<use utf8>, a single-character Latin-1 lexical variable is
4ec8e6f0 3805disallowed. The error message for it, "Can't use global C<$foo>...", was
eabfc7bc
RS
3806giving garbage instead of the variable name.
3807
3808=item *
3809
3810C<readline> on a nonexistent handle was causing C<${^LAST_FH}> to produce a
3811reference to an undefined scalar (or fail an assertion). Now
3812C<${^LAST_FH}> ends up undefined.
3813