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