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