=encoding utf8 =head1 NAME perl5220delta - what is new for perl v5.22.0 =head1 DESCRIPTION This document describes differences between the 5.20.0 release and the 5.22.0 release. If you are upgrading from an earlier release such as 5.18.0, first read L, which describes differences between 5.18.0 and 5.20.0. =head1 Core Enhancements =head2 New bitwise operators A new experimental facility has been added that makes the four standard bitwise operators (C<& | ^ ~>) treat their operands consistently as numbers, and introduces four new dotted operators (C<&. |. ^. ~.>) that treat their operands consistently as strings. The same applies to the assignment variants (C<&= |= ^= &.= |.= ^.=>). To use this, enable the "bitwise" feature and disable the "experimental::bitwise" warnings category. See L for details. L<[GH #14348]|https://github.com/Perl/perl5/issues/14348>. =head2 New double-diamond operator C<<< <<>> >>> is like C<< <> >> but uses three-argument C to open each file in C<@ARGV>. This means that each element of C<@ARGV> will be treated as an actual file name, and C<"|foo"> won't be treated as a pipe open. =head2 New C<\b> boundaries in regular expressions =head3 C C stands for Grapheme Cluster Boundary. It is a Unicode property that finds the boundary between sequences of characters that look like a single character to a native speaker of a language. Perl has long had the ability to deal with these through the C<\X> regular escape sequence. Now, there is an alternative way of handling these. See L for details. =head3 C C stands for Word Boundary. It is a Unicode property that finds the boundary between words. This is similar to the plain C<\b> (without braces) but is more suitable for natural language processing. It knows, for example, that apostrophes can occur in the middle of words. See L for details. =head3 C C stands for Sentence Boundary. It is a Unicode property to aid in parsing natural language sentences. See L for details. =head2 Non-Capturing Regular Expression Flag Regular expressions now support a C flag that disables capturing and filling in C<$1>, C<$2>, etc inside of groups: "hello" =~ /(hi|hello)/n; # $1 is not set This is equivalent to putting C at the beginning of every capturing group. See L for more information. =head2 C This applies stricter syntax rules to regular expression patterns compiled within its scope. This will hopefully alert you to typos and other unintentional behavior that backwards-compatibility issues prevent us from reporting in normal regular expression compilations. Because the behavior of this is subject to change in future Perl releases as we gain experience, using this pragma will raise a warning of category C. See L<'strict' in re|re/'strict' mode>. =head2 Unicode 7.0 (with correction) is now supported For details on what is in this release, see L. The version of Unicode 7.0 that comes with Perl includes a correction dealing with glyph shaping in Arabic (see L). =head2 S> can restrict which locale categories are affected It is now possible to pass a parameter to S> to specify a subset of locale categories to be locale-aware, with the remaining ones unaffected. See L for details. =head2 Perl now supports POSIX 2008 locale currency additions On platforms that are able to handle POSIX.1-2008, the hash returned by L|perllocale/The localeconv function> includes the international currency fields added by that version of the POSIX standard. These are C, C, C, C, C, and C. =head2 Better heuristics on older platforms for determining locale UTF-8ness On platforms that implement neither the C99 standard nor the POSIX 2001 standard, determining if the current locale is UTF-8 or not depends on heuristics. These are improved in this release. =head2 Aliasing via reference Variables and subroutines can now be aliased by assigning to a reference: \$c = \$d; \&x = \&y; Aliasing can also be accomplished by using a backslash before a C iterator variable; this is perhaps the most useful idiom this feature provides: foreach \%hash (@array_of_hash_refs) { ... } This feature is experimental and must be enabled via S>. It will warn unless the C warnings category is disabled. See L =head2 C with no arguments C with no arguments now infers C<$_>. L<[GH #14376]|https://github.com/Perl/perl5/issues/14376>. =head2 New C<:const> subroutine attribute The C attribute can be applied to an anonymous subroutine. It causes the new sub to be executed immediately whenever one is created (I when the C expression is evaluated). Its value is captured and used to create a new constant subroutine that is returned. This feature is experimental. See L. =head2 C now works on directory handles When the relevant support is available in the operating system, the C builtin now works on directory handles, yielding the underlying file descriptor in the same way as for filehandles. On operating systems without such support, C on a directory handle continues to return the undefined value, as before, but also sets C<$!> to indicate that the operation is not supported. Currently, this uses either a C member in the OS C structure, or a C function as specified by POSIX.1-2008. =head2 List form of pipe open implemented for Win32 The list form of pipe: open my $fh, "-|", "program", @arguments; is now implemented on Win32. It has the same limitations as C on Win32, since the Win32 API doesn't accept program arguments as a list. =head2 Assignment to list repetition C<(...) x ...> can now be used within a list that is assigned to, as long as the left-hand side is a valid lvalue. This allows S> to be written as S>. =head2 Infinity and NaN (not-a-number) handling improved Floating point values are able to hold the special values infinity, negative infinity, and NaN (not-a-number). Now we more robustly recognize and propagate the value in computations, and on output normalize them to the strings C, C<-Inf>, and C. See also the L enhancements. =head2 Floating point parsing has been improved Parsing and printing of floating point values has been improved. As a completely new feature, hexadecimal floating point literals (like C<0x1.23p-4>) are now supported, and they can be output with S>. See L for more details. =head2 Packing infinity or not-a-number into a character is now fatal Before, when trying to pack infinity or not-a-number into a (signed) character, Perl would warn, and assumed you tried to pack C<< 0xFF >>; if you gave it as an argument to C<< chr >>, C<< U+FFFD >> was returned. But now, all such actions (C<< pack >>, C<< chr >>, and C<< print '%c' >>) result in a fatal error. =head2 Experimental C Backtrace API Perl now supports (via a C level API) retrieving the C level backtrace (similar to what symbolic debuggers like gdb do). The backtrace returns the stack trace of the C call frames, with the symbol names (function names), the object names (like "perl"), and if it can, also the source code locations (file:line). The supported platforms are Linux and OS X (some *BSD might work at least partly, but they have not yet been tested). The feature needs to be enabled with C. See L for more information. =head1 Security =head2 Perl is now compiled with C<-fstack-protector-strong> if available Perl has been compiled with the anti-stack-smashing option C<-fstack-protector> since 5.10.1. Now Perl uses the newer variant called C<-fstack-protector-strong>, if available. =head2 The L module could allow outside packages to be replaced Critical bugfix: outside packages could be replaced. L has been patched to 2.38 to address this. =head2 Perl is now always compiled with C<-D_FORTIFY_SOURCE=2> if available The 'code hardening' option called C<_FORTIFY_SOURCE>, available in gcc 4.*, is now always used for compiling Perl, if available. Note that this isn't necessarily a huge step since in many platforms the step had already been taken several years ago: many Linux distributions (like Fedora) have been using this option for Perl, and OS X has enforced the same for many years. =head1 Incompatible Changes =head2 Subroutine signatures moved before attributes The experimental sub signatures feature, as introduced in 5.20, parsed signatures after attributes. In this release, following feedback from users of the experimental feature, the positioning has been moved such that signatures occur after the subroutine name (if any) and before the attribute list (if any). =head2 C<&> and C<\&> prototypes accepts only subs The C<&> prototype character now accepts only anonymous subs (C), things beginning with C<\&>, or an explicit C. Formerly it erroneously also allowed references to arrays, hashes, and lists. L<[GH #2776]|https://github.com/Perl/perl5/issues/2776>. L<[GH #14186]|https://github.com/Perl/perl5/issues/14186>. L<[GH #14353]|https://github.com/Perl/perl5/issues/14353>. In addition, the C<\&> prototype was allowing subroutine calls, whereas now it only allows subroutines: C<&foo> is still permitted as an argument, while C<&foo()> and C no longer are. L<[GH #10633]|https://github.com/Perl/perl5/issues/10633>. =head2 C is now lexical The L pragma's effect is now limited to lexical scope. This pragma is deprecated, but in the meantime, it could adversely affect unrelated modules that are included in the same program; this change fixes that. =head2 List slices returning empty lists List slices now return an empty list only if the original list was empty (or if there are no indices). Formerly, a list slice would return an empty list if all indices fell outside the original list; now it returns a list of C values in that case. L<[GH #12335]|https://github.com/Perl/perl5/issues/12335>. =head2 C<\N{}> with a sequence of multiple spaces is now a fatal error E.g. SEMANY SPACES}>> or S>. This has been deprecated since v5.18. =head2 S> is now a fatal error Importing functions from C has been deprecated since v5.12, and is now a fatal error. S> without any arguments is still allowed. =head2 In double-quotish C<\cI>, I must now be a printable ASCII character In prior releases, failure to do this raised a deprecation warning. =head2 Splitting the tokens C<(?> and C<(*> in regular expressions is now a fatal compilation error. These had been deprecated since v5.18. =head2 C now ignores all Unicode pattern white space The C regular expression modifier allows the pattern to contain white space and comments (both of which are ignored) for improved readability. Until now, not all the white space characters that Unicode designates for this purpose were handled. The additional ones now recognized are: U+0085 NEXT LINE U+200E LEFT-TO-RIGHT MARK U+200F RIGHT-TO-LEFT MARK U+2028 LINE SEPARATOR U+2029 PARAGRAPH SEPARATOR The use of these characters with C outside bracketed character classes and when not preceded by a backslash has raised a deprecation warning since v5.18. Now they will be ignored. =head2 Comment lines within S> are now ended only by a C<\n> S> is an experimental feature, introduced in v5.18. It operates as if C is always enabled. But there was a difference: comment lines (following a C<#> character) were terminated by anything matching C<\R> which includes all vertical whitespace, such as form feeds. For consistency, this is now changed to match what terminates comment lines outside S>, namely a C<\n> (even if escaped), which is the same as what terminates a heredoc string and formats. =head2 C<(?[...])> operators now follow standard Perl precedence This experimental feature allows set operations in regular expression patterns. Prior to this, the intersection operator had the same precedence as the other binary operators. Now it has higher precedence. This could lead to different outcomes than existing code expects (though the documentation has always noted that this change might happen, recommending fully parenthesizing the expressions). See L. =head2 Omitting C<%> and C<@> on hash and array names is no longer permitted Really old Perl let you omit the C<@> on array names and the C<%> on hash names in some spots. This has issued a deprecation warning since Perl 5.000, and is no longer permitted. =head2 C<"$!"> text is now in English outside the scope of C Previously, the text, unlike almost everything else, always came out based on the current underlying locale of the program. (Also affected on some systems is C<"$^E">.) For programs that are unprepared to handle locale differences, this can cause garbage text to be displayed. It's better to display text that is translatable via some tool than garbage text which is much harder to figure out. =head2 C<"$!"> text will be returned in UTF-8 when appropriate The stringification of C<$!> and C<$^E> will have the UTF-8 flag set when the text is actually non-ASCII UTF-8. This will enable programs that are set up to be locale-aware to properly output messages in the user's native language. Code that needs to continue the 5.20 and earlier behavior can do the stringification within the scopes of both S> and S>. Within these two scopes, no other Perl operations will be affected by locale; only C<$!> and C<$^E> stringification. The C pragma causes the UTF-8 flag to not be set, just as in previous Perl releases. This resolves L<[GH #12035]|https://github.com/Perl/perl5/issues/12035>. =head2 Support for C without explicit operator has been removed The C construct, which allows matching a regex only once, previously had an alternative form that was written directly with a question mark delimiter, omitting the explicit C operator. This usage has produced a deprecation warning since 5.14.0. It is now a syntax error, so that the question mark can be available for use in new operators. =head2 C and C are now fatal errors These have been deprecated since v5.6.1 and have raised deprecation warnings since v5.16. =head2 Using a hash or an array as a reference are now fatal errors For example, C<< %foo->{"bar"} >> now causes a fatal compilation error. These have been deprecated since before v5.8, and have raised deprecation warnings since then. =head2 Changes to the C<*> prototype The C<*> character in a subroutine's prototype used to allow barewords to take precedence over most, but not all, subroutine names. It was never consistent and exhibited buggy behavior. Now it has been changed, so subroutines always take precedence over barewords, which brings it into conformity with similarly prototyped built-in functions: sub splat(*) { ... } sub foo { ... } splat(foo); # now always splat(foo()) splat(bar); # still splat('bar') as before close(foo); # close(foo()) close(bar); # close('bar') =head1 Deprecations =head2 Setting C<${^ENCODING}> to anything but C This variable allows Perl scripts to be written in an encoding other than ASCII or UTF-8. However, it affects all modules globally, leading to wrong answers and segmentation faults. New scripts should be written in UTF-8; old scripts should be converted to UTF-8, which is easily done with the L utility. =head2 Use of non-graphic characters in single-character variable names The syntax for single-character variable names is more lenient than for longer variable names, allowing the one-character name to be a punctuation character or even invisible (a non-graphic). Perl v5.20 deprecated the ASCII-range controls as such a name. Now, all non-graphic characters that formerly were allowed are deprecated. The practical effect of this occurs only when not under C>, and affects just the C1 controls (code points 0x80 through 0xFF), NO-BREAK SPACE, and SOFT HYPHEN. =head2 Inlining of C with observable side-effects In many cases Perl makes S> into an inlinable constant subroutine, capturing the value of C<$var> at the time the C expression is evaluated. This can break the closure behavior in those cases where C<$var> is subsequently modified, since the subroutine won't return the changed value. (Note that this all only applies to anonymous subroutines with an empty prototype (S>).) This usage is now deprecated in those cases where the variable could be modified elsewhere. Perl detects those cases and emits a deprecation warning. Such code will likely change in the future and stop producing a constant. If your variable is only modified in the place where it is declared, then Perl will continue to make the sub inlinable with no warnings. sub make_constant { my $var = shift; return sub () { $var }; # fine } sub make_constant_deprecated { my $var; $var = shift; return sub () { $var }; # deprecated } sub make_constant_deprecated2 { my $var = shift; log_that_value($var); # could modify $var return sub () { $var }; # deprecated } In the second example above, detecting that C<$var> is assigned to only once is too hard to detect. That it happens in a spot other than the C declaration is enough for Perl to find it suspicious. This deprecation warning happens only for a simple variable for the body of the sub. (A C block or C statement inside the sub is ignored, because it does not become part of the sub's body.) For more complex cases, such as S> the behavior has changed such that inlining does not happen if the variable is modifiable elsewhere. Such cases should be rare. =head2 Use of multiple C regexp modifiers It is now deprecated to say something like any of the following: qr/foo/xx; /(?xax:foo)/; use re qw(/amxx); That is, now C should only occur once in any string of contiguous regular expression pattern modifiers. We do not believe there are any occurrences of this in all of CPAN. This is in preparation for a future Perl release having C permit white-space for readability in bracketed character classes (those enclosed in square brackets: C<[...]>). =head2 Using a NO-BREAK space in a character alias for C<\N{...}> is now deprecated This non-graphic character is essentially indistinguishable from a regular space, and so should not be allowed. See L. =head2 A literal C<"{"> should now be escaped in a pattern If you want a literal left curly bracket (also called a left brace) in a regular expression pattern, you should now escape it by either preceding it with a backslash (C<"\{">) or enclosing it within square brackets C<"[{]">, or by using C<\Q>; otherwise a deprecation warning will be raised. This was first announced as forthcoming in the v5.16 release; it will allow future extensions to the language to happen. =head2 Making all warnings fatal is discouraged The documentation for L notes that C<< use warnings FATAL => 'all' >> is discouraged, and provides stronger language about the risks of fatal warnings in general. =head1 Performance Enhancements =over 4 =item * If a method or class name is known at compile time, a hash is precomputed to speed up run-time method lookup. Also, compound method names like C are parsed at compile time, to save having to parse them at run time. =item * Array and hash lookups (especially nested ones) that use only constants or simple variables as keys, are now considerably faster. See L for more details. =item * C<(...)x1>, C<("constant")x0> and C<($scalar)x0> are now optimised in list context. If the right-hand argument is a constant 1, the repetition operator disappears. If the right-hand argument is a constant 0, the whole expression is optimised to the empty list, so long as the left-hand argument is a simple scalar or constant. (That is, C<(foo())x0> is not subject to this optimisation.) =item * C assignment is now optimised into 4-argument C at the end of a subroutine (or as the argument to C). Previously, this optimisation only happened in void context. =item * In C<"\L...">, C<"\Q...">, etc., the extra "stringify" op is now optimised away, making these just as fast as C, C, etc. =item * Assignment to an empty list is now sometimes faster. In particular, it never calls C on tied arguments on the right-hand side, whereas it used to sometimes. =item * There is a performance improvement of up to 20% when C is applied to a non-magical, non-tied string, and either C is in scope or the string doesn't use UTF-8 internally. =item * On most perl builds with 64-bit integers, memory usage for non-magical, non-tied scalars containing only a floating point value has been reduced by between 8 and 32 bytes, depending on OS. =item * In C<@array = split>, the assignment can be optimized away, so that C writes directly to the array. This optimisation was happening only for package arrays other than C<@_>, and only sometimes. Now this optimisation happens almost all the time. =item * C is now subject to constant folding. So for example S> is converted at compile-time to C<"a-b">. Moreover, C with a scalar or constant for the separator and a single-item list to join is simplified to a stringification, and the separator doesn't even get evaluated. =item * C is implemented using two ops: a stringify op and a join op. If the C contains nothing but a single array, the stringification is optimized away. =item * S> and S> in void context are no longer evaluated at run time. Even a whole sequence of S> statements will simply be skipped over. The same applies to C variables. =item * Many internal functions have been refactored to improve performance and reduce their memory footprints. L<[GH #13659]|https://github.com/Perl/perl5/issues/13659> L<[GH #13856]|https://github.com/Perl/perl5/issues/13856> L<[GH #13874]|https://github.com/Perl/perl5/issues/13874> =item * C<-T> and C<-B> filetests will return sooner when an empty file is detected. L<[GH #13686]|https://github.com/Perl/perl5/issues/13686> =item * Hash lookups where the key is a constant are faster. =item * Subroutines with an empty prototype and a body containing just C are now eligible for inlining. L<[GH #14077]|https://github.com/Perl/perl5/issues/14077> =item * Subroutines in packages no longer need to be stored in typeglobs: declaring a subroutine will now put a simple sub reference directly in the stash if possible, saving memory. The typeglob still notionally exists, so accessing it will cause the stash entry to be upgraded to a typeglob (I this is just an internal implementation detail). This optimization does not currently apply to XSUBs or exported subroutines, and method calls will undo it, since they cache things in typeglobs. L<[GH #13392]|https://github.com/Perl/perl5/issues/13392> =item * The functions C and C (see L) are now optimized out on ASCII platforms. There is now not even a minimal performance hit in writing code portable between ASCII and EBCDIC platforms. =item * Win32 Perl uses 8 KB less of per-process memory than before for every perl process, because some data is now memory mapped from disk and shared between processes from the same perl binary. =back =head1 Modules and Pragmata =head2 Updated Modules and Pragmata Many of the libraries distributed with perl have been upgraded since v5.20.0. For a complete list of changes, run: corelist --diff 5.20.0 5.22.0 You can substitute your favorite version in place of 5.20.0, too. Some notable changes include: =over 4 =item * L has been upgraded to version 2.04. Tests can now be run in parallel. =item * L has been upgraded to version 0.27. The usage of C in the XS has been corrected. L<[GH #14072]|https://github.com/Perl/perl5/issues/14072> Avoid reading beyond the end of a buffer. [perl #122629] =item * L has been upgraded to version 1.58. It provides a new C function, based on the existing C<< B::GV->SAFENAME >>, that converts C<\cOPEN> to C<^OPEN>. Nulled COPs are now of class C, rather than C. C objects now provide a C method for accessing the implicit CV associated with C things containing code blocks, and a C method that returns the pertinent flags originating from the C op. C now provides a C method returning a C object. Two new classes, C and C, have been introduced. A bug where, after an ithread creation or pseudofork, special/immortal SVs in the child ithread/pseudoprocess did not have the correct class of C, has been fixed. The C and C PADLIST methods have been added. =item * L has been upgraded to version 0.996. Null ops that are part of the execution chain are now given sequence numbers. Private flags for nulled ops are now dumped with mnemonics as they would be for the non-nulled counterparts. =item * L has been upgraded to version 1.35. It now deparses C<+sub : attr { ... }> correctly at the start of a statement. Without the initial C<+>, C would be a statement label. C blocks are now emitted in the right place most of the time, but the change unfortunately introduced a regression, in that C blocks occurring just before the end of the enclosing block may appear below it instead. C no longer puts erroneous C here and there, such as for C. [perl #119815] Adjacent C statements are no longer accidentally nested if one contains a C block. [perl #115066] Parenthesised arrays in lists passed to C<\> are now correctly deparsed with parentheses (I, C<\(@a, (@b), @c)> now retains the parentheses around @b), thus preserving the flattening behavior of referenced parenthesised arrays. Formerly, it only worked for one array: C<\(@a)>. C is now deparsed correctly, with the C included. C was deparsed without the C (or C). This has been fixed. Core keywords that conflict with lexical subroutines are now deparsed with the C prefix. C now deparses correctly with C and not C. C now deparses correctly with C in those cases where the assignment is optimized away. It now deparses C)> and typed lexical (C) correctly. Deparse C<$#_> as that instead of as C<$#{_}>. L<[GH #14545]|https://github.com/Perl/perl5/issues/14545> BEGIN blocks at the end of the enclosing scope are now deparsed in the right place. [perl #77452] BEGIN blocks were sometimes deparsed as __ANON__, but are now always called BEGIN. Lexical subroutines are now fully deparsed. [perl #116553] C with C no longer omits the left-hand operand. The op trees that make up regexp code blocks are now deparsed for real. Formerly, the original string that made up the regular expression was used. That caused problems with CEheredoc})/> and multiline code blocks, which were deparsed incorrectly. [perl #123217] [perl #115256] C<$;> at the end of a statement no longer loses its semicolon. [perl #123357] Some cases of subroutine declarations stored in the stash in shorthand form were being omitted. Non-ASCII characters are now consistently escaped in strings, instead of some of the time. (There are still outstanding problems with regular expressions and identifiers that have not been fixed.) When prototype sub calls are deparsed with C<&> (I, under the B<-P> option), C is now added where appropriate, to force the scalar context implied by the prototype. C, C, C and similar constructs with loop controls are now deparsed correctly. The outer parentheses are not optional. Whitespace is no longer escaped in regular expressions, because it was getting erroneously escaped within C<(?x:...)> sections. C is now deparsed with those mandatory parentheses. C is now deparsed as a regular expression, and not just C<@array>. C, C and C<$#{1}> are now deparsed with the braces, which are mandatory in these cases. In deparsing feature bundles, C was emitting C first instead of C. This has been fixed. C is now deparsed without quotation marks. C<\my @a> is now deparsed without parentheses. (Parenthese would flatten the array.) C and C followed by a block are now deparsed correctly. Formerly there was an erroneous C before the block. C<< use constant QR =E qr/.../flags >> followed by C<"" =~ QR> is no longer without the flags. Deparsing C with the B<-w> switch enabled started to emit 'uninitialized' warnings in Perl 5.14. This has been fixed. Deparsing calls to subs with a C<(;+)> prototype resulted in an infinite loop. The C<(;$>) C<(_)> and C<(;_)> prototypes were given the wrong precedence, causing C$b)> to be deparsed without the parentheses. Deparse now provides a defined state sub in inner subs. =item * L has been added. L provides detailed information about the flags used in the C field of perl opcodes. =item * L, L, L have been upgraded to version 0.39. Document in CAVEATS that using strings as numbers won't always invoke the big number overloading, and how to invoke it. [rt.perl.org #123064] =item * L has been upgraded to version 1.36. C now ignores version mismatches with Carp if Carp is newer than 1.12, since C's guts were merged into Carp at that point. L<[GH #13708]|https://github.com/Perl/perl5/issues/13708> Carp now handles non-ASCII platforms better. Off-by-one error fix for Perl E 5.14. =item * L has been upgraded to version 1.33. It now accepts fully-qualified constant names, allowing constants to be defined in packages other than the caller. =item * L has been upgraded to version 2.11. Add support for C and introduce workaround for a misbehavior seen on Strawberry Perl 5.20.1. Fix C after building dependencies bug. Introduce experimental support for plugins/hooks. Integrate the C sources. Do not check recursion on optional dependencies. Sanity check F to contain a hash. L<[cpan #95271]|https://rt.cpan.org/Ticket/Display.html?id=95271> =item * L has been upgraded to version 2.132. Works around limitations in C detecting v-string magic and adds support for forthcoming L bootstrap F for Perls older than 5.10.0. =item * L has been upgraded to version 2.158. Fixes CVE-2014-4330 by adding a configuration variable/option to limit recursion when dumping deep data structures. Changes to resolve Coverity issues. XS dumps incorrectly stored the name of code references stored in a GLOB. L<[GH #13911]|https://github.com/Perl/perl5/issues/13911> =item * L has been upgraded to version 1.32. Remove C global if unused in Dynaloader. [perl #122926] =item * L has been upgraded to version 2.72. C now has better error handling when the encoding name is nonexistent, and a build breakage when upgrading L in perl-5.8.2 and earlier has been fixed. Building in C++ mode on Windows now works. =item * L has been upgraded to version 1.23. Add C<-P> to the preprocessor command-line on GCC 5. GCC added extra line directives, breaking parsing of error code definitions. [rt.perl.org #123784] =item * L has been upgraded to version 0.013. Hardcodes features for Perls older than 5.15.7. =item * L has been upgraded to version 0.280221. Fixes a regression on Android. L<[GH #14064]|https://github.com/Perl/perl5/issues/14064> =item * L has been upgraded to version 1.70. Fixes a bug with C's handling of quoted filenames and improves C to follow symlinks. L<[GH #14003]|https://github.com/Perl/perl5/issues/14003> =item * L has been upgraded to version 3.28. Only declare C unused if we actually define it. Improve generated C code generation to avoid repeated references to C. [perl #123278] Broaden and document the C to C typemap optimization for the C method. [perl #123418] =item * L has been upgraded to version 1.13. Add support for the Linux pipe buffer size C commands. =item * L has been upgraded to version 1.29. C and C will now warn if passed inappropriate or misspelled options. =item * L has been upgraded to version 1.24. Avoid C expanding to call C three times in a few places. [perl #123606] =item * L has been upgraded to version 0.054. C is now fork-safe and thread-safe. =item * L has been upgraded to version 1.35. The XS implementation has been fixed for the sake of older Perls. =item * L has been upgraded to version 1.38. Document the limitations of the C method. [perl #123096] =item * L has been upgraded to version 0.37. A better fix for subclassing C. L<[cpan #95983]|https://rt.cpan.org/Ticket/Display.html?id=95983> L<[cpan #97050]|https://rt.cpan.org/Ticket/Display.html?id=97050> Implements Timeout for C. L<[cpan #92075]|https://rt.cpan.org/Ticket/Display.html?id=92075> =item * The libnet collection of modules has been upgraded to version 3.05. Support for IPv6 and SSL to C, C, C and C. Improvements in C authentication. =item * L has been upgraded to version 3.34. Fixed a bug in the scripts used to extract data from spreadsheets that prevented the SHP currency code from being found. L<[cpan #94229]|https://rt.cpan.org/Ticket/Display.html?id=94229> New codes have been added. =item * L has been upgraded to version 1.9997. Synchronize POD changes from the CPAN release. C<< Math::BigFloat->blog(x) >> would sometimes return C when the accuracy was greater than 70 digits. The result of C<< Math::BigFloat->bdiv() >> in list context now satisfies C<< x = quotient * divisor + remainder >>. Correct handling of subclasses. L<[cpan #96254]|https://rt.cpan.org/Ticket/Display.html?id=96254> L<[cpan #96329]|https://rt.cpan.org/Ticket/Display.html?id=96329> =item * L has been upgraded to version 1.000026. Support installations on older perls with an L earlier than 6.63_03 =item * L has been upgraded to version 1.26. A redundant C check has been removed. =item * The PathTools module collection has been upgraded to version 3.56. A warning from the B compiler is now avoided when building the XS. Don't turn leading C into C on Cygwin. [perl #122635] =item * L has been upgraded to version 1.49. The debugger would cause an assertion failure. L<[GH #14605]|https://github.com/Perl/perl5/issues/14605> C in the debugger under C will now create a new window for the forked process. L<[GH #13602]|https://github.com/Perl/perl5/issues/13602> The debugger now saves the current working directory on startup and restores it when you restart your program with C or C. L<[GH #13691]|https://github.com/Perl/perl5/issues/13691> =item * L has been upgraded to version 0.22. Reading from a position well past the end of the scalar now correctly returns end of file. [perl #123443] Seeking to a negative position still fails, but no longer leaves the file position set to a negation location. C on a C handle now properly returns true when the file position is past the 2GB mark on 32-bit systems. Attempting to write at file positions impossible for the platform now fail early rather than wrapping at 4GB. =item * L has been upgraded to version 3.25. Filehandles opened for reading or writing now have C<:encoding(UTF-8)> set. L<[cpan #98019]|https://rt.cpan.org/Ticket/Display.html?id=98019> =item * L has been upgraded to version 1.53. The C99 math functions and constants (for example C, C, C, C, C; C, C, C) have been added. C now produces a deprecation warning. [perl #122005] =item * L has been upgraded to version 2.39. C was not propagating void context properly. =item * Scalar-List-Utils has been upgraded to version 1.41. A new module, L, has been added, containing functions related to CODE refs, including C (inspired by C) and C (copied and renamed from C). The use of C in C has also been fixed. L<[cpan #63211]|https://rt.cpan.org/Ticket/Display.html?id=63211> =item * L has been upgraded to version 1.13. Simplified the build process. [perl #123413] =item * L has been upgraded to version 1.29. When pretty printing negative C, the "minus" is no longer lost. =item * L has been upgraded to version 1.12. Version 0.67's improved discontiguous contractions is invalidated by default and is supported as a parameter C. =item * L has been upgraded to version 1.18. The XSUB implementation has been removed in favor of pure Perl. =item * L has been upgraded to version 0.61. A new function L has been added to return a given property's possible values. A new function L has been added to return the value of a given property for a given code point. A new function L has been added to return the values of all Unicode properties for a given code point. A bug has been fixed so that L returns the correct short and long names for the Perl extensions where it was incorrect. A bug has been fixed so that L returns C instead of a wrong result for properties that are Perl extensions. This module now works on EBCDIC platforms. =item * L has been upgraded to version 1.17 A mismatch between the documentation and the code in C was fixed in favor of the documentation. The optional second argument is now correctly treated as a perl boolean (true/false semantics) and not as an integer. =item * L has been upgraded to version 0.9909. Numerous changes. See the F file in the CPAN distribution for details. =item * L has been upgraded to version 0.51. C now supports Windows 8.1, and building in C++ mode now works. =item * L has been upgraded to version 0.1202 Building in C++ mode now works. =item * L has been upgraded to version 0.20. Allow XSLoader to load modules from a different namespace. [perl #122455] =back =head2 Removed Modules and Pragmata The following modules (and associated modules) have been removed from the core perl distribution: =over 4 =item * L =item * L =back =head1 Documentation =head2 New Documentation =head3 L This document, by Tom Christiansen, provides examples of handling Unicode in Perl. =head2 Changes to Existing Documentation =head3 L =over 4 =item * A note on long doubles has been added. =back =head3 L =over 4 =item * Note that C doesn't do set magic. =item * C - fix documentation to mention the use of C instead of C. L<[GH #13835]|https://github.com/Perl/perl5/issues/13835> =item * Clarify where C may be embedded or is required to terminate a string. =item * Some documentation that was previously missing due to formatting errors is now included. =item * Entries are now organized into groups rather than by the file where they are found. =item * Alphabetical sorting of entries is now done consistently (automatically by the POD generator) to make entries easier to find when scanning. =back =head3 L =over 4 =item * The syntax of single-character variable names has been brought up-to-date and more fully explained. =item * Hexadecimal floating point numbers are described, as are infinity and NaN. =back =head3 L =over 4 =item * This document has been significantly updated in the light of recent improvements to EBCDIC support. =back =head3 L =over 4 =item * Added a L section. =back =head3 L =over 4 =item * Mention that C is currently a no-op. =item * Calling C or C on array values is now described as "strongly discouraged" rather than "deprecated". =item * Improve documentation of C<< our >>. =item * C<-l> now notes that it will return false if symlinks aren't supported by the file system. L<[GH #13695]|https://github.com/Perl/perl5/issues/13695> =item * Note that C and C may fall back to the shell on Win32. Only the indirect-object syntax C and C will reliably avoid using the shell. This has also been noted in L. L<[GH #13907]|https://github.com/Perl/perl5/issues/13907> =back =head3 L =over 4 =item * The OOK example has been updated to account for COW changes and a change in the storage of the offset. =item * Details on C level symbols and libperl.t added. =item * Information on Unicode handling has been added =item * Information on EBCDIC handling has been added =back =head3 L =over 4 =item * A note has been added about running on platforms with non-ASCII character sets =item * A note has been added about performance testing =back =head3 L =over 4 =item * Documentation has been added illustrating the perils of assuming that there is no change to the contents of static memory pointed to by the return values of Perl's wrappers for C library functions. =item * Replacements for C, C, C, and C are now recommended. =item * Updated documentation for the C C target. L<[GH #13658]|https://github.com/Perl/perl5/issues/13658> =item * Information is given about writing test files portably to non-ASCII platforms. =item * A note has been added about how to get a C language stack backtrace. =back =head3 L =over 4 =item * Note that the message "Redeclaration of "sendpath" with a different storage class specifier" is harmless. =back =head3 L =over 4 =item * Updated for the enhancements in v5.22, along with some clarifications. =back =head3 L =over 4 =item * Instead of pointing to the module list, we are now pointing to L. =back =head3 L =over 4 =item * Updated for the enhancements in v5.22, along with some clarifications. =back =head3 L =over 4 =item * The specification of the pod language is changing so that the default encoding of pods that aren't in UTF-8 (unless otherwise indicated) is CP1252 instead of ISO 8859-1 (Latin1). =back =head3 L =over 4 =item * We now have a code of conduct for the I<< p5p >> mailing list, as documented in L<< perlpolicy/STANDARDS OF CONDUCT >>. =item * The conditions for marking an experimental feature as non-experimental are now set out. =item * Clarification has been made as to what sorts of changes are permissible in maintenance releases. =back =head3 L =over 4 =item * Out-of-date VMS-specific information has been fixed and/or simplified. =item * Notes about EBCDIC have been added. =back =head3 L =over 4 =item * The description of the C modifier has been clarified to note that comments cannot be continued onto the next line by escaping them; and there is now a list of all the characters that are considered whitespace by this modifier. =item * The new C modifier is described. =item * A note has been added on how to make bracketed character class ranges portable to non-ASCII machines. =back =head3 L =over 4 =item * Added documentation of C<\b{sb}>, C<\b{wb}>, C<\b{gcb}>, and C<\b{g}>. =back =head3 L =over 4 =item * Clarifications have been added to L to the effect C<[A-Z]>, C<[a-z]>, C<[0-9]> and any subranges thereof in regular expression bracketed character classes are guaranteed to match exactly what a naive English speaker would expect them to match, even on platforms (such as EBCDIC) where perl has to do extra work to accomplish this. =item * The documentation of Bracketed Character Classes has been expanded to cover the improvements in C (see under L). =back =head3 L =over 4 =item * A new section has been added L =back =head3 L =over 4 =item * Comments added on algorithmic complexity and tied hashes. =back =head3 L =over 4 =item * An ambiguity in the documentation of the C<...> statement has been corrected. L<[GH #14054]|https://github.com/Perl/perl5/issues/14054> =item * The empty conditional in C<< for >> and C<< while >> is now documented in L<< perlsyn >>. =back =head3 L =over 4 =item * This has had extensive revisions to bring it up-to-date with current Unicode support and to make it more readable. Notable is that Unicode 7.0 changed what it should do with non-characters. Perl retains the old way of handling for reasons of backward compatibility. See L. =back =head3 L =over 4 =item * Advice for how to make sure your strings and regular expression patterns are interpreted as Unicode has been updated. =back =head3 L =over 4 =item * C<$]> is no longer listed as being deprecated. Instead, discussion has been added on the advantages and disadvantages of using it versus C<$^V>. C<$OLD_PERL_VERSION> was re-added to the documentation as the long form of C<$]>. =item * C<${^ENCODING}> is now marked as deprecated. =item * The entry for C<%^H> has been clarified to indicate it can only handle simple values. =back =head3 L =over 4 =item * Out-of-date and/or incorrect material has been removed. =item * Updated documentation on environment and shell interaction in VMS. =back =head3 L =over 4 =item * Added a discussion of locale issues in XS code. =back =head1 Diagnostics The following additions or changes have been made to diagnostic output, including warnings and fatal error messages. For the complete list of diagnostic messages, see L. =head2 New Diagnostics =head3 New Errors =over 4 =item * L (P) An internal request asked to add a scalar entry to something that wasn't a symbol table entry. =item * L (F) You tried to use a hash as a reference, as in C<< %foo->{"bar"} >> or C<< %$ref->{"hello"} >>. Versions of perl E= 5.6.1 used to allow this syntax, but shouldn't have. =item * L (F) You tried to use an array as a reference, as in C<< @foo->[23] >> or C<< @$ref->[99] >>. Versions of perl E= 5.6.1 used to allow this syntax, but shouldn't have. =item * L (F) C is not useful on arrays because it checks for an undefined I value. If you want to see if the array is empty, just use S> for example. =item * L (F) C is not usually right on hashes. Although S> is false on a plain not-yet-used hash, it becomes true in several non-obvious circumstances, including iterators, weak references, stash names, even remaining true after S>. These things make S> fairly useless in practice, so it now generates a fatal error. If a check for non-empty is what you wanted then just put it in boolean context (see L): if (%hash) { # not empty } If you had S> to check whether such a package variable exists then that's never really been reliable, and isn't a good way to enquire about the features of a package, or whether it's loaded, etc. =item * L (F) You passed an invalid number (like an infinity or not-a-number) to C. =item * L (F) You tried converting an infinity or not-a-number to an unsigned character, which makes no sense. =item * L (F) You tried converting an infinity or not-a-number to a character, which makes no sense. =item * L (F) You tried printing an infinity or not-a-number as a character (C<%c>), which makes no sense. Maybe you meant C<'%s'>, or just stringifying it? =item * L (F) You defined a character name which had multiple space characters in a row. Change them to single spaces. Usually these names are defined in the C<:alias> import argument to C, but they could be defined by a translator installed into C<$^H{charnames}>. See L. =item * L (F) You defined a character name which ended in a space character. Remove the trailing space(s). Usually these names are defined in the C<:alias> import argument to C, but they could be defined by a translator installed into C<$^H{charnames}>. See L. =item * L<:const is not permitted on named subroutines|perldiag/":const is not permitted on named subroutines"> (F) The C attribute causes an anonymous subroutine to be run and its value captured at the time that it is cloned. Named subroutines are not cloned like this, so the attribute does not make sense on them. =item * L (F) Something went horribly bad in hexadecimal float handling. =item * L (F) You have configured Perl to use long doubles but the internals of the long double format are unknown, therefore the hexadecimal float output is impossible. =item * L (F) The script run under suidperl was somehow illegal. =item * L in mE%sE|perldiag/"In '(?...)', the '(' and '?' must be adjacent in regex; marked by <-- HERE in m/%s/"> (F) The two-character sequence C<"(?"> in this context in a regular expression pattern should be an indivisible token, with nothing intervening between the C<"("> and the C<"?">, but you separated them. =item * L in mE%sE|perldiag/"In '(*VERB...)', the '(' and '*' must be adjacent in regex; marked by <-- HERE in m/%s/"> (F) The two-character sequence C<"(*"> in this context in a regular expression pattern should be an indivisible token, with nothing intervening between the C<"("> and the C<"*">, but you separated them. =item * L%sE|perldiag/"Invalid quantifier in {,} in regex; marked by <-- HERE in m/%s/"> (F) The pattern looks like a {min,max} quantifier, but the min or max could not be parsed as a valid number: either it has leading zeroes, or it represents too big a number to cope with. The S<<-- HERE> shows where in the regular expression the problem was discovered. See L. =item * L<'%s' is an unknown bound type in regex|perldiag/"'%s' is an unknown bound type in regex; marked by <-- HERE in m/%s/"> (F) You used C<\b{...}> or C<\B{...}> and the C<...> is not known to Perl. The current valid ones are given in L. =item * L (F) You tried to call C with no argument or with an undefined value as an argument. C expects either a package name or a file-specification as an argument. See L. Formerly, C with no argument or C warned about a Null filename. =back =head3 New Warnings =over 4 =item * L<\C is deprecated in regex|perldiag/"\C is deprecated in regex; marked by <-- HERE in m/%s/"> (D deprecated) The C<< /\C/ >> character class was deprecated in v5.20, and now emits a warning. It is intended that it will become an error in v5.24. This character class matches a single byte even if it appears within a multi-byte character, breaks encapsulation, and can corrupt UTF-8 strings. =item * L<"%s" is more clearly written simply as "%s" in regex; marked by E-- HERE in mE%sE|perldiag/"%s" is more clearly written simply as "%s" in regex; marked by <-- HERE in mE%sE> (W regexp) (only under C> or within C<(?[...])>) You specified a character that has the given plainer way of writing it, and which is also portable to platforms running with different character sets. =item * L (W numeric) The indicated string was fed as an argument to the C<++> operator which expects either a number or a string matching C. See L for details. =item * L-- HERE in mE%sE|perldiag/"Both or neither range ends should be Unicode in regex; marked by <-- HERE in m/%s/"> (W regexp) (only under C> or within C<(?[...])>) In a bracketed character class in a regular expression pattern, you had a range which has exactly one end of it specified using C<\N{}>, and the other end is specified using a non-portable mechanism. Perl treats the range as a Unicode range, that is, all the characters in it are considered to be the Unicode characters, and which may be different code points on some platforms Perl runs on. For example, C<[\N{U+06}-\x08]> is treated as if you had instead said C<[\N{U+06}-\N{U+08}]>, that is it matches the characters whose code points in Unicode are 6, 7, and 8. But that C<\x08> might indicate that you meant something different, so the warning gets raised. =item * L (W locale) You are 1) running under "C"; 2) the current locale is not a UTF-8 one; 3) you tried to do the designated case-change operation on the specified Unicode character; and 4) the result of this operation would mix Unicode and locale rules, which likely conflict. The warnings category C is new. =item * L<:const is experimental|perldiag/":const is experimental"> (S experimental::const_attr) The C attribute is experimental. If you want to use the feature, disable the warning with C, but know that in doing so you are taking the risk that your code may break in a future Perl version. =item * L (W overflow) You called C with a number that it could not handle: too large, too small, or NaN. The returned value is C. =item * L (W overflow) The hexadecimal floating point has larger exponent than the floating point supports. =item * L (W overflow) The hexadecimal floating point has smaller exponent than the floating point supports. =item * L (W overflow) The hexadecimal floating point literal had more bits in the mantissa (the part between the C<0x> and the exponent, also known as the fraction or the significand) than the floating point supports. =item * L (W overflow) The hexadecimal floating point had internally more digits than could be output. This can be caused by unsupported long double formats, or by 64-bit integers not being available (needed to retrieve the digits under some configurations). =item * L (W locale) You are using the named locale, which is a non-UTF-8 one, and which perl has determined is not fully compatible with what it can handle. The second C<%s> gives a reason. The warnings category C is new. =item * L (W overflow) You called C with a number that it could not handle: too large, too small, or NaN. The returned value is C. =item * L (W numeric) You tried to execute the L|perlop/Multiplicative Operators> repetition operator fewer than 0 times, which doesn't make sense. =item * L (D deprecated) You defined a character name which contained a no-break space character. Change it to a regular space. Usually these names are defined in the C<:alias> import argument to C, but they could be defined by a translator installed into C<$^H{charnames}>. See L. =item * L (W numeric) You tried to execute the L|perlop/Multiplicative Operators> repetition operator C (or C<-Inf>) or NaN times, which doesn't make sense. =item * L (S experimental::win32_perlio) The C<:win32> PerlIO layer is experimental. If you want to take the risk of using this layer, simply disable this warning: no warnings "experimental::win32_perlio"; =item * L-- HERE in mE%sE|perldiag/"Ranges of ASCII printables should be some subset of "0-9", "A-Z", or "a-z" in regex; marked by <-- HERE in mE%sE"> (W regexp) (only under C> or within C<(?[...])>) Stricter rules help to find typos and other errors. Perhaps you didn't even intend a range here, if the C<"-"> was meant to be some other character, or should have been escaped (like C<"\-">). If you did intend a range, the one that was used is not portable between ASCII and EBCDIC platforms, and doesn't have an obvious meaning to a casual reader. [3-7] # OK; Obvious and portable [d-g] # OK; Obvious and portable [A-Y] # OK; Obvious and portable [A-z] # WRONG; Not portable; not clear what is meant [a-Z] # WRONG; Not portable; not clear what is meant [%-.] # WRONG; Not portable; not clear what is meant [\x41-Z] # WRONG; Not portable; not obvious to non-geek (You can force portability by specifying a Unicode range, which means that the endpoints are specified by L|perlrecharclass/Character Ranges>, but the meaning may still not be obvious.) The stricter rules require that ranges that start or stop with an ASCII character that is not a control have all their endpoints be a literal character, and not some escape sequence (like C<"\x41">), and the ranges must be all digits, or all uppercase letters, or all lowercase letters. =item * L-- HERE in mE%sE|perldiag/"Ranges of digits should be from the same group in regex; marked by <-- HERE in m/%s/"> (W regexp) (only under C> or within C<(?[...])>) Stricter rules help to find typos and other errors. You included a range, and at least one of the end points is a decimal digit. Under the stricter rules, when this happens, both end points should be digits in the same group of 10 consecutive digits. =item * L (W redundant) You called a function with more arguments than were needed, as indicated by information within other arguments you supplied (I. a printf format). Currently only emitted when a printf-type format required fewer arguments than were supplied, but might be used in the future for I L. The warnings category C<< redundant >> is new. See also L<[GH #13534]|https://github.com/Perl/perl5/issues/13534>. =item * L This is not a new diagnostic, but in earlier releases was accidentally not displayed if the transliteration contained wide characters. This is now fixed, so that you may see this diagnostic in places where you previously didn't (but should have). =item * L (W locale) You are matching a regular expression using locale rules, and a Unicode boundary is being matched, but the locale is not a Unicode one. This doesn't make sense. Perl will continue, assuming a Unicode (UTF-8) locale, but the results could well be wrong except if the locale happens to be ISO-8859-1 (Latin1) where this message is spurious and can be ignored. The warnings category C is new. =item * L<< Using Eu for '%s' instead of E%s in regex; marked by E-- HERE in mE%sE|perldiag/"Using Eu for '%s' instead of E%s in regex; marked by <-- HERE in mE%sE" >> (W regexp) You used a Unicode boundary (C<\b{...}> or C<\B{...}>) in a portion of a regular expression where the character set modifiers C or C are in effect. These two modifiers indicate an ASCII interpretation, and this doesn't make sense for a Unicode definition. The generated regular expression will compile so that the boundary uses all of Unicode. No other portion of the regular expression is affected. =item * L (S experimental::bitwise) This warning is emitted if you use bitwise operators (C<& | ^ ~ &. |. ^. ~.>) with the "bitwise" feature enabled. Simply suppress the warning if you want to use the feature, but know that in doing so you are taking the risk of using an experimental feature which may change or be removed in a future Perl version: no warnings "experimental::bitwise"; use feature "bitwise"; $x |.= $y; =item * L%sE|perldiag/"Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/%s/"> (D deprecated, regexp) You used a literal C<"{"> character in a regular expression pattern. You should change to use C<"\{"> instead, because a future version of Perl (tentatively v5.26) will consider this to be a syntax error. If the pattern delimiters are also braces, any matching right brace (C<"}">) should also be escaped to avoid confusing the parser, for example, qr{abc\{def\}ghi} =item * L (D deprecated) Using literal non-graphic (including control) characters in the source to refer to the I<^FOO> variables, like C<$^X> and C<${^GLOBAL_PHASE}> is now deprecated. =item * L (W misc) The C attribute has no effect except on anonymous closure prototypes. You applied it to a subroutine via L. This is only useful inside an attribute handler for an anonymous subroutine. =item * Ld modifier in transliteration operator|perldiag/"Useless use of /d modifier in transliteration operator"> This is not a new diagnostic, but in earlier releases was accidentally not displayed if the transliteration contained wide characters. This is now fixed, so that you may see this diagnostic in places where you previously didn't (but should have). =item * Luse re 'strict'E is experimental|perldiag/"use re 'strict'" is experimental> (S experimental::re_strict) The things that are different when a regular expression pattern is compiled under C<'strict'> are subject to change in future Perl releases in incompatible ways; there are also proposals to change how to enable strict checking instead of using this subpragma. This means that a pattern that compiles today may not in a future Perl release. This warning is to alert you to that risk. =item * L L (S io) Previously, perl silently ignored any errors when doing an implicit close of a filehandle, I where the reference count of the filehandle reached zero and the user's code hadn't already called C; I { open my $fh, '>', $file or die "open: '$file': $!\n"; print $fh, $data or die; } # implicit close here In a situation such as disk full, due to buffering, the error may only be detected during the final close, so not checking the result of the close is dangerous. So perl now warns in such situations. =item * L (W locale) While in a single-byte locale (I, a non-UTF-8 one), a multi-byte character was encountered. Perl considers this character to be the specified Unicode code point. Combining non-UTF-8 locales and Unicode is dangerous. Almost certainly some characters will have two different representations. For example, in the ISO 8859-7 (Greek) locale, the code point 0xC3 represents a Capital Gamma. But so also does 0x393. This will make string comparisons unreliable. You likely need to figure out how this multi-byte character got mixed up with your single-byte locale (or perhaps you thought you had a UTF-8 locale, but Perl disagrees). The warnings category C is new. =back =head2 Changes to Existing Diagnostics =over 4 =item * <> should be quotes This warning has been changed to L<< <> at require-statement should be quotes|perldiag/"<> at require-statement should be quotes" >> to make the issue more identifiable. =item * L The L entry for this warning has added this clarifying note: Note that for the Inf and NaN (infinity and not-a-number) the definition of "numeric" is somewhat unusual: the strings themselves (like "Inf") are considered numeric, and anything following them is considered non-numeric. =item * L This message has had '(did you forget to declare "my %s"?)' appended to it, to make it more helpful to new Perl programmers. L<[GH #13732]|https://github.com/Perl/perl5/issues/13732> =item * '"my" variable &foo::bar can't be in a package' has been reworded to say 'subroutine' instead of 'variable'. =item * L<<< \N{} in character class restricted to one character in regex; marked by S<< <-- HERE >> in mE%sE|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/" >>> This message has had I changed to I to reflect improvements in C (see under L). =item * L This message has had ': C<%f>' appended to it, to show what the offending floating point number is. =item * I reworded as L. =item * L This warning is now only produced when the newline is at the end of the filename. =item * "Variable C<%s> will not stay shared" has been changed to say "Subroutine" when it is actually a lexical sub that will not stay shared. =item * L%sE|perldiag/"Variable length lookbehind not implemented in regex m/%s/"> The L entry for this warning has had information about Unicode behavior added. =back =head2 Diagnostic Removals =over =item * "Ambiguous use of -foo resolved as -&foo()" There is actually no ambiguity here, and this impedes the use of negated constants; I, C<-Inf>. =item * "Constant is not a FOO reference" Compile-time checking of constant dereferencing (I, C<< my_constant->() >>) has been removed, since it was not taking overloading into account. L<[GH #9891]|https://github.com/Perl/perl5/issues/9891> L<[GH #14044]|https://github.com/Perl/perl5/issues/14044> =back =head1 Utility Changes =head2 F, F and F removal =over 4 =item * The F directory has been removed from the Perl core. This removes find2perl, s2p and a2p. They have all been released to CPAN as separate distributions (C, C, C). =back =head2 L =over 4 =item * F now handles hexadecimal constants in the compiler's predefined macro definitions, as visible in C<$Config{cppsymbols}>. L<[GH #14491]|https://github.com/Perl/perl5/issues/14491>. =back =head2 L =over 4 =item * No longer depends on non-core modules. =back =head1 Configuration and Compilation =over 4 =item * F now checks for C, C, C, and C. =item * F with C<-Dmksymlinks> should now be faster. L<[GH #13890]|https://github.com/Perl/perl5/issues/13890>. =item * The C and C libraries will be linked by default if present. This allows XS modules that require threading to work on non-threaded perls. Note that you must still pass C<-Dusethreads> if you want a threaded perl. =item * To get more precision and range for floating point numbers one can now use the GCC quadmath library which implements the quadruple precision floating point numbers on x86 and IA-64 platforms. See F for details. =item * MurmurHash64A and MurmurHash64B can now be configured as the internal hash function. =item * C now supports parallel testing. For example: TEST_JOBS=9 make test.valgrind See L for more information. L<[GH #13658]|https://github.com/Perl/perl5/issues/13658> =item * The MAD (Misc Attribute Decoration) build option has been removed This was an unmaintained attempt at preserving the Perl parse tree more faithfully so that automatic conversion of Perl 5 to Perl 6 would have been easier. This build-time configuration option had been unmaintained for years, and had probably seriously diverged on both Perl 5 and Perl 6 sides. =item * A new compilation flag, C<< -DPERL_OP_PARENT >> is available. For details, see the discussion below at L<< /Internal Changes >>. =item * Pathtools no longer tries to load XS on miniperl. This speeds up building perl slightly. =back =head1 Testing =over 4 =item * F has been added to test that L and its dependencies only use the subset of the C<$1..$n> capture vars that C is hard-coded to localize, because that function has no efficient way of determining at runtime what vars to localize. =item * Tests for performance issues have been added in the file F. =item * Some regular expression tests are written in such a way that they will run very slowly if certain optimizations break. These tests have been moved into new files, F<< t/re/speed.t >> and F<< t/re/speed_thr.t >>, and are run with a C<< watchdog() >>. =item * C<< test.pl >> now allows C<< plan skip_all => $reason >>, to make it more compatible with C<< Test::More >>. =item * A new test script, F, has been added to test if infinity and NaN are working correctly. See L. =back =head1 Platform Support =head2 Regained Platforms =over 4 =item IRIX and Tru64 platforms are working again. Some C failures remain: L<[GH #14557]|https://github.com/Perl/perl5/issues/14557> and L<[GH #14727]|https://github.com/Perl/perl5/issues/14727> for IRIX; L<[GH #14629]|https://github.com/Perl/perl5/issues/14629>, L<[cpan #99605]|https://rt.cpan.org/Public/Bug/Display.html?id=99605>, and L<[cpan #104836]|https://rt.cpan.org/Ticket/Display.html?id=104836> for Tru64. =item z/OS running EBCDIC Code Page 1047 Core perl now works on this EBCDIC platform. Earlier perls also worked, but, even though support wasn't officially withdrawn, recent perls would not compile and run well. Perl 5.20 would work, but had many bugs which have now been fixed. Many CPAN modules that ship with Perl still fail tests, including C. However the version of C currently on CPAN should work; it was fixed too late to include in Perl 5.22. Work is under way to fix many of the still-broken CPAN modules, which likely will be installed on CPAN when completed, so that you may not have to wait until Perl 5.24 to get a working version. =back =head2 Discontinued Platforms =over 4 =item NeXTSTEP/OPENSTEP NeXTSTEP was a proprietary operating system bundled with NeXT's workstations in the early to mid 90s; OPENSTEP was an API specification that provided a NeXTSTEP-like environment on a non-NeXTSTEP system. Both are now long dead, so support for building Perl on them has been removed. =back =head2 Platform-Specific Notes =over 4 =item EBCDIC Special handling is required of the perl interpreter on EBCDIC platforms to get C to match only C<"i"> and C<"j">, since there are 7 characters between the code points for C<"i"> and C<"j">. This special handling had only been invoked when both ends of the range are literals. Now it is also invoked if any of the C<\N{...}> forms for specifying a character by name or Unicode code point is used instead of a literal. See L. =item HP-UX The archname now distinguishes use64bitint from use64bitall. =item Android Build support has been improved for cross-compiling in general and for Android in particular. =item VMS =over 4 =item * When spawning a subprocess without waiting, the return value is now the correct PID. =item * Fix a prototype so linking doesn't fail under the VMS C++ compiler. =item * C, C, and C detection has been added to C, environment handling has had some minor changes, and a fix for legacy feature checking status. =back =item Win32 =over 4 =item * F is now built with C<-fno-strict-aliasing>, allowing 64-bit builds to complete on GCC 4.8. L<[GH #14556]|https://github.com/Perl/perl5/issues/14556> =item * C now works on Win32. Due to dependency issues you need to build C first, and a small number of the tests fail. L<[GH #14318]|https://github.com/Perl/perl5/issues/14318> =item * Perl can now be built in C++ mode on Windows by setting the makefile macro C to the value "define". =item * The list form of piped open has been implemented for Win32. Note: unlike C this does not fall back to the shell. L<[GH #13574]|https://github.com/Perl/perl5/issues/13574> =item * New C and C configuration options added to Windows makefiles. =item * Previously, compiling XS modules (including CPAN ones) using Visual C++ for Win64 resulted in around a dozen warnings per file from F. These warnings have been silenced. =item * Support for building without PerlIO has been removed from the Windows makefiles. Non-PerlIO builds were all but deprecated in Perl 5.18.0 and are already not supported by F on POSIX systems. =item * Between 2 and 6 milliseconds and seven I/O calls have been saved per attempt to open a perl module for each path in C<@INC>. =item * Intel C builds are now always built with C99 mode on. =item * C<%I64d> is now being used instead of C<%lld> for MinGW. =item * In the experimental C<:win32> layer, a crash in C was fixed. Also opening F (which works under Win32 Perl's default C<:unix> layer) was implemented for C<:win32>. L<[GH #13968]|https://github.com/Perl/perl5/issues/13968> =item * A new makefile option, C, has been added to the Windows dmake makefile for gcc builds only. Set this to "define" if you want perl to use long doubles to give more accuracy and range for floating point numbers. =back =item OpenBSD On OpenBSD, Perl will now default to using the system C due to the security features it provides. Perl's own malloc wrapper has been in use since v5.14 due to performance reasons, but the OpenBSD project believes the tradeoff is worth it and would prefer that users who need the speed specifically ask for it. L<[GH #13888]|https://github.com/Perl/perl5/issues/13888>. =item Solaris =over 4 =item * We now look for the Sun Studio compiler in both F and F. =item * Builds on Solaris 10 with C<-Dusedtrace> would fail early since make didn't follow implied dependencies to build C. Added an explicit dependency to C. L<[GH #13334]|https://github.com/Perl/perl5/issues/13334> =item * C99 options have been cleaned up; hints look for C as well as C; and support for native C has been added. =back =back =head1 Internal Changes =over 4 =item * Experimental support has been added to allow ops in the optree to locate their parent, if any. This is enabled by the non-default build option C<-DPERL_OP_PARENT>. It is envisaged that this will eventually become enabled by default, so XS code which directly accesses the C field of ops should be updated to be future-proofed. On C builds, the C field has been renamed C and a new flag, C, added. On the last op in a sibling chain, C is false and C points to the parent (if any) rather than being C. To make existing code work transparently whether using C or not, a number of new macros and functions have been added that should be used, rather than directly manipulating C. For the case of just reading C to determine the next sibling, two new macros have been added. A simple scan through a sibling chain like this: for (; kid->op_sibling; kid = kid->op_sibling) { ... } should now be written as: for (; OpHAS_SIBLING(kid); kid = OpSIBLING(kid)) { ... } For altering optrees, a general-purpose function C has been added, which allows for manipulation of a chain of sibling ops. By analogy with the Perl function C, it allows you to cut out zero or more ops from a sibling chain and replace them with zero or more new ops. It transparently handles all the updating of sibling, parent, op_last pointers etc. If you need to manipulate ops at a lower level, then three new macros, C, C and C are intended to be a low-level portable way to set C / C while also updating C. The first sets the sibling pointer to a new sibling, the second makes the op the last sibling, and the third conditionally does the first or second action. Note that unlike C these macros won't maintain consistency in the parent at the same time (I by updating C and C where appropriate). A C-level C function and a Perl-level C method have been added. The C function only exists under C builds (using it is build-time error on vanilla perls). C exists always, but on a vanilla build it always returns C. Under C, they return the parent of the current op, if any. The variable C<$B::OP::does_parent> allows you to determine whether C supports retrieving an op's parent. C was introduced in 5.21.2, but the interface was changed considerably in 5.21.11. If you updated your code before the 5.21.11 changes, it may require further revision. The main changes after 5.21.2 were: =over 4 =item * The C and C macros have been renamed C and C for consistency with other op-manipulating macros. =item * The C field has been renamed C, and its meaning inverted. =item * The macro C has been removed, and has been superseded by C I. =item * The C function now accepts a null C argument where the splicing doesn't affect the first or last ops in the sibling chain =back =item * Macros have been created to allow XS code to better manipulate the POSIX locale category C. See L. =item * The previous C I replacement function, C, has now been superseded by C. See L for details. =item * A new function, C, has been added which allows you retrieve the weak references, if any, which point at an SV. =item * The C function has been removed. Although marked as public API, it was undocumented and had no usage in CPAN modules. Calling it has been fatal since 5.17.0. =item * The C, C, C and C functions have been added to the API. =item * The internal C function in F has been renamed C and added to the API. =item * The C function no longer forbids "ext" magic on read-only values. After all, perl can't know whether the custom magic will modify the SV or not. L<[GH #14202]|https://github.com/Perl/perl5/issues/14202>. =item * Accessing L on an XSUB is now forbidden. The C field has been reused for a different internal purpose for XSUBs. So in particular, you can no longer rely on it being NULL as a test of whether a CV is an XSUB. Use C instead. =item * SVs of type C are now sometimes bodiless when the build configuration and platform allow it: specifically, when C<< sizeof(NV) <= sizeof(IV) >>. "Bodiless" means that the NV value is stored directly in the head of an SV, without requiring a separate body to be allocated. This trick has already been used for IVs since 5.9.2 (though in the case of IVs, it is always used, regardless of platform and build configuration). =item * The C<$DB::single>, C<$DB::signal> and C<$DB::trace> variables now have set- and get-magic that stores their values as IVs, and those IVs are used when testing their values in C. This prevents perl from recursing infinitely if an overloaded object is assigned to any of those variables. L<[GH #14013]|https://github.com/Perl/perl5/issues/14013>. =item * C, which is marked as public API but is undocumented, has been removed from the public API. This change does not affect XS code that uses the C macro to pre-extend the mortal stack. =item * Perl's internals no longer sets or uses the C flag. C now returns a true value for anything not marked C and C is now defined as 0. =item * The macros C and C have been removed. They were no longer used in the core since commit 6f1401dc2a five years ago, and have not been found present on CPAN. =item * The C<< SvFAKE >> bit (unused on HVs) got informally reserved by David Mitchell for future work on vtables. =item * The C function accepts C and C flags, which specify whether the appended string is bytes or UTF-8, respectively. (These flags have in fact been present since 5.16.0, but were formerly not regarded as part of the API.) =item * A new opcode class, C<< METHOP >>, has been introduced. It holds information used at runtime to improve the performance of class/object method calls. C<< OP_METHOD >> and C<< OP_METHOD_NAMED >> have changed from being C<< UNOP/SVOP >> to being C<< METHOP >>. =item * C is a new API function that can be passed a CV or GV. It returns an SV containing the name of the subroutine, for use in diagnostics. L<[GH #12767]|https://github.com/Perl/perl5/issues/12767> L<[GH #13392]|https://github.com/Perl/perl5/issues/13392> =item * C is a new API function that works like C, except that it allows the caller to specify whether the call checker requires a full GV for reporting the subroutine's name, or whether it could be passed a CV instead. Whatever value is passed will be acceptable to C. C guarantees there will be a GV, but it may have to create one on the fly, which is inefficient. L<[GH #12767]|https://github.com/Perl/perl5/issues/12767> =item * C (which is not part of the API) is now a more complex macro, which may call a function and reify a GV. For those cases where it has been used as a boolean, C has been added, which will return true for CVs that notionally have GVs, but without reifying the GV. C also returns a GV now for lexical subs. L<[GH #13392]|https://github.com/Perl/perl5/issues/13392> =item * The L function has been added to the public API. Changing the program's locale should be avoided by XS code. Nevertheless, certain non-Perl libraries called from XS need to do so, such as C. When this happens, Perl needs to be told that the locale has changed. Use this function to do so, before returning to Perl. =item * The defines and labels for the flags in the C field of OPs are now auto-generated from data in F. The noticeable effect of this is that some of the flag output of C might differ slightly, and the flag output of S> may differ considerably (they both use the same set of labels now). Also, debugging builds now have a new assertion in C to ensure that the op doesn't have any unrecognized flags set in C. =item * The deprecated variable C has been removed. =item * Perl now tries to keep the locale category C set to "C" except around operations that need it to be set to the program's underlying locale. This protects the many XS modules that cannot cope with the decimal radix character not being a dot. Prior to this release, Perl initialized this category to "C", but a call to C would change it. Now such a call will change the underlying locale of the C category for the program, but the locale exposed to XS code will remain "C". There are new macros to manipulate the LC_NUMERIC locale, including C and C. See L. =item * A new macro L|perlapi/isUTF8_CHAR> has been written which efficiently determines if the string given by its parameters begins with a well-formed UTF-8 encoded character. =item * The following private API functions had their context parameter removed: C, C, C, C, C, C, C, C, C, C, C, C. Note that the prefix-less versions of those functions that are part of the public API, such as C, remain unaffected. =item * The C and C types are now separate types, and no longer simply aliases for SV and AV. L<[GH #14250]|https://github.com/Perl/perl5/issues/14250>. =item * Pad names are now always UTF-8. The C macro always returns true. Previously, this was effectively the case already, but any support for two different internal representations of pad names has now been removed. =item * A new op class, C, has been added. This is a subclass of C with an C field added, which points to an array of unions of UV, SV* etc. It is intended for where an op needs to store more data than a simple C or whatever. Currently the only op of this type is C (see next item). =item * A new op has been added, C, which performs one or more nested array and hash lookups where the key is a constant or simple variable. For example the expression C<$a[0]{$k}[$i]>, which previously involved ten C, C, C and C ops is now performed by a single C op. It can also handle C, C and C. A non-simple index expression, such as C<[$i+1]> is still done using C/C, and single-level array lookup with a small constant index is still done using C. =back =head1 Selected Bug Fixes =over 4 =item * C now sets C<$!> When an I/O error occurs, the fact that there has been an error is recorded in the handle. C returns false for such a handle. Previously, the value of C<$!> would be untouched by C, so the common convention of writing S> did not work reliably. Now the handle records the value of C<$!>, too, and C restores it. =item * C now can turn off everything that C enables Previously, running C would turn off only a few things. Now it can turn off all the enabled things. For example, the only way to stop debugging, once enabled, was to exit the enclosing block; that is now fixed. =item * C and C now zero the padding on x86 long double builds. Under some build options on GCC 4.8 and later, they used to either overwrite the zero-initialized padding, or bypass the initialized buffer entirely. This caused F to fail. L<[GH #14554]|https://github.com/Perl/perl5/issues/14554> =item * Extending an array cloned from a parent thread could result in "Modification of a read-only value attempted" errors when attempting to modify the new elements. L<[GH #14605]|https://github.com/Perl/perl5/issues/14605> =item * An assertion failure and subsequent crash with C<< *x= >> has been fixed. L<[GH #14493]|https://github.com/Perl/perl5/issues/14493> =item * A possible crashing/looping bug related to compiling lexical subs has been fixed. L<[GH #14596]|https://github.com/Perl/perl5/issues/14596> =item * UTF-8 now works correctly in function names, in unquoted HERE-document terminators, and in variable names used as array indexes. L<[GH #14601]|https://github.com/Perl/perl5/issues/14601> =item * Repeated global pattern matches in scalar context on large tainted strings were exponentially slow depending on the current match position in the string. L<[GH #14238]|https://github.com/Perl/perl5/issues/14238> =item * Various crashes due to the parser getting confused by syntax errors have been fixed. L<[GH #14496]|https://github.com/Perl/perl5/issues/14496> L<[GH #14497]|https://github.com/Perl/perl5/issues/14497> L<[GH #14548]|https://github.com/Perl/perl5/issues/14548> L<[GH #14564]|https://github.com/Perl/perl5/issues/14564> =item * C in the scope of lexical C<$_> has been fixed not to fail assertions. L<[GH #14483]|https://github.com/Perl/perl5/issues/14483> =item * C syntax inside various list operators no longer fails assertions. L<[GH #14500]|https://github.com/Perl/perl5/issues/14500> =item * An C<@> sign in quotes followed by a non-ASCII digit (which is not a valid identifier) would cause the parser to crash, instead of simply trying the C<@> as literal. This has been fixed. L<[GH #14553]|https://github.com/Perl/perl5/issues/14553> =item * C<*bar::=*foo::=*glob_with_hash> has been crashing since Perl 5.14, but no longer does. L<[GH #14512]|https://github.com/Perl/perl5/issues/14512> =item * C in scalar context was not pushing an item on to the stack, resulting in bugs. (S> would print 5.) It has been fixed to return C. L<[GH #14569]|https://github.com/Perl/perl5/issues/14569> =item * Several cases of data used to store environment variable contents in core C code being potentially overwritten before being used have been fixed. L<[GH #14476]|https://github.com/Perl/perl5/issues/14476> =item * Some patterns starting with C matched against long strings have been slow since v5.8, and some of the form C have been slow since v5.18. They are now all fast again. L<[GH #14475]|https://github.com/Perl/perl5/issues/14475>. =item * The original visible value of C<$/> is now preserved when it is set to an invalid value. Previously if you set C<$/> to a reference to an array, for example, perl would produce a runtime error and not set C, but Perl code that checked C<$/> would see the array reference. L<[GH #14245]|https://github.com/Perl/perl5/issues/14245>. =item * In a regular expression pattern, a POSIX class, like C<[:ascii:]>, must be inside a bracketed character class, like C. A warning is issued when something looking like a POSIX class is not inside a bracketed class. That warning wasn't getting generated when the POSIX class was negated: C<[:^ascii:]>. This is now fixed. =item * Perl 5.14.0 introduced a bug whereby S> would crash. This has been fixed. L<[GH #14438]|https://github.com/Perl/perl5/issues/14438>. =item * Various crashes due to the parser getting confused by syntax errors have been fixed. L<[GH #14421]|https://github.com/Perl/perl5/issues/14421>. L<[GH #14472]|https://github.com/Perl/perl5/issues/14472>. L<[GH #14480]|https://github.com/Perl/perl5/issues/14480>. L<[GH #14447]|https://github.com/Perl/perl5/issues/14447>. =item * Code like C used to read the next line of input and treat it as though it came immediately after the opening bracket. Some invalid code consequently would parse and run, but some code caused crashes, so this is now disallowed. L<[GH #14462]|https://github.com/Perl/perl5/issues/14462>. =item * Fix argument underflow for C. L<[GH #14525]|https://github.com/Perl/perl5/issues/14525>. =item * Fix handling of non-strict C<\x{}>. Now C<\x{}> is equivalent to C<\x{0}> instead of faulting. =item * C is now no longer treated as stackable, just like C<-t stat>. L<[GH #14499]|https://github.com/Perl/perl5/issues/14499>. =item * The following no longer causes a SEGV: C. =item * Fixed infinite loop in parsing backrefs in regexp patterns. =item * Several minor bug fixes in behavior of Infinity and NaN, including warnings when stringifying Infinity-like or NaN-like strings. For example, "NaNcy" doesn't numify to NaN anymore. =item * A bug in regular expression patterns that could lead to segfaults and other crashes has been fixed. This occurred only in patterns compiled with C while taking into account the current POSIX locale (which usually means they have to be compiled within the scope of C>), and there must be a string of at least 128 consecutive bytes to match. L<[GH #14389]|https://github.com/Perl/perl5/issues/14389>. =item * C now works on very long strings (where there are more than 2 billion iterations) instead of dying with 'Substitution loop'. L<[GH #11742]|https://github.com/Perl/perl5/issues/11742>. L<[GH #14190]|https://github.com/Perl/perl5/issues/14190>. =item * C no longer crashes with not-a-number values. L<[GH #14365]|https://github.com/Perl/perl5/issues/14365>. =item * C<\()> (a reference to an empty list), and C with lexical C<$_> in scope, could both do a bad write past the end of the stack. They have both been fixed to extend the stack first. =item * C with no arguments used to read the previous item on the stack, so S> would print foo's prototype. It has been fixed to infer C<$_> instead. L<[GH #14376]|https://github.com/Perl/perl5/issues/14376>. =item * Some cases of lexical state subs declared inside predeclared subs could crash, for example when evalling a string including the name of an outer variable, but no longer do. =item * Some cases of nested lexical state subs inside anonymous subs could cause 'Bizarre copy' errors or possibly even crashes. =item * When trying to emit warnings, perl's default debugger (F) was sometimes giving 'Undefined subroutine &DB::db_warn called' instead. This bug, which started to occur in Perl 5.18, has been fixed. L<[GH #14400]|https://github.com/Perl/perl5/issues/14400>. =item * Certain syntax errors in substitutions, such as C<< s/${<>{})// >>, would crash, and had done so since Perl 5.10. (In some cases the crash did not start happening till 5.16.) The crash has, of course, been fixed. L<[GH #14391]|https://github.com/Perl/perl5/issues/14391>. =item * Fix a couple of string grow size calculation overflows; in particular, a repeat expression like S> could cause a large buffer overflow since the new output buffer size was not correctly handled by C. An expression like this now properly produces a memory wrap panic. L<[GH #14401]|https://github.com/Perl/perl5/issues/14401>. =item * C<< formline("@...", "a"); >> would crash. The C case in C didn't set the pointer used to mark the chop position, which led to the C case crashing with a segmentation fault. This has been fixed. L<[GH #14388]|https://github.com/Perl/perl5/issues/14388>. =item * A possible buffer overrun and crash when parsing a literal pattern during regular expression compilation has been fixed. L<[GH #14416]|https://github.com/Perl/perl5/issues/14416>. =item * C and C now set C<$!> when they fail due to being passed a closed file handle. L<[GH #14073]|https://github.com/Perl/perl5/issues/14073>. =item * C and C no longer crash due to a stack overflow when freeing a deeply recursive op tree. L<[GH #11866]|https://github.com/Perl/perl5/issues/11866>. =item * In Perl 5.20.0, C<$^N> accidentally had the internal UTF-8 flag turned off if accessed from a code block within a regular expression, effectively UTF-8-encoding the value. This has been fixed. L<[GH #14211]|https://github.com/Perl/perl5/issues/14211>. =item * A failed C call no longer overwrites existing items on the stack, which means that C<(semctl(-1,0,0,0))[0]> no longer gives an "uninitialized" warning. =item * C with no space before C is now better at assigning the right line number to that statement. L<[GH #14070]|https://github.com/Perl/perl5/issues/14070>. =item * Sometimes the assignment in C<@array = split> gets optimised so that C itself writes directly to the array. This caused a bug, preventing this assignment from being used in lvalue context. So C<(@a=split//,"foo")=bar()> was an error. (This bug probably goes back to Perl 3, when the optimisation was added.) It has now been fixed. L<[GH #14183]|https://github.com/Perl/perl5/issues/14183>. =item * When an argument list fails the checks specified by a subroutine signature (which is still an experimental feature), the resulting error messages now give the file and line number of the caller, not of the called subroutine. L<[GH #13643]|https://github.com/Perl/perl5/issues/13643>. =item * The flip-flop operators (C<..> and C<...> in scalar context) used to maintain a separate state for each recursion level (the number of times the enclosing sub was called recursively), contrary to the documentation. Now each closure has one internal state for each flip-flop. L<[GH #14110]|https://github.com/Perl/perl5/issues/14110>. =item * The flip-flop operator (C<..> in scalar context) would return the same scalar each time, unless the containing subroutine was called recursively. Now it always returns a new scalar. L<[GH #14110]|https://github.com/Perl/perl5/issues/14110>. =item * C, C, statement labels, special blocks (C) and pod are now permitted as the first thing in a C or C block, the block after C or C (or other functions) returning a handle, and within C<${...}>, C<@{...}>, etc. L<[GH #14088]|https://github.com/Perl/perl5/issues/14088>. =item * The repetition operator C now propagates lvalue context to its left-hand argument when used in contexts like C. That allows S> to work as expected if the loop modifies C<$_>. =item * C<(...) x ...> in scalar context used to corrupt the stack if one operand was an object with "x" overloading, causing erratic behavior. L<[GH #13811]|https://github.com/Perl/perl5/issues/13811>. =item * Assignment to a lexical scalar is often optimised away; for example in C, the assign operator is optimised away and the add operator writes its result directly to C<$x>. Various bugs related to this optimisation have been fixed. Certain operators on the right-hand side would sometimes fail to assign the value at all or assign the wrong value, or would call STORE twice or not at all on tied variables. The operators affected were C<$foo++>, C<$foo-->, and C<-$foo> under C, C, C and C. =item * List assignments were sometimes buggy if the same scalar ended up on both sides of the assignment due to use of C, C or C. The result would be the wrong value getting assigned. =item * C (with one argument) was accidentally changed in 5.16 to mean C. This has been fixed. =item * C<__SUB__> could return the wrong value or even corrupt memory under the debugger (the C<-d> switch) and in subs containing C. =item * When S> becomes inlinable, it now returns a different scalar each time, just as a non-inlinable sub would, though Perl still optimises the copy away in cases where it would make no observable difference. =item * S> and S> are no longer eligible for inlining. The former would crash; the latter would just throw the attributes away. An exception is made for the little-known C<:method> attribute, which does nothing much. =item * Inlining of subs with an empty prototype is now more consistent than before. Previously, a sub with multiple statements, of which all but the last were optimised away, would be inlinable only if it were an anonymous sub containing a string C or C declaration or closing over an outer lexical variable (or any anonymous sub under the debugger). Now any sub that gets folded to a single constant after statements have been optimised away is eligible for inlining. This applies to things like C. Some subroutines with an explicit C were being made inlinable, contrary to the documentation, Now C always prevents inlining. =item * On some systems, such as VMS, C can return a non-ASCII string. If a scalar assigned to had contained a UTF-8 string previously, then C would not turn off the UTF-8 flag, thus corrupting the return value. This would happen with S>. =item * C no longer calls C twice on a tied first argument. =item * An unterminated here-doc on the last line of a quote-like operator (C, C) no longer causes a double free. It started doing so in 5.18. =item * C and C no longer crash when used on strings over 2GB in size. L<[GH #13700]|https://github.com/Perl/perl5/issues/13700>. =item * A small, previously intentional, memory leak in C/C on Win32 builds was fixed. This might affect embedders who repeatedly create and destroy perl engines within the same process. =item * C now returns the data for the program's underlying locale even when called from outside the scope of S>. =item * C now works properly on platforms which don't have C and/or C, or for which Perl has been compiled to disregard either or both of these locale categories. In such circumstances, there are now no entries for the corresponding values in the hash returned by C. =item * C now marks appropriately the values it returns as UTF-8 or not. Previously they were always returned as bytes, even if they were supposed to be encoded as UTF-8. =item * On Microsoft Windows, within the scope of C>, the following POSIX character classes gave results for many locales that did not conform to the POSIX standard: C<[[:alnum:]]>, C<[[:alpha:]]>, C<[[:blank:]]>, C<[[:digit:]]>, C<[[:graph:]]>, C<[[:lower:]]>, C<[[:print:]]>, C<[[:punct:]]>, C<[[:upper:]]>, C<[[:word:]]>, and C<[[:xdigit:]]>. This was because the underlying Microsoft implementation does not follow the standard. Perl now takes special precautions to correct for this. =item * Many issues have been detected by L and fixed. =item * C and friends should now work properly on more Android builds. Due to an oversight, the value specified through C<-Dtargetsh> to F would end up being ignored by some of the build process. This caused perls cross-compiled for Android to end up with defective versions of C, C and backticks: the commands would end up looking for C instead of C, and so would fail for the vast majority of devices, leaving C<$!> as C. =item * C, C, and C now work. Previously it was impossible to escape these three left-characters with a backslash within a regular expression pattern where otherwise they would be considered metacharacters, and the pattern opening delimiter was the character, and the closing delimiter was its mirror character. =item * C<< s///e >> on tainted UTF-8 strings corrupted C<< pos() >>. This bug, introduced in 5.20, is now fixed. L<[GH #13948]|https://github.com/Perl/perl5/issues/13948>. =item * A non-word boundary in a regular expression (C<< \B >>) did not always match the end of the string; in particular C<< q{} =~ /\B/ >> did not match. This bug, introduced in perl 5.14, is now fixed. L<[GH #13917]|https://github.com/Perl/perl5/issues/13917>. =item * C<< " P" =~ /(?=.*P)P/ >> should match, but did not. This is now fixed. L<[GH #13954]|https://github.com/Perl/perl5/issues/13954>. =item * Failing to compile C in an C could leave a spurious C subroutine definition, which would produce a "Subroutine BEGIN redefined" warning on the next use of C, or other C block. L<[GH #13926]|https://github.com/Perl/perl5/issues/13926>. =item * C syntax now correctly parses the arguments if they begin with an opening brace. L<[GH #9085]|https://github.com/Perl/perl5/issues/9085>. =item * External libraries and Perl may have different ideas of what the locale is. This is problematic when parsing version strings if the locale's numeric separator has been changed. Version parsing has been patched to ensure it handles the locales correctly. L<[GH #13863]|https://github.com/Perl/perl5/issues/13863>. =item * A bug has been fixed where zero-length assertions and code blocks inside of a regex could cause C to see an incorrect value. L<[GH #14016]|https://github.com/Perl/perl5/issues/14016>. =item * Dereferencing of constants now works correctly for typeglob constants. Previously the glob was stringified and its name looked up. Now the glob itself is used. L<[GH #9891]|https://github.com/Perl/perl5/issues/9891> =item * When parsing a sigil (C<$> C<@> C<%> C<&)> followed by braces, the parser no longer tries to guess whether it is a block or a hash constructor (causing a syntax error when it guesses the latter), since it can only be a block. =item * S> now frees the referent immediately, instead of hanging on to it until the next statement. L<[GH #14032]|https://github.com/Perl/perl5/issues/14032> =item * Various cases where the name of a sub is used (autoload, overloading, error messages) used to crash for lexical subs, but have been fixed. =item * Bareword lookup now tries to avoid vivifying packages if it turns out the bareword is not going to be a subroutine name. =item * Compilation of anonymous constants (I, C) no longer deletes any subroutine named C<__ANON__> in the current package. Not only was C<*__ANON__{CODE}> cleared, but there was a memory leak, too. This bug goes back to Perl 5.8.0. =item * Stub declarations like C and C no longer wipe out constants of the same name declared by C. This bug was introduced in Perl 5.10.0. =item * C now works properly in many instances. Some names known to C<\N{...}> refer to a sequence of multiple characters, instead of the usual single character. Bracketed character classes generally only match single characters, but now special handling has been added so that they can match named sequences, but not if the class is inverted or the sequence is specified as the beginning or end of a range. In these cases, the only behavior change from before is a slight rewording of the fatal error message given when this class is part of a C construct. When the C<[...]> stands alone, the same non-fatal warning as before is raised, and only the first character in the sequence is used, again just as before. =item * Tainted constants evaluated at compile time no longer cause unrelated statements to become tainted. L<[GH #14059]|https://github.com/Perl/perl5/issues/14059> =item * S>, which vivifies a handle with a name like C<"main::_GEN_0">, was not giving the handle the right reference count, so a double free could happen. =item * When deciding that a bareword was a method name, the parser would get confused if an C sub with the same name existed, and look up the method in the package of the C sub, instead of the package of the invocant. =item * The parser no longer gets confused by C<\U=> within a double-quoted string. It used to produce a syntax error, but now compiles it correctly. L<[GH #10882]|https://github.com/Perl/perl5/issues/10882> =item * It has always been the intention for the C<-B> and C<-T> file test operators to treat UTF-8 encoded files as text. (L has been updated to say this.) Previously, it was possible for some files to be considered UTF-8 that actually weren't valid UTF-8. This is now fixed. The operators now work on EBCDIC platforms as well. =item * Under some conditions warning messages raised during regular expression pattern compilation were being output more than once. This has now been fixed. =item * Perl 5.20.0 introduced a regression in which a UTF-8 encoded regular expression pattern that contains a single ASCII lowercase letter did not match its uppercase counterpart. That has been fixed in both 5.20.1 and 5.22.0. L<[GH #14051]|https://github.com/Perl/perl5/issues/14051> =item * Constant folding could incorrectly suppress warnings if lexical warnings (C or C) were not in effect and C<$^W> were false at compile time and true at run time. =item * Loading Unicode tables during a regular expression match could cause assertion failures under debugging builds if the previous match used the very same regular expression. L<[GH #14081]|https://github.com/Perl/perl5/issues/14081> =item * Thread cloning used to work incorrectly for lexical subs, possibly causing crashes or double frees on exit. =item * Since Perl 5.14.0, deleting C<$SomePackage::{__ANON__}> and then undefining an anonymous subroutine could corrupt things internally, resulting in L crashing or L giving nonsensical data. This has been fixed. =item * S> now reports names of lexical subs, instead of treating them as C<"(unknown)">. =item * C now supports using a lexical sub as the comparison routine. =item * Aliasing (I, via S>) could confuse list assignments that mention the two names for the same variable on either side, causing wrong values to be assigned. L<[GH #5788]|https://github.com/Perl/perl5/issues/5788> =item * Long here-doc terminators could cause a bad read on short lines of input. This has been fixed. It is doubtful that any crash could have occurred. This bug goes back to when here-docs were introduced in Perl 3.000 twenty-five years ago. =item * An optimization in C to treat S> like S> had the unfortunate side-effect of also treating S> like S>, which it should not. This has been fixed. (Note, however, that S> does not behave like S>, which is also considered to be a bug and will be fixed in a future version.) L<[GH #14086]|https://github.com/Perl/perl5/issues/14086> =item * The little-known S> syntax (see L and L) could get confused in the scope of C if C were a constant whose value contained Latin-1 characters. =item * Locking and unlocking values via L or C no longer has any effect on values that were read-only to begin with. Previously, unlocking such values could result in crashes, hangs or other erratic behavior. =item * Some unterminated C<(?(...)...)> constructs in regular expressions would either crash or give erroneous error messages. C is one such example. =item * S> no longer calls FETCH twice. =item * List assignments like S> now work correctly if C<$x> and C<$y> have been aliased by C. =item * Some patterns including code blocks with syntax errors, such as S>, would hang or fail assertions on debugging builds. Now they produce errors. =item * An assertion failure when parsing C with debugging enabled has been fixed. L<[GH #14087]|https://github.com/Perl/perl5/issues/14087>. =item * S> could do a bad read and produce junk results. =item * In S>, the S> at the beginning no longer confuses the optimizer into assuming a limit of 1. =item * Fatal warnings no longer prevent the output of syntax errors. L<[GH #14155]|https://github.com/Perl/perl5/issues/14155>. =item * Fixed a NaN double-to-long-double conversion error on VMS. For quiet NaNs (and only on Itanium, not Alpha) negative infinity instead of NaN was produced. =item * Fixed the issue that caused C<< make distclean >> to incorrectly leave some files behind. L<[GH #14108]|https://github.com/Perl/perl5/issues/14108>. =item * AIX now sets the length in C<< getsockopt >> correctly. L<[GH #13484]|https://github.com/Perl/perl5/issues/13484>. L<[cpan #91183]|https://rt.cpan.org/Ticket/Display.html?id=91183>. L<[cpan #85570]|https://rt.cpan.org/Ticket/Display.html?id=85570>. =item * The optimization phase of a regexp compilation could run "forever" and exhaust all memory under certain circumstances; now fixed. L<[GH #13984]|https://github.com/Perl/perl5/issues/13984>. =item * The test script F<< t/op/crypt.t >> now uses the SHA-256 algorithm if the default one is disabled, rather than giving failures. L<[GH #13715]|https://github.com/Perl/perl5/issues/13715>. =item * Fixed an off-by-one error when setting the size of a shared array. L<[GH #14151]|https://github.com/Perl/perl5/issues/14151>. =item * Fixed a bug that could cause perl to enter an infinite loop during compilation. In particular, a C within a sublist, I sub foo { () = ($a, my $b, ($c, do { while(1) {} })) } The bug was introduced in 5.20.0 L<[GH #14165]|https://github.com/Perl/perl5/issues/14165>. =item * On Win32, if a variable was C-ized in a pseudo-process that later forked, restoring the original value in the child pseudo-process caused memory corruption and a crash in the child pseudo-process (and therefore the OS process). L<[GH #8641]|https://github.com/Perl/perl5/issues/8641>. =item * Calling C on a format with a C<^**> field could produce a panic in C if there were insufficient arguments or if the variable used to fill the field was empty. L<[GH #14255]|https://github.com/Perl/perl5/issues/14255>. =item * Non-ASCII lexical sub names now appear without trailing junk when they appear in error messages. =item * The C<\@> subroutine prototype no longer flattens parenthesized arrays (taking a reference to each element), but takes a reference to the array itself. L<[GH #9111]|https://github.com/Perl/perl5/issues/9111>. =item * A block containing nothing except a C-style C loop could corrupt the stack, causing lists outside the block to lose elements or have elements overwritten. This could happen with C and with lists containing C. L<[GH #14269]|https://github.com/Perl/perl5/issues/14269>. =item * C now propagates lvalue context, so that S> can modify C<$#foo> through C<$_>. =item * C no longer dies with "Bizarre copy of ARRAY". L<[GH #14292]|https://github.com/Perl/perl5/issues/14292>. =item * S> in nested named subroutines would sometimes look up a global variable even with a lexical variable in scope. =item * In perl 5.20.0, C where 'fake' is anything other than a keyword, started chopping off the last 6 characters and treating the result as a sort sub name. The previous behavior of treating C as a sort sub name has been restored. L<[GH #14323]|https://github.com/Perl/perl5/issues/14323>. =item * Outside of C, a single-character Latin-1 lexical variable is disallowed. The error message for it, "Can't use global C<$foo>...", was giving garbage instead of the variable name. =item * C on a nonexistent handle was causing C<${^LAST_FH}> to produce a reference to an undefined scalar (or fail an assertion). Now C<${^LAST_FH}> ends up undefined. =item * C<(...) x ...> in void context now applies scalar context to the left-hand argument, instead of the context the current sub was called in. L<[GH #14174]|https://github.com/Perl/perl5/issues/14174>. =back =head1 Known Problems =over 4 =item * C-ing a NaN on a perl compiled with Visual C 6 does not behave properly, leading to a test failure in F. L<[GH #14705]|https://github.com/Perl/perl5/issues/14705> =item * A goal is for Perl to be able to be recompiled to work reasonably well on any Unicode version. In Perl 5.22, though, the earliest such version is Unicode 5.1 (current is 7.0). =item * EBCDIC platforms =over 4 =item * The C (and hence C) operators do not necessarily give the correct results when both operands are UTF-EBCDIC encoded strings and there is a mixture of ASCII and/or control characters, along with other characters. =item * Ranges containing C<\N{...}> in the C (and C) transliteration operators are treated differently than the equivalent ranges in regular expression patterns. They should, but don't, cause the values in the ranges to all be treated as Unicode code points, and not native ones. (L gives details as to how it should work.) =item * Encode and encoding are mostly broken. =item * Many CPAN modules that are shipped with core show failing tests. =item * C/C with C<"U0"> format may not work properly. =back =item * The following modules are known to have test failures with this version of Perl. In many cases, patches have been submitted, so there will hopefully be new releases soon: =over =item * L version 1.50 =item * L version 0.25 =item * L version 6.42 =item * L version 1.3130 =item * L version 1.18 =item * L version 2.38 =item * L version 0.63 =item * L version 0.07 =item * L version 0.34 =item * L version 0.009 =item * L version 0.000018 =item * L version 2.22 =item * L version 0.02 =item * L version 1.00 =item * L 0.08 =back =back =head1 Obituary Brian McCauley died on May 8, 2015. He was a frequent poster to Usenet, Perl Monks, and other Perl forums, and made several CPAN contributions under the nick NOBULL, including to the Perl FAQ. He attended almost every YAPC::Europe, and indeed, helped organise YAPC::Europe 2006 and the QA Hackathon 2009. His wit and his delight in intricate systems were particularly apparent in his love of board games; many Perl mongers will have fond memories of playing Fluxx and other games with Brian. He will be missed. =head1 Acknowledgements Perl 5.22.0 represents approximately 12 months of development since Perl 5.20.0 and contains approximately 590,000 lines of changes across 2,400 files from 94 authors. Excluding auto-generated files, documentation and release tools, there were approximately 370,000 lines of changes to 1,500 .pm, .t, .c and .h files. Perl continues to flourish into its third decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.22.0: Aaron Crane, Abhijit Menon-Sen, Abigail, Alberto Simões, Alex Solovey, Alex Vandiver, Alexandr Ciornii, Alexandre (Midnite) Jousset, Andreas König, Andreas Voegele, Andrew Fresh, Andy Dougherty, Anthony Heading, Aristotle Pagaltzis, brian d foy, Brian Fraser, Chad Granum, Chris 'BinGOs' Williams, Craig A. Berry, Dagfinn Ilmari Mannsåker, Daniel Dragan, Darin McBride, Dave Rolsky, David Golden, David Mitchell, David Wheeler, Dmitri Tikhonov, Doug Bell, E. Choroba, Ed J, Eric Herman, Father Chrysostomos, George Greer, Glenn D. Golden, Graham Knop, H.Merijn Brand, Herbert Breunung, Hugo van der Sanden, James E Keenan, James McCoy, James Raspass, Jan Dubois, Jarkko Hietaniemi, Jasmine Ngan, Jerry D. Hedden, Jim Cromie, John Goodyear, kafka, Karen Etheridge, Karl Williamson, Kent Fredric, kmx, Lajos Veres, Leon Timmermans, Lukas Mai, Mathieu Arnold, Matthew Horsfall, Max Maischein, Michael Bunk, Nicholas Clark, Niels Thykier, Niko Tyni, Norman Koch, Olivier Mengué, Peter John Acklam, Peter Martini, Petr Písař, Philippe Bruhat (BooK), Pierre Bogossian, Rafael Garcia-Suarez, Randy Stauner, Reini Urban, Ricardo Signes, Rob Hoelz, Rostislav Skudnov, Sawyer X, Shirakata Kentaro, Shlomi Fish, Sisyphus, Slaven Rezic, Smylers, Steffen Müller, Steve Hay, Sullivan Beck, syber, Tadeusz Sośnierz, Thomas Sibley, Todd Rinaldo, Tony Cook, Vincent Pit, Vladimir Marek, Yaroslav Kuzmin, Yves Orton, Ævar Arnfjörð Bjarmason. The list above is almost certainly incomplete as it is automatically generated from version control history. In particular, it does not include the names of the (very much appreciated) contributors who reported issues to the Perl bug tracker. Many of the changes included in this version originated in the CPAN modules included in Perl's core. We're grateful to the entire CPAN community for helping Perl to flourish. For a more complete list of all of Perl's historical contributors, please see the F file in the Perl source distribution. =head1 Reporting Bugs If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at L. There may also be information at L, the Perl Home Page. If you believe you have an unreported bug, please run the L program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of C, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who will be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN. =head1 SEE ALSO The F file for an explanation of how to view exhaustive details on what changed. The F file for how to build Perl. The F file for general stuff. The F and F files for copyright information. =cut