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