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