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