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