| 1 | =encoding utf8 |
| 2 | |
| 3 | =head1 NAME |
| 4 | |
| 5 | perl5200delta - what is new for perl v5.20.0 |
| 6 | |
| 7 | =head1 DESCRIPTION |
| 8 | |
| 9 | This document describes differences between the 5.18.0 release and the |
| 10 | 5.20.0 release. |
| 11 | |
| 12 | If you are upgrading from an earlier release such as 5.16.0, first read |
| 13 | L<perl5180delta>, which describes differences between 5.16.0 and 5.18.0. |
| 14 | |
| 15 | =head1 Core Enhancements |
| 16 | |
| 17 | =head2 Experimental Subroutine signatures |
| 18 | |
| 19 | Declarative syntax to unwrap argument list into lexical variables. |
| 20 | C<sub foo ($a,$b) {...}> checks the number of arguments and puts the |
| 21 | arguments into lexical variables. Signatures are not equivalent to |
| 22 | the existing idiom of C<sub foo { my($a,$b) = @_; ... }>. Signatures |
| 23 | are only available by enabling a non-default feature, and generate |
| 24 | warnings about being experimental. The syntactic clash with |
| 25 | prototypes is managed by disabling the short prototype syntax when |
| 26 | signatures are enabled. |
| 27 | |
| 28 | See L<perlsub/Signatures> for details. |
| 29 | |
| 30 | =head2 C<sub>s now take a C<prototype> attribute |
| 31 | |
| 32 | When declaring or defining a C<sub>, the prototype can now be specified inside |
| 33 | of a C<prototype> attribute instead of in parens following the name. |
| 34 | |
| 35 | For example, C<sub foo($$){}> could be rewritten as |
| 36 | C<sub foo : prototype($$){}>. |
| 37 | |
| 38 | =head2 More consistent prototype parsing |
| 39 | |
| 40 | Multiple semicolons in subroutine prototypes have long been tolerated and |
| 41 | treated as a single semicolon. There was one case where this did not |
| 42 | happen. A subroutine whose prototype begins with "*" or ";*" can affect |
| 43 | whether a bareword is considered a method name or sub call. This now |
| 44 | applies also to ";;;*". |
| 45 | |
| 46 | Whitespace has long been allowed inside subroutine prototypes, so |
| 47 | C<sub( $ $ )> is equivalent to C<sub($$)>, but until now it was stripped |
| 48 | when the subroutine was parsed. Hence, whitespace was I<not> allowed in |
| 49 | prototypes set by C<Scalar::Util::set_prototype>. Now it is permitted, |
| 50 | and the parser no longer strips whitespace. This means |
| 51 | C<prototype &mysub> returns the original prototype, whitespace and all. |
| 52 | |
| 53 | =head2 C<rand> now uses a consistent random number generator |
| 54 | |
| 55 | Previously perl would use a platform specific random number generator, varying |
| 56 | between the libc rand(), random() or drand48(). |
| 57 | |
| 58 | This meant that the quality of perl's random numbers would vary from platform |
| 59 | to platform, from the 15 bits of rand() on Windows to 48-bits on POSIX |
| 60 | platforms such as Linux with drand48(). |
| 61 | |
| 62 | Perl now uses its own internal drand48() implementation on all platforms. This |
| 63 | does not make perl's C<rand> cryptographically secure. [perl #115928] |
| 64 | |
| 65 | =head2 New slice syntax |
| 66 | |
| 67 | The new C<%hash{...}> and C<%array[...]> syntax returns a list of key/value (or |
| 68 | index/value) pairs. See L<perldata/"Key/Value Hash Slices">. |
| 69 | |
| 70 | =head2 Experimental Postfix Dereferencing |
| 71 | |
| 72 | When the C<postderef> feature is in effect, the following syntactical |
| 73 | equivalencies are set up: |
| 74 | |
| 75 | $sref->$*; # same as ${ $sref } # interpolates |
| 76 | $aref->@*; # same as @{ $aref } # interpolates |
| 77 | $href->%*; # same as %{ $href } |
| 78 | $cref->&*; # same as &{ $cref } |
| 79 | $gref->**; # same as *{ $gref } |
| 80 | |
| 81 | $aref->$#*; # same as $#{ $aref } |
| 82 | |
| 83 | $gref->*{ $slot }; # same as *{ $gref }{ $slot } |
| 84 | |
| 85 | $aref->@[ ... ]; # same as @$aref[ ... ] # interpolates |
| 86 | $href->@{ ... }; # same as @$href{ ... } # interpolates |
| 87 | $aref->%[ ... ]; # same as %$aref[ ... ] |
| 88 | $href->%{ ... }; # same as %$href{ ... } |
| 89 | |
| 90 | Those marked as interpolating only interpolate if the associated |
| 91 | C<postderef_qq> feature is also enabled. This feature is B<experimental> and |
| 92 | will trigger C<experimental::postderef>-category warnings when used, unless |
| 93 | they are suppressed. |
| 94 | |
| 95 | For more information, consult L<the Postfix Dereference Syntax section of |
| 96 | perlref|perlref/Postfix Dereference Syntax>. |
| 97 | |
| 98 | =head2 Unicode 6.3 now supported |
| 99 | |
| 100 | Perl now supports and is shipped with Unicode 6.3 (though Perl may be |
| 101 | recompiled with any previous Unicode release as well). A detailed list of |
| 102 | Unicode 6.3 changes is at L<http://www.unicode.org/versions/Unicode6.3.0/>. |
| 103 | |
| 104 | =head2 New C<\p{Unicode}> regular expression pattern property |
| 105 | |
| 106 | This is a synonym for C<\p{Any}> and matches the set of Unicode-defined |
| 107 | code points 0 - 0x10FFFF. |
| 108 | |
| 109 | =head2 Better 64-bit support |
| 110 | |
| 111 | On 64-bit platforms, the internal array functions now use 64-bit offsets, |
| 112 | allowing Perl arrays to hold more than 2**31 elements, if you have the memory |
| 113 | available. |
| 114 | |
| 115 | The regular expression engine now supports strings longer than 2**31 |
| 116 | characters. [perl #112790, #116907] |
| 117 | |
| 118 | The functions PerlIO_get_bufsiz, PerlIO_get_cnt, PerlIO_set_cnt and |
| 119 | PerlIO_set_ptrcnt now have SSize_t, rather than int, return values and |
| 120 | parameters. |
| 121 | |
| 122 | =head2 C<S<use locale>> now works on UTF-8 locales |
| 123 | |
| 124 | Until this release, only single-byte locales, such as the ISO 8859 |
| 125 | series were supported. Now, the increasingly common multi-byte UTF-8 |
| 126 | locales are also supported. A UTF-8 locale is one in which the |
| 127 | character set is Unicode and the encoding is UTF-8. The POSIX |
| 128 | C<LC_CTYPE> category operations (case changing (like C<lc()>, C<"\U">), |
| 129 | and character classification (C<\w>, C<\D>, C<qr/[[:punct:]]/>)) under |
| 130 | such a locale work just as if not under locale, but instead as if under |
| 131 | C<S<use feature 'unicode_strings'>>, except taint rules are followed. |
| 132 | Sorting remains by code point order in this release. [perl #56820]. |
| 133 | |
| 134 | =head2 C<S<use locale>> now compiles on systems without locale ability |
| 135 | |
| 136 | Previously doing this caused the program to not compile. Within its |
| 137 | scope the program behaves as if in the "C" locale. Thus programs |
| 138 | written for platforms that support locales can run on locale-less |
| 139 | platforms without change. Attempts to change the locale away from the |
| 140 | "C" locale will, of course, fail. |
| 141 | |
| 142 | =head2 More locale initialization fallback options |
| 143 | |
| 144 | If there was an error with locales during Perl start-up, it immediately |
| 145 | gave up and tried to use the C<"C"> locale. Now it first tries using |
| 146 | other locales given by the environment variables, as detailed in |
| 147 | L<perllocale/ENVIRONMENT>. For example, if C<LC_ALL> and C<LANG> are |
| 148 | both set, and using the C<LC_ALL> locale fails, Perl will now try the |
| 149 | C<LANG> locale, and only if that fails, will it fall back to C<"C">. On |
| 150 | Windows machines, Perl will try, ahead of using C<"C">, the system |
| 151 | default locale if all the locales given by environment variables fail. |
| 152 | |
| 153 | =head2 C<-DL> runtime option now added for tracing locale setting |
| 154 | |
| 155 | This is designed for Perl core developers to aid in field debugging bugs |
| 156 | regarding locales. |
| 157 | |
| 158 | =head2 B<-F> now implies B<-a> and B<-a> implies B<-n> |
| 159 | |
| 160 | Previously B<-F> without B<-a> was a no-op, and B<-a> without B<-n> or B<-p> |
| 161 | was a no-op, with this change, if you supply B<-F> then both B<-a> and B<-n> |
| 162 | are implied and if you supply B<-a> then B<-n> is implied. |
| 163 | |
| 164 | You can still use B<-p> for its extra behaviour. [perl #116190] |
| 165 | |
| 166 | =head2 $a and $b warnings exemption |
| 167 | |
| 168 | The special variables $a and $b, used in C<sort>, are now exempt from "used |
| 169 | once" warnings, even where C<sort> is not used. This makes it easier for |
| 170 | CPAN modules to provide functions using $a and $b for similar purposes. |
| 171 | [perl #120462] |
| 172 | |
| 173 | =head1 Security |
| 174 | |
| 175 | =head2 Avoid possible read of free()d memory during parsing |
| 176 | |
| 177 | It was possible that free()d memory could be read during parsing in the unusual |
| 178 | circumstance of the Perl program ending with a heredoc and the last line of the |
| 179 | file on disk having no terminating newline character. This has now been fixed. |
| 180 | |
| 181 | =head1 Incompatible Changes |
| 182 | |
| 183 | =head2 C<do> can no longer be used to call subroutines |
| 184 | |
| 185 | The C<do SUBROUTINE(LIST)> form has resulted in a deprecation warning |
| 186 | since Perl v5.0.0, and is now a syntax error. |
| 187 | |
| 188 | =head2 Quote-like escape changes |
| 189 | |
| 190 | The character after C<\c> in a double-quoted string ("..." or qq(...)) |
| 191 | or regular expression must now be a printable character and may not be |
| 192 | C<{>. |
| 193 | |
| 194 | A literal C<{> after C<\B> or C<\b> is now fatal. |
| 195 | |
| 196 | These were deprecated in perl v5.14.0. |
| 197 | |
| 198 | =head2 Tainting happens under more circumstances; now conforms to documentation |
| 199 | |
| 200 | This affects regular expression matching and changing the case of a |
| 201 | string (C<lc>, C<"\U">, I<etc>.) within the scope of C<use locale>. |
| 202 | The result is now tainted based on the operation, no matter what the |
| 203 | contents of the string were, as the documentation (L<perlsec>, |
| 204 | L<perllocale/SECURITY>) indicates it should. Previously, for the case |
| 205 | change operation, if the string contained no characters whose case |
| 206 | change could be affected by the locale, the result would not be tainted. |
| 207 | For example, the result of C<uc()> on an empty string or one containing |
| 208 | only above-Latin1 code points is now tainted, and wasn't before. This |
| 209 | leads to more consistent tainting results. Regular expression patterns |
| 210 | taint their non-binary results (like C<$&>, C<$2>) if and only if the |
| 211 | pattern contains elements whose matching depends on the current |
| 212 | (potentially tainted) locale. Like the case changing functions, the |
| 213 | actual contents of the string being matched now do not matter, whereas |
| 214 | formerly it did. For example, if the pattern contains a C<\w>, the |
| 215 | results will be tainted even if the match did not have to use that |
| 216 | portion of the pattern to succeed or fail, because what a C<\w> matches |
| 217 | depends on locale. However, for example, a C<.> in a pattern will not |
| 218 | enable tainting, because the dot matches any single character, and what |
| 219 | the current locale is doesn't change in any way what matches and what |
| 220 | doesn't. |
| 221 | |
| 222 | =head2 C<\p{}>, C<\P{}> matching has changed for non-Unicode code |
| 223 | points. |
| 224 | |
| 225 | C<\p{}> and C<\P{}> are defined by Unicode only on Unicode-defined code |
| 226 | points (C<U+0000> through C<U+10FFFF>). Their behavior on matching |
| 227 | these legal Unicode code points is unchanged, but there are changes for |
| 228 | code points C<0x110000> and above. Previously, Perl treated the result |
| 229 | of matching C<\p{}> and C<\P{}> against these as C<undef>, which |
| 230 | translates into "false". For C<\P{}>, this was then complemented into |
| 231 | "true". A warning was supposed to be raised when this happened. |
| 232 | However, various optimizations could prevent the warning, and the |
| 233 | results were often counter-intuitive, with both a match and its seeming |
| 234 | complement being false. Now all non-Unicode code points are treated as |
| 235 | typical unassigned Unicode code points. This generally is more |
| 236 | Do-What-I-Mean. A warning is raised only if the results are arguably |
| 237 | different from a strict Unicode approach, and from what Perl used to do. |
| 238 | Code that needs to be strictly Unicode compliant can make this warning |
| 239 | fatal, and then Perl always raises the warning. |
| 240 | |
| 241 | Details are in L<perlunicode/Beyond Unicode code points>. |
| 242 | |
| 243 | =head2 C<\p{All}> has been expanded to match all possible code points |
| 244 | |
| 245 | The Perl-defined regular expression pattern element C<\p{All}>, unused |
| 246 | on CPAN, used to match just the Unicode code points; now it matches all |
| 247 | possible code points; that is, it is equivalent to C<qr/./s>. Thus |
| 248 | C<\p{All}> is no longer synonymous with C<\p{Any}>, which continues to |
| 249 | match just the Unicode code points, as Unicode says it should. |
| 250 | |
| 251 | =head2 Data::Dumper's output may change |
| 252 | |
| 253 | Depending on the data structures dumped and the settings set for |
| 254 | Data::Dumper, the dumped output may have changed from previous |
| 255 | versions. |
| 256 | |
| 257 | If you have tests that depend on the exact output of Data::Dumper, |
| 258 | they may fail. |
| 259 | |
| 260 | To avoid this problem in your code, test against the data structure |
| 261 | from evaluating the dumped structure, instead of the dump itself. |
| 262 | |
| 263 | =head2 Locale decimal point character no longer leaks outside of S<C<use locale>> scope |
| 264 | |
| 265 | This is actually a bug fix, but some code has come to rely on the bug |
| 266 | being present, so this change is listed here. The current locale that |
| 267 | the program is running under is not supposed to be visible to Perl code |
| 268 | except within the scope of a S<C<use locale>>. However, until now under |
| 269 | certain circumstances, the character used for a decimal point (often a |
| 270 | comma) leaked outside the scope. If your code is affected by this |
| 271 | change, simply add a S<C<use locale>>. |
| 272 | |
| 273 | =head2 Assignments of Windows sockets error codes to $! now prefer F<errno.h> values over WSAGetLastError() values |
| 274 | |
| 275 | In previous versions of Perl, Windows sockets error codes as returned by |
| 276 | WSAGetLastError() were assigned to $!, and some constants such as ECONNABORTED, |
| 277 | not in F<errno.h> in VC++ (or the various Windows ports of gcc) were defined to |
| 278 | corresponding WSAE* values to allow $! to be tested against the E* constants |
| 279 | exported by L<Errno> and L<POSIX>. |
| 280 | |
| 281 | This worked well until VC++ 2010 and later, which introduced new E* constants |
| 282 | with values E<gt> 100 into F<errno.h>, including some being (re)defined by perl |
| 283 | to WSAE* values. That caused problems when linking XS code against other |
| 284 | libraries which used the original definitions of F<errno.h> constants. |
| 285 | |
| 286 | To avoid this incompatibility, perl now maps WSAE* error codes to E* values |
| 287 | where possible, and assigns those values to $!. The E* constants exported by |
| 288 | L<Errno> and L<POSIX> are updated to match so that testing $! against them, |
| 289 | wherever previously possible, will continue to work as expected, and all E* |
| 290 | constants found in F<errno.h> are now exported from those modules with their |
| 291 | original F<errno.h> values. |
| 292 | |
| 293 | In order to avoid breakage in existing Perl code which assigns WSAE* values to |
| 294 | $!, perl now intercepts the assignment and performs the same mapping to E* |
| 295 | values as it uses internally when assigning to $! itself. |
| 296 | |
| 297 | However, one backwards-incompatibility remains: existing Perl code which |
| 298 | compares $! against the numeric values of the WSAE* error codes that were |
| 299 | previously assigned to $! will now be broken in those cases where a |
| 300 | corresponding E* value has been assigned instead. This is only an issue for |
| 301 | those E* values E<lt> 100, which were always exported from L<Errno> and |
| 302 | L<POSIX> with their original F<errno.h> values, and therefore could not be used |
| 303 | for WSAE* error code tests (e.g. WSAEINVAL is 10022, but the corresponding |
| 304 | EINVAL is 22). (E* values E<gt> 100, if present, were redefined to WSAE* |
| 305 | values anyway, so compatibility can be achieved by using the E* constants, |
| 306 | which will work both before and after this change, albeit using different |
| 307 | numeric values under the hood.) |
| 308 | |
| 309 | =head2 Functions C<PerlIO_vsprintf> and C<PerlIO_sprintf> have been removed |
| 310 | |
| 311 | These two functions, undocumented, unused in CPAN, and problematic, have been |
| 312 | removed. |
| 313 | |
| 314 | =head1 Deprecations |
| 315 | |
| 316 | =head2 The C</\C/> character class |
| 317 | |
| 318 | The C</\C/> regular expression character class is deprecated. From perl |
| 319 | 5.22 onwards it will generate a warning, and from perl 5.24 onwards it |
| 320 | will be a regular expression compiler error. If you need to examine the |
| 321 | individual bytes that make up a UTF8-encoded character, then use |
| 322 | C<utf8::encode()> on the string (or a copy) first. |
| 323 | |
| 324 | =head2 Literal control characters in variable names |
| 325 | |
| 326 | This deprecation affects things like $\cT, where \cT is a literal control (such |
| 327 | as a C<NAK> or C<NEGATIVE ACKNOWLEDGE> character) in |
| 328 | the source code. Surprisingly, it appears that originally this was intended as |
| 329 | the canonical way of accessing variables like $^T, with the caret form only |
| 330 | being added as an alternative. |
| 331 | |
| 332 | The literal control form is being deprecated for two main reasons. It has what |
| 333 | are likely unfixable bugs, such as $\cI not working as an alias for $^I, and |
| 334 | their usage not being portable to non-ASCII platforms: While $^T will work |
| 335 | everywhere, \cT is whitespace in EBCDIC. [perl #119123] |
| 336 | |
| 337 | =head2 References to non-integers and non-positive integers in C<$/> |
| 338 | |
| 339 | Setting C<$/> to a reference to zero or a reference to a negative integer is |
| 340 | now deprecated, and will behave B<exactly> as though it was set to C<undef>. |
| 341 | If you want slurp behavior set C<$/> to C<undef> explicitly. |
| 342 | |
| 343 | Setting C<$/> to a reference to a non integer is now forbidden and will |
| 344 | throw an error. Perl has never documented what would happen in this |
| 345 | context and while it used to behave the same as setting C<$/> to |
| 346 | the address of the references in future it may behave differently, so we |
| 347 | have forbidden this usage. |
| 348 | |
| 349 | =head2 Character matching routines in POSIX |
| 350 | |
| 351 | Use of any of these functions in the C<POSIX> module is now deprecated: |
| 352 | C<isalnum>, C<isalpha>, C<iscntrl>, C<isdigit>, C<isgraph>, C<islower>, |
| 353 | C<isprint>, C<ispunct>, C<isspace>, C<isupper>, and C<isxdigit>. The |
| 354 | functions are buggy and don't work on UTF-8 encoded strings. See their |
| 355 | entries in L<POSIX> for more information. |
| 356 | |
| 357 | A warning is raised on the first call to any of them from each place in |
| 358 | the code that they are called. (Hence a repeated statement in a loop |
| 359 | will raise just the one warning.) |
| 360 | |
| 361 | =head2 Interpreter-based threads are now I<discouraged> |
| 362 | |
| 363 | The "interpreter-based threads" provided by Perl are not the fast, lightweight |
| 364 | system for multitasking that one might expect or hope for. Threads are |
| 365 | implemented in a way that make them easy to misuse. Few people know how to |
| 366 | use them correctly or will be able to provide help. |
| 367 | |
| 368 | The use of interpreter-based threads in perl is officially |
| 369 | L<discouraged|perlpolicy/discouraged>. |
| 370 | |
| 371 | =head2 Module removals |
| 372 | |
| 373 | The following modules will be removed from the core distribution in a |
| 374 | future release, and will at that time need to be installed from CPAN. |
| 375 | Distributions on CPAN which require these modules will need to list them as |
| 376 | prerequisites. |
| 377 | |
| 378 | The core versions of these modules will now issue C<"deprecated">-category |
| 379 | warnings to alert you to this fact. To silence these deprecation warnings, |
| 380 | install the modules in question from CPAN. |
| 381 | |
| 382 | Note that the planned removal of these modules from core does not reflect a |
| 383 | judgement about the quality of the code and should not be taken as a suggestion |
| 384 | that their use be halted. Their disinclusion from core primarily hinges on |
| 385 | their necessity to bootstrapping a fully functional, CPAN-capable Perl |
| 386 | installation, not on concerns over their design. |
| 387 | |
| 388 | =over |
| 389 | |
| 390 | =item L<CGI> and its associated CGI:: packages |
| 391 | |
| 392 | =item L<inc::latest> |
| 393 | |
| 394 | =item L<Package::Constants> |
| 395 | |
| 396 | =item L<Module::Build> and its associated Module::Build:: packages |
| 397 | |
| 398 | =back |
| 399 | |
| 400 | =head2 Utility removals |
| 401 | |
| 402 | The following utilities will be removed from the core distribution in a |
| 403 | future release, and will at that time need to be installed from CPAN. |
| 404 | |
| 405 | =over 4 |
| 406 | |
| 407 | =item L<find2perl> |
| 408 | |
| 409 | =item L<s2p> |
| 410 | |
| 411 | =item L<a2p> |
| 412 | |
| 413 | =back |
| 414 | |
| 415 | =head1 Performance Enhancements |
| 416 | |
| 417 | =over 4 |
| 418 | |
| 419 | =item * |
| 420 | |
| 421 | Perl has a new copy-on-write mechanism that avoids the need to copy the |
| 422 | internal string buffer when assigning from one scalar to another. This |
| 423 | makes copying large strings appear much faster. Modifying one of the two |
| 424 | (or more) strings after an assignment will force a copy internally. This |
| 425 | makes it unnecessary to pass strings by reference for efficiency. |
| 426 | |
| 427 | This feature was already available in 5.18.0, but wasn't enabled by |
| 428 | default. It is the default now, and so you no longer need build perl with |
| 429 | the F<Configure> argument: |
| 430 | |
| 431 | -Accflags=-DPERL_NEW_COPY_ON_WRITE |
| 432 | |
| 433 | It can be disabled (for now) in a perl build with: |
| 434 | |
| 435 | -Accflags=-DPERL_NO_COW |
| 436 | |
| 437 | On some operating systems Perl can be compiled in such a way that any |
| 438 | attempt to modify string buffers shared by multiple SVs will crash. This |
| 439 | way XS authors can test that their modules handle copy-on-write scalars |
| 440 | correctly. See L<perlguts/"Copy on Write"> for detail. |
| 441 | |
| 442 | =item * |
| 443 | |
| 444 | Perl has an optimizer for regular expression patterns. It analyzes the pattern |
| 445 | to find things such as the minimum length a string has to be to match, etc. It |
| 446 | now better handles code points that are above the Latin1 range. |
| 447 | |
| 448 | =item * |
| 449 | |
| 450 | Executing a regex that contains the C<^> anchor (or its variant under the |
| 451 | C</m> flag) has been made much faster in several situations. |
| 452 | |
| 453 | =item * |
| 454 | |
| 455 | Precomputed hash values are now used in more places during method lookup. |
| 456 | |
| 457 | =item * |
| 458 | |
| 459 | Constant hash key lookups (C<$hash{key}> as opposed to C<$hash{$key}>) have |
| 460 | long had the internal hash value computed at compile time, to speed up |
| 461 | lookup. This optimisation has only now been applied to hash slices as |
| 462 | well. |
| 463 | |
| 464 | =item * |
| 465 | |
| 466 | Combined C<and> and C<or> operators in void context, like those |
| 467 | generated for C<< unless ($a && $b) >> and C<< if ($a || b) >> now |
| 468 | short circuit directly to the end of the statement. [perl #120128] |
| 469 | |
| 470 | =item * |
| 471 | |
| 472 | In certain situations, when C<return> is the last statement in a subroutine's |
| 473 | main scope, it will be optimized out. This means code like: |
| 474 | |
| 475 | sub baz { return $cat; } |
| 476 | |
| 477 | will now behave like: |
| 478 | |
| 479 | sub baz { $cat; } |
| 480 | |
| 481 | which is notably faster. |
| 482 | |
| 483 | [perl #120765] |
| 484 | |
| 485 | =item * |
| 486 | |
| 487 | Code like: |
| 488 | |
| 489 | my $x; # or @x, %x |
| 490 | my $y; |
| 491 | |
| 492 | is now optimized to: |
| 493 | |
| 494 | my ($x, $y); |
| 495 | |
| 496 | In combination with the L<padrange optimization introduced in |
| 497 | v5.18.0|perl5180delta/Internal Changes>, this means longer uninitialized my |
| 498 | variable statements are also optimized, so: |
| 499 | |
| 500 | my $x; my @y; my %z; |
| 501 | |
| 502 | becomes: |
| 503 | |
| 504 | my ($x, @y, %z); |
| 505 | |
| 506 | [perl #121077] |
| 507 | |
| 508 | =item * |
| 509 | |
| 510 | The creation of certain sorts of lists, including array and hash slices, is now |
| 511 | faster. |
| 512 | |
| 513 | =item * |
| 514 | |
| 515 | The optimisation for arrays indexed with a small constant integer is now |
| 516 | applied for integers in the range -128..127, rather than 0..255. This should |
| 517 | speed up Perl code using expressions like C<$x[-1]>, at the expense of |
| 518 | (presumably much rarer) code using expressions like C<$x[200]>. |
| 519 | |
| 520 | =item * |
| 521 | |
| 522 | The first iteration over a large hash (using C<keys> or C<each>) is now |
| 523 | faster. This is achieved by preallocating the hash's internal iterator |
| 524 | state, rather than lazily creating it when the hash is first iterated. (For |
| 525 | small hashes, the iterator is still created only when first needed. The |
| 526 | assumption is that small hashes are more likely to be used as objects, and |
| 527 | therefore never allocated. For large hashes, that's less likely to be true, |
| 528 | and the cost of allocating the iterator is swamped by the cost of allocating |
| 529 | space for the hash itself.) |
| 530 | |
| 531 | =item * |
| 532 | |
| 533 | When doing a global regex match on a string that came from the C<readline> |
| 534 | or C<E<lt>E<gt>> operator, the data is no longer copied unnecessarily. |
| 535 | [perl #121259] |
| 536 | |
| 537 | =item * |
| 538 | |
| 539 | Dereferencing (as in C<$obj-E<gt>[0]> or C<$obj-E<gt>{k}>) is now faster |
| 540 | when C<$obj> is an instance of a class that has overloaded methods, but |
| 541 | doesn't overload any of the dereferencing methods C<@{}>, C<%{}>, and so on. |
| 542 | |
| 543 | =item * |
| 544 | |
| 545 | Perl's optimiser no longer skips optimising code that follows certain |
| 546 | C<eval {}> expressions (including those with an apparent infinite loop). |
| 547 | |
| 548 | =item * |
| 549 | |
| 550 | The implementation now does a better job of avoiding meaningless work at |
| 551 | runtime. Internal effect-free "null" operations (created as a side-effect of |
| 552 | parsing Perl programs) are normally deleted during compilation. That |
| 553 | deletion is now applied in some situations that weren't previously handled. |
| 554 | |
| 555 | =item * |
| 556 | |
| 557 | Perl now does less disk I/O when dealing with Unicode properties that cover |
| 558 | up to three ranges of consecutive code points. |
| 559 | |
| 560 | =back |
| 561 | |
| 562 | =head1 Modules and Pragmata |
| 563 | |
| 564 | =head2 New Modules and Pragmata |
| 565 | |
| 566 | =over 4 |
| 567 | |
| 568 | =item * |
| 569 | |
| 570 | L<experimental> 0.007 has been added to the Perl core. |
| 571 | |
| 572 | =item * |
| 573 | |
| 574 | L<IO::Socket::IP> 0.29 has been added to the Perl core. |
| 575 | |
| 576 | =back |
| 577 | |
| 578 | =head2 Updated Modules and Pragmata |
| 579 | |
| 580 | =over 4 |
| 581 | |
| 582 | =item * |
| 583 | |
| 584 | L<Archive::Tar> has been upgraded from version 1.90 to 1.96. |
| 585 | |
| 586 | =item * |
| 587 | |
| 588 | L<arybase> has been upgraded from version 0.06 to 0.07. |
| 589 | |
| 590 | =item * |
| 591 | |
| 592 | L<Attribute::Handlers> has been upgraded from version 0.94 to 0.96. |
| 593 | |
| 594 | =item * |
| 595 | |
| 596 | L<attributes> has been upgraded from version 0.21 to 0.22. |
| 597 | |
| 598 | =item * |
| 599 | |
| 600 | L<autodie> has been upgraded from version 2.13 to 2.23. |
| 601 | |
| 602 | =item * |
| 603 | |
| 604 | L<AutoLoader> has been upgraded from version 5.73 to 5.74. |
| 605 | |
| 606 | =item * |
| 607 | |
| 608 | L<autouse> has been upgraded from version 1.07 to 1.08. |
| 609 | |
| 610 | =item * |
| 611 | |
| 612 | L<B> has been upgraded from version 1.42 to 1.48. |
| 613 | |
| 614 | =item * |
| 615 | |
| 616 | L<B::Concise> has been upgraded from version 0.95 to 0.992. |
| 617 | |
| 618 | =item * |
| 619 | |
| 620 | L<B::Debug> has been upgraded from version 1.18 to 1.19. |
| 621 | |
| 622 | =item * |
| 623 | |
| 624 | L<B::Deparse> has been upgraded from version 1.20 to 1.26. |
| 625 | |
| 626 | =item * |
| 627 | |
| 628 | L<base> has been upgraded from version 2.18 to 2.22. |
| 629 | |
| 630 | =item * |
| 631 | |
| 632 | L<Benchmark> has been upgraded from version 1.15 to 1.18. |
| 633 | |
| 634 | =item * |
| 635 | |
| 636 | L<bignum> has been upgraded from version 0.33 to 0.37. |
| 637 | |
| 638 | =item * |
| 639 | |
| 640 | L<Carp> has been upgraded from version 1.29 to 1.3301. |
| 641 | |
| 642 | =item * |
| 643 | |
| 644 | L<CGI> has been upgraded from version 3.63 to 3.65. |
| 645 | NOTE: L<CGI> is deprecated and may be removed from a future version of Perl. |
| 646 | |
| 647 | =item * |
| 648 | |
| 649 | L<charnames> has been upgraded from version 1.36 to 1.40. |
| 650 | |
| 651 | =item * |
| 652 | |
| 653 | L<Class::Struct> has been upgraded from version 0.64 to 0.65. |
| 654 | |
| 655 | =item * |
| 656 | |
| 657 | L<Compress::Raw::Bzip2> has been upgraded from version 2.060 to 2.064. |
| 658 | |
| 659 | =item * |
| 660 | |
| 661 | L<Compress::Raw::Zlib> has been upgraded from version 2.060 to 2.065. |
| 662 | |
| 663 | =item * |
| 664 | |
| 665 | L<Config::Perl::V> has been upgraded from version 0.17 to 0.20. |
| 666 | |
| 667 | =item * |
| 668 | |
| 669 | L<constant> has been upgraded from version 1.27 to 1.31. |
| 670 | |
| 671 | =item * |
| 672 | |
| 673 | L<CPAN> has been upgraded from version 2.00 to 2.05. |
| 674 | |
| 675 | =item * |
| 676 | |
| 677 | L<CPAN::Meta> has been upgraded from version 2.120921 to 2.140640. |
| 678 | |
| 679 | =item * |
| 680 | |
| 681 | L<CPAN::Meta::Requirements> has been upgraded from version 2.122 to 2.125. |
| 682 | |
| 683 | =item * |
| 684 | |
| 685 | L<CPAN::Meta::YAML> has been upgraded from version 0.008 to 0.012. |
| 686 | |
| 687 | =item * |
| 688 | |
| 689 | L<Data::Dumper> has been upgraded from version 2.145 to 2.151. |
| 690 | |
| 691 | =item * |
| 692 | |
| 693 | L<DB> has been upgraded from version 1.04 to 1.07. |
| 694 | |
| 695 | =item * |
| 696 | |
| 697 | L<DB_File> has been upgraded from version 1.827 to 1.831. |
| 698 | |
| 699 | =item * |
| 700 | |
| 701 | L<DBM_Filter> has been upgraded from version 0.05 to 0.06. |
| 702 | |
| 703 | =item * |
| 704 | |
| 705 | L<deprecate> has been upgraded from version 0.02 to 0.03. |
| 706 | |
| 707 | =item * |
| 708 | |
| 709 | L<Devel::Peek> has been upgraded from version 1.11 to 1.16. |
| 710 | |
| 711 | =item * |
| 712 | |
| 713 | L<Devel::PPPort> has been upgraded from version 3.20 to 3.21. |
| 714 | |
| 715 | =item * |
| 716 | |
| 717 | L<diagnostics> has been upgraded from version 1.31 to 1.34. |
| 718 | |
| 719 | =item * |
| 720 | |
| 721 | L<Digest::MD5> has been upgraded from version 2.52 to 2.53. |
| 722 | |
| 723 | =item * |
| 724 | |
| 725 | L<Digest::SHA> has been upgraded from version 5.84 to 5.88. |
| 726 | |
| 727 | =item * |
| 728 | |
| 729 | L<DynaLoader> has been upgraded from version 1.18 to 1.25. |
| 730 | |
| 731 | =item * |
| 732 | |
| 733 | L<Encode> has been upgraded from version 2.49 to 2.60. |
| 734 | |
| 735 | =item * |
| 736 | |
| 737 | L<encoding> has been upgraded from version 2.6_01 to 2.12. |
| 738 | |
| 739 | =item * |
| 740 | |
| 741 | L<English> has been upgraded from version 1.06 to 1.09. |
| 742 | |
| 743 | C<$OLD_PERL_VERSION> was added as an alias of C<$]>. |
| 744 | |
| 745 | =item * |
| 746 | |
| 747 | L<Errno> has been upgraded from version 1.18 to 1.20_03. |
| 748 | |
| 749 | =item * |
| 750 | |
| 751 | L<Exporter> has been upgraded from version 5.68 to 5.70. |
| 752 | |
| 753 | =item * |
| 754 | |
| 755 | L<ExtUtils::CBuilder> has been upgraded from version 0.280210 to 0.280216. |
| 756 | |
| 757 | =item * |
| 758 | |
| 759 | L<ExtUtils::Command> has been upgraded from version 1.17 to 1.18. |
| 760 | |
| 761 | =item * |
| 762 | |
| 763 | L<ExtUtils::Embed> has been upgraded from version 1.30 to 1.32. |
| 764 | |
| 765 | =item * |
| 766 | |
| 767 | L<ExtUtils::Install> has been upgraded from version 1.59 to 1.67. |
| 768 | |
| 769 | =item * |
| 770 | |
| 771 | L<ExtUtils::MakeMaker> has been upgraded from version 6.66 to 6.98. |
| 772 | |
| 773 | =item * |
| 774 | |
| 775 | L<ExtUtils::Miniperl> has been upgraded from version to 1.01. |
| 776 | |
| 777 | =item * |
| 778 | |
| 779 | L<ExtUtils::ParseXS> has been upgraded from version 3.18 to 3.24. |
| 780 | |
| 781 | =item * |
| 782 | |
| 783 | L<ExtUtils::Typemaps> has been upgraded from version 3.19 to 3.24. |
| 784 | |
| 785 | =item * |
| 786 | |
| 787 | L<ExtUtils::XSSymSet> has been upgraded from version 1.2 to 1.3. |
| 788 | |
| 789 | =item * |
| 790 | |
| 791 | L<feature> has been upgraded from version 1.32 to 1.36. |
| 792 | |
| 793 | =item * |
| 794 | |
| 795 | L<fields> has been upgraded from version 2.16 to 2.17. |
| 796 | |
| 797 | =item * |
| 798 | |
| 799 | L<File::Basename> has been upgraded from version 2.84 to 2.85. |
| 800 | |
| 801 | =item * |
| 802 | |
| 803 | L<File::Copy> has been upgraded from version 2.26 to 2.29. |
| 804 | |
| 805 | =item * |
| 806 | |
| 807 | L<File::DosGlob> has been upgraded from version 1.10 to 1.12. |
| 808 | |
| 809 | =item * |
| 810 | |
| 811 | L<File::Fetch> has been upgraded from version 0.38 to 0.48. |
| 812 | |
| 813 | =item * |
| 814 | |
| 815 | L<File::Find> has been upgraded from version 1.23 to 1.27. |
| 816 | |
| 817 | =item * |
| 818 | |
| 819 | L<File::Glob> has been upgraded from version 1.20 to 1.23. |
| 820 | |
| 821 | =item * |
| 822 | |
| 823 | L<File::Spec> has been upgraded from version 3.40 to 3.47. |
| 824 | |
| 825 | =item * |
| 826 | |
| 827 | L<File::Temp> has been upgraded from version 0.23 to 0.2304. |
| 828 | |
| 829 | =item * |
| 830 | |
| 831 | L<FileCache> has been upgraded from version 1.08 to 1.09. |
| 832 | |
| 833 | =item * |
| 834 | |
| 835 | L<Filter::Simple> has been upgraded from version 0.89 to 0.91. |
| 836 | |
| 837 | =item * |
| 838 | |
| 839 | L<Filter::Util::Call> has been upgraded from version 1.45 to 1.49. |
| 840 | |
| 841 | =item * |
| 842 | |
| 843 | L<Getopt::Long> has been upgraded from version 2.39 to 2.42. |
| 844 | |
| 845 | =item * |
| 846 | |
| 847 | L<Getopt::Std> has been upgraded from version 1.07 to 1.10. |
| 848 | |
| 849 | =item * |
| 850 | |
| 851 | L<Hash::Util::FieldHash> has been upgraded from version 1.10 to 1.15. |
| 852 | |
| 853 | =item * |
| 854 | |
| 855 | L<HTTP::Tiny> has been upgraded from version 0.025 to 0.043. |
| 856 | |
| 857 | =item * |
| 858 | |
| 859 | L<I18N::Langinfo> has been upgraded from version 0.10 to 0.11. |
| 860 | |
| 861 | =item * |
| 862 | |
| 863 | L<I18N::LangTags> has been upgraded from version 0.39 to 0.40. |
| 864 | |
| 865 | =item * |
| 866 | |
| 867 | L<if> has been upgraded from version 0.0602 to 0.0603. |
| 868 | |
| 869 | =item * |
| 870 | |
| 871 | L<inc::latest> has been upgraded from version 0.4003 to 0.4205. |
| 872 | NOTE: L<inc::latest> is deprecated and may be removed from a future version of Perl. |
| 873 | |
| 874 | =item * |
| 875 | |
| 876 | L<integer> has been upgraded from version 1.00 to 1.01. |
| 877 | |
| 878 | =item * |
| 879 | |
| 880 | L<IO> has been upgraded from version 1.28 to 1.31. |
| 881 | |
| 882 | =item * |
| 883 | |
| 884 | L<IO::Compress::Gzip> and friends have been upgraded from version 2.060 to |
| 885 | 2.064. |
| 886 | |
| 887 | =item * |
| 888 | |
| 889 | L<IPC::Cmd> has been upgraded from version 0.80 to 0.92. |
| 890 | |
| 891 | =item * |
| 892 | |
| 893 | L<IPC::Open3> has been upgraded from version 1.13 to 1.16. |
| 894 | |
| 895 | =item * |
| 896 | |
| 897 | L<IPC::SysV> has been upgraded from version 2.03 to 2.04. |
| 898 | |
| 899 | =item * |
| 900 | |
| 901 | L<JSON::PP> has been upgraded from version 2.27202 to 2.27203. |
| 902 | |
| 903 | =item * |
| 904 | |
| 905 | L<List::Util> has been upgraded from version 1.27 to 1.38. |
| 906 | |
| 907 | =item * |
| 908 | |
| 909 | L<locale> has been upgraded from version 1.02 to 1.03. |
| 910 | |
| 911 | =item * |
| 912 | |
| 913 | L<Locale::Codes> has been upgraded from version 3.25 to 3.30. |
| 914 | |
| 915 | =item * |
| 916 | |
| 917 | L<Locale::Maketext> has been upgraded from version 1.23 to 1.25. |
| 918 | |
| 919 | =item * |
| 920 | |
| 921 | L<Math::BigInt> has been upgraded from version 1.9991 to 1.9993. |
| 922 | |
| 923 | =item * |
| 924 | |
| 925 | L<Math::BigInt::FastCalc> has been upgraded from version 0.30 to 0.31. |
| 926 | |
| 927 | =item * |
| 928 | |
| 929 | L<Math::BigRat> has been upgraded from version 0.2604 to 0.2606. |
| 930 | |
| 931 | =item * |
| 932 | |
| 933 | L<MIME::Base64> has been upgraded from version 3.13 to 3.14. |
| 934 | |
| 935 | =item * |
| 936 | |
| 937 | L<Module::Build> has been upgraded from version 0.4003 to 0.4205. |
| 938 | NOTE: L<Module::Build> is deprecated and may be removed from a future version of Perl. |
| 939 | |
| 940 | =item * |
| 941 | |
| 942 | L<Module::CoreList> has been upgraded from version 2.89 to 3.10. |
| 943 | |
| 944 | =item * |
| 945 | |
| 946 | L<Module::Load> has been upgraded from version 0.24 to 0.32. |
| 947 | |
| 948 | =item * |
| 949 | |
| 950 | L<Module::Load::Conditional> has been upgraded from version 0.54 to 0.62. |
| 951 | |
| 952 | =item * |
| 953 | |
| 954 | L<Module::Metadata> has been upgraded from version 1.000011 to 1.000019. |
| 955 | |
| 956 | =item * |
| 957 | |
| 958 | L<mro> has been upgraded from version 1.11 to 1.16. |
| 959 | |
| 960 | =item * |
| 961 | |
| 962 | L<Net::Ping> has been upgraded from version 2.41 to 2.43. |
| 963 | |
| 964 | =item * |
| 965 | |
| 966 | L<Opcode> has been upgraded from version 1.25 to 1.27. |
| 967 | |
| 968 | =item * |
| 969 | |
| 970 | L<Package::Constants> has been upgraded from version 0.02 to 0.04. |
| 971 | NOTE: L<Package::Constants> is deprecated and may be removed from a future version of Perl. |
| 972 | |
| 973 | =item * |
| 974 | |
| 975 | L<Params::Check> has been upgraded from version 0.36 to 0.38. |
| 976 | |
| 977 | =item * |
| 978 | |
| 979 | L<parent> has been upgraded from version 0.225 to 0.228. |
| 980 | |
| 981 | =item * |
| 982 | |
| 983 | L<Parse::CPAN::Meta> has been upgraded from version 1.4404 to 1.4414. |
| 984 | |
| 985 | =item * |
| 986 | |
| 987 | L<Perl::OSType> has been upgraded from version 1.003 to 1.007. |
| 988 | |
| 989 | =item * |
| 990 | |
| 991 | L<perlfaq> has been upgraded from version 5.0150042 to 5.0150044. |
| 992 | |
| 993 | =item * |
| 994 | |
| 995 | L<PerlIO> has been upgraded from version 1.07 to 1.09. |
| 996 | |
| 997 | =item * |
| 998 | |
| 999 | L<PerlIO::encoding> has been upgraded from version 0.16 to 0.18. |
| 1000 | |
| 1001 | =item * |
| 1002 | |
| 1003 | L<PerlIO::scalar> has been upgraded from version 0.16 to 0.18. |
| 1004 | |
| 1005 | =item * |
| 1006 | |
| 1007 | L<PerlIO::via> has been upgraded from version 0.12 to 0.14. |
| 1008 | |
| 1009 | =item * |
| 1010 | |
| 1011 | L<Pod::Escapes> has been upgraded from version 1.04 to 1.06. |
| 1012 | |
| 1013 | =item * |
| 1014 | |
| 1015 | L<Pod::Functions> has been upgraded from version 1.06 to 1.08. |
| 1016 | |
| 1017 | =item * |
| 1018 | |
| 1019 | L<Pod::Html> has been upgraded from version 1.18 to 1.21. |
| 1020 | |
| 1021 | =item * |
| 1022 | |
| 1023 | L<Pod::Parser> has been upgraded from version 1.60 to 1.62. |
| 1024 | |
| 1025 | =item * |
| 1026 | |
| 1027 | L<Pod::Perldoc> has been upgraded from version 3.19 to 3.23. |
| 1028 | |
| 1029 | =item * |
| 1030 | |
| 1031 | L<Pod::Usage> has been upgraded from version 1.61 to 1.63. |
| 1032 | |
| 1033 | =item * |
| 1034 | |
| 1035 | L<POSIX> has been upgraded from version 1.32 to 1.38_03. |
| 1036 | |
| 1037 | =item * |
| 1038 | |
| 1039 | L<re> has been upgraded from version 0.23 to 0.26. |
| 1040 | |
| 1041 | =item * |
| 1042 | |
| 1043 | L<Safe> has been upgraded from version 2.35 to 2.37. |
| 1044 | |
| 1045 | =item * |
| 1046 | |
| 1047 | L<Scalar::Util> has been upgraded from version 1.27 to 1.38. |
| 1048 | |
| 1049 | =item * |
| 1050 | |
| 1051 | L<SDBM_File> has been upgraded from version 1.09 to 1.11. |
| 1052 | |
| 1053 | =item * |
| 1054 | |
| 1055 | L<Socket> has been upgraded from version 2.009 to 2.013. |
| 1056 | |
| 1057 | =item * |
| 1058 | |
| 1059 | L<Storable> has been upgraded from version 2.41 to 2.49. |
| 1060 | |
| 1061 | =item * |
| 1062 | |
| 1063 | L<strict> has been upgraded from version 1.07 to 1.08. |
| 1064 | |
| 1065 | =item * |
| 1066 | |
| 1067 | L<subs> has been upgraded from version 1.01 to 1.02. |
| 1068 | |
| 1069 | =item * |
| 1070 | |
| 1071 | L<Sys::Hostname> has been upgraded from version 1.17 to 1.18. |
| 1072 | |
| 1073 | =item * |
| 1074 | |
| 1075 | L<Sys::Syslog> has been upgraded from version 0.32 to 0.33. |
| 1076 | |
| 1077 | =item * |
| 1078 | |
| 1079 | L<Term::Cap> has been upgraded from version 1.13 to 1.15. |
| 1080 | |
| 1081 | =item * |
| 1082 | |
| 1083 | L<Term::ReadLine> has been upgraded from version 1.12 to 1.14. |
| 1084 | |
| 1085 | =item * |
| 1086 | |
| 1087 | L<Test::Harness> has been upgraded from version 3.26 to 3.30. |
| 1088 | |
| 1089 | =item * |
| 1090 | |
| 1091 | L<Test::Simple> has been upgraded from version 0.98 to 1.001002. |
| 1092 | |
| 1093 | =item * |
| 1094 | |
| 1095 | L<Text::ParseWords> has been upgraded from version 3.28 to 3.29. |
| 1096 | |
| 1097 | =item * |
| 1098 | |
| 1099 | L<Text::Tabs> has been upgraded from version 2012.0818 to 2013.0523. |
| 1100 | |
| 1101 | =item * |
| 1102 | |
| 1103 | L<Text::Wrap> has been upgraded from version 2012.0818 to 2013.0523. |
| 1104 | |
| 1105 | =item * |
| 1106 | |
| 1107 | L<Thread> has been upgraded from version 3.02 to 3.04. |
| 1108 | |
| 1109 | =item * |
| 1110 | |
| 1111 | L<Thread::Queue> has been upgraded from version 3.02 to 3.05. |
| 1112 | |
| 1113 | =item * |
| 1114 | |
| 1115 | L<threads> has been upgraded from version 1.86 to 1.93. |
| 1116 | |
| 1117 | =item * |
| 1118 | |
| 1119 | L<threads::shared> has been upgraded from version 1.43 to 1.46. |
| 1120 | |
| 1121 | =item * |
| 1122 | |
| 1123 | L<Tie::Array> has been upgraded from version 1.05 to 1.06. |
| 1124 | |
| 1125 | =item * |
| 1126 | |
| 1127 | L<Tie::File> has been upgraded from version 0.99 to 1.00. |
| 1128 | |
| 1129 | =item * |
| 1130 | |
| 1131 | L<Tie::Hash> has been upgraded from version 1.04 to 1.05. |
| 1132 | |
| 1133 | =item * |
| 1134 | |
| 1135 | L<Tie::Scalar> has been upgraded from version 1.02 to 1.03. |
| 1136 | |
| 1137 | =item * |
| 1138 | |
| 1139 | L<Tie::StdHandle> has been upgraded from version 4.3 to 4.4. |
| 1140 | |
| 1141 | =item * |
| 1142 | |
| 1143 | L<Time::HiRes> has been upgraded from version 1.9725 to 1.9726. |
| 1144 | |
| 1145 | =item * |
| 1146 | |
| 1147 | L<Time::Piece> has been upgraded from version 1.20_01 to 1.27. |
| 1148 | |
| 1149 | =item * |
| 1150 | |
| 1151 | L<Unicode::Collate> has been upgraded from version 0.97 to 1.04. |
| 1152 | |
| 1153 | =item * |
| 1154 | |
| 1155 | L<Unicode::Normalize> has been upgraded from version 1.16 to 1.17. |
| 1156 | |
| 1157 | =item * |
| 1158 | |
| 1159 | L<Unicode::UCD> has been upgraded from version 0.51 to 0.57. |
| 1160 | |
| 1161 | =item * |
| 1162 | |
| 1163 | L<utf8> has been upgraded from version 1.10 to 1.13. |
| 1164 | |
| 1165 | =item * |
| 1166 | |
| 1167 | L<version> has been upgraded from version 0.9902 to 0.9908. |
| 1168 | |
| 1169 | =item * |
| 1170 | |
| 1171 | L<vmsish> has been upgraded from version 1.03 to 1.04. |
| 1172 | |
| 1173 | =item * |
| 1174 | |
| 1175 | L<warnings> has been upgraded from version 1.18 to 1.23. |
| 1176 | |
| 1177 | =item * |
| 1178 | |
| 1179 | L<Win32> has been upgraded from version 0.47 to 0.49. |
| 1180 | |
| 1181 | =item * |
| 1182 | |
| 1183 | L<XS::Typemap> has been upgraded from version 0.10 to 0.13. |
| 1184 | |
| 1185 | =item * |
| 1186 | |
| 1187 | L<XSLoader> has been upgraded from version 0.16 to 0.17. |
| 1188 | |
| 1189 | =back |
| 1190 | |
| 1191 | =head1 Documentation |
| 1192 | |
| 1193 | =head2 New Documentation |
| 1194 | |
| 1195 | =head3 L<perlrepository> |
| 1196 | |
| 1197 | This document was removed (actually, renamed L<perlgit> and given a major |
| 1198 | overhaul) in Perl v5.14, causing Perl documentation websites to show the now |
| 1199 | out of date version in Perl v5.12 as the latest version. It has now been |
| 1200 | restored in stub form, directing readers to current information. |
| 1201 | |
| 1202 | =head2 Changes to Existing Documentation |
| 1203 | |
| 1204 | =head3 L<perldata> |
| 1205 | |
| 1206 | =over 4 |
| 1207 | |
| 1208 | =item * |
| 1209 | |
| 1210 | New sections have been added to document the new index/value array slice and |
| 1211 | key/value hash slice syntax. |
| 1212 | |
| 1213 | =back |
| 1214 | |
| 1215 | =head3 L<perldebguts> |
| 1216 | |
| 1217 | =over 4 |
| 1218 | |
| 1219 | =item * |
| 1220 | |
| 1221 | The C<DB::goto> and C<DB::lsub> debugger subroutines are now documented. [perl |
| 1222 | #77680] |
| 1223 | |
| 1224 | =back |
| 1225 | |
| 1226 | =head3 L<perlexperiment> |
| 1227 | |
| 1228 | =over |
| 1229 | |
| 1230 | =item * |
| 1231 | |
| 1232 | C<\s> matching C<\cK> is marked experimental. |
| 1233 | |
| 1234 | =item * |
| 1235 | |
| 1236 | ithreads were accepted in v5.8.0 (but are discouraged as of v5.20.0). |
| 1237 | |
| 1238 | =item * |
| 1239 | |
| 1240 | Long doubles are not considered experimental. |
| 1241 | |
| 1242 | =item * |
| 1243 | |
| 1244 | Code in regular expressions, regular expression backtracking verbs, |
| 1245 | and lvalue subroutines are no longer listed as experimental. (This |
| 1246 | also affects L<perlre> and L<perlsub>.) |
| 1247 | |
| 1248 | =back |
| 1249 | |
| 1250 | =head3 L<perlfunc> |
| 1251 | |
| 1252 | =over |
| 1253 | |
| 1254 | =item * |
| 1255 | |
| 1256 | C<chop> and C<chomp> now note that they can reset the hash iterator. |
| 1257 | |
| 1258 | =item * |
| 1259 | |
| 1260 | C<exec>'s handling of arguments is now more clearly documented. |
| 1261 | |
| 1262 | =item * |
| 1263 | |
| 1264 | C<eval EXPR> now has caveats about expanding floating point numbers in some |
| 1265 | locales. |
| 1266 | |
| 1267 | =item * |
| 1268 | |
| 1269 | C<goto EXPR> is now documented to handle an expression that evalutes to a |
| 1270 | code reference as if it was C<goto &$coderef>. This behavior is at least ten |
| 1271 | years old. |
| 1272 | |
| 1273 | =item * |
| 1274 | |
| 1275 | Since Perl v5.10, it has been possible for subroutines in C<@INC> to return |
| 1276 | a reference to a scalar holding initial source code to prepend to the file. |
| 1277 | This is now documented. |
| 1278 | |
| 1279 | =item * |
| 1280 | |
| 1281 | The documentation of C<ref> has been updated to recommend the use of |
| 1282 | C<blessed>, C<isa> and C<reftype> when dealing with references to blessed |
| 1283 | objects. |
| 1284 | |
| 1285 | =back |
| 1286 | |
| 1287 | =head3 L<perlguts> |
| 1288 | |
| 1289 | =over 4 |
| 1290 | |
| 1291 | =item * |
| 1292 | |
| 1293 | Numerous minor changes have been made to reflect changes made to the perl |
| 1294 | internals in this release. |
| 1295 | |
| 1296 | =item * |
| 1297 | |
| 1298 | New sections on L<Read-Only Values|perlguts/"Read-Only Values"> and |
| 1299 | L<Copy on Write|perlguts/"Copy on Write"> have been added. |
| 1300 | |
| 1301 | =back |
| 1302 | |
| 1303 | =head3 L<perlhack> |
| 1304 | |
| 1305 | =over 4 |
| 1306 | |
| 1307 | =item * |
| 1308 | |
| 1309 | The L<Super Quick Patch Guide|perlhack/SUPER QUICK PATCH GUIDE> section has |
| 1310 | been updated. |
| 1311 | |
| 1312 | =back |
| 1313 | |
| 1314 | =head3 L<perlhacktips> |
| 1315 | |
| 1316 | =over 4 |
| 1317 | |
| 1318 | =item * |
| 1319 | |
| 1320 | The documentation has been updated to include some more examples of C<gdb> |
| 1321 | usage. |
| 1322 | |
| 1323 | =back |
| 1324 | |
| 1325 | =head3 L<perllexwarn> |
| 1326 | |
| 1327 | =over 4 |
| 1328 | |
| 1329 | =item * |
| 1330 | |
| 1331 | The L<perllexwarn> documentation used to describe the hierarchy of warning |
| 1332 | categories understood by the L<warnings> pragma. That description has now |
| 1333 | been moved to the L<warnings> documentation itself, leaving L<perllexwarn> |
| 1334 | as a stub that points to it. This change consolidates all documentation for |
| 1335 | lexical warnings in a single place. |
| 1336 | |
| 1337 | =back |
| 1338 | |
| 1339 | =head3 L<perllocale> |
| 1340 | |
| 1341 | =over |
| 1342 | |
| 1343 | =item * |
| 1344 | |
| 1345 | The documentation now mentions F<fc()> and C<\F>, and includes many |
| 1346 | clarifications and corrections in general. |
| 1347 | |
| 1348 | =back |
| 1349 | |
| 1350 | =head3 L<perlop> |
| 1351 | |
| 1352 | =over 4 |
| 1353 | |
| 1354 | =item * |
| 1355 | |
| 1356 | The language design of Perl has always called for monomorphic operators. |
| 1357 | This is now mentioned explicitly. |
| 1358 | |
| 1359 | =back |
| 1360 | |
| 1361 | =head3 L<perlopentut> |
| 1362 | |
| 1363 | =over 4 |
| 1364 | |
| 1365 | =item * |
| 1366 | |
| 1367 | The C<open> tutorial has been completely rewritten by Tom Christiansen, and now |
| 1368 | focuses on covering only the basics, rather than providing a comprehensive |
| 1369 | reference to all things openable. This rewrite came as the result of a |
| 1370 | vigorous discussion on perl5-porters kicked off by a set of improvements |
| 1371 | written by Alexander Hartmaier to the existing L<perlopentut>. A "more than |
| 1372 | you ever wanted to know about C<open>" document may follow in subsequent |
| 1373 | versions of perl. |
| 1374 | |
| 1375 | =back |
| 1376 | |
| 1377 | =head3 L<perlre> |
| 1378 | |
| 1379 | =over 4 |
| 1380 | |
| 1381 | =item * |
| 1382 | |
| 1383 | The fact that the regexp engine makes no effort to call (?{}) and (??{}) |
| 1384 | constructs any specified number of times (although it will basically DWIM |
| 1385 | in case of a successful match) has been documented. |
| 1386 | |
| 1387 | =item * |
| 1388 | |
| 1389 | The C</r> modifier (for non-destructive substitution) is now documented. [perl |
| 1390 | #119151] |
| 1391 | |
| 1392 | =item * |
| 1393 | |
| 1394 | The documentation for C</x> and C<(?# comment)> has been expanded and clarified. |
| 1395 | |
| 1396 | =back |
| 1397 | |
| 1398 | =head3 L<perlreguts> |
| 1399 | |
| 1400 | =over 4 |
| 1401 | |
| 1402 | =item * |
| 1403 | |
| 1404 | The documentation has been updated in the light of recent changes to |
| 1405 | F<regcomp.c>. |
| 1406 | |
| 1407 | =back |
| 1408 | |
| 1409 | =head3 L<perlsub> |
| 1410 | |
| 1411 | =over 4 |
| 1412 | |
| 1413 | =item * |
| 1414 | |
| 1415 | The need to predeclare recursive functions with prototypes in order for the |
| 1416 | prototype to be honoured in the recursive call is now documented. [perl #2726] |
| 1417 | |
| 1418 | =item * |
| 1419 | |
| 1420 | A list of subroutine names used by the perl implementation is now included. |
| 1421 | [perl #77680] |
| 1422 | |
| 1423 | =back |
| 1424 | |
| 1425 | =head3 L<perltrap> |
| 1426 | |
| 1427 | =over 4 |
| 1428 | |
| 1429 | =item * |
| 1430 | |
| 1431 | There is now a L<JavaScript|perltrap/JavaScript Traps> section. |
| 1432 | |
| 1433 | =back |
| 1434 | |
| 1435 | =head3 L<perlunicode> |
| 1436 | |
| 1437 | =over 4 |
| 1438 | |
| 1439 | =item * |
| 1440 | |
| 1441 | The documentation has been updated to reflect C<Bidi_Class> changes in |
| 1442 | Unicode 6.3. |
| 1443 | |
| 1444 | =back |
| 1445 | |
| 1446 | =head3 L<perlvar> |
| 1447 | |
| 1448 | =over 4 |
| 1449 | |
| 1450 | =item * |
| 1451 | |
| 1452 | A new section explaining the performance issues of $`, $& and $', including |
| 1453 | workarounds and changes in different versions of Perl, has been added. |
| 1454 | |
| 1455 | =item * |
| 1456 | |
| 1457 | Three L<English> variable names which have long been documented but do not |
| 1458 | actually exist have been removed from the documentation. These were |
| 1459 | C<$OLD_PERL_VERSION>, C<$OFMT>, and C<$ARRAY_BASE>. |
| 1460 | |
| 1461 | (Actually, C<OLD_PERL_VERSION> I<does> exist, starting with this revision, but |
| 1462 | remained undocumented until perl 5.22.0.) |
| 1463 | |
| 1464 | =back |
| 1465 | |
| 1466 | =head3 L<perlxs> |
| 1467 | |
| 1468 | =over 4 |
| 1469 | |
| 1470 | =item * |
| 1471 | |
| 1472 | Several problems in the C<MY_CXT> example have been fixed. |
| 1473 | |
| 1474 | =back |
| 1475 | |
| 1476 | =head1 Diagnostics |
| 1477 | |
| 1478 | The following additions or changes have been made to diagnostic output, |
| 1479 | including warnings and fatal error messages. For the complete list of |
| 1480 | diagnostic messages, see L<perldiag>. |
| 1481 | |
| 1482 | =head2 New Diagnostics |
| 1483 | |
| 1484 | =head3 New Errors |
| 1485 | |
| 1486 | =over 4 |
| 1487 | |
| 1488 | =item * |
| 1489 | |
| 1490 | L<delete argument is indexE<sol>value array slice, use array slice|perldiag/"delete argument is index/value array slice, use array slice"> |
| 1491 | |
| 1492 | (F) You used index/value array slice syntax (C<%array[...]>) as the argument to |
| 1493 | C<delete>. You probably meant C<@array[...]> with an @ symbol instead. |
| 1494 | |
| 1495 | =item * |
| 1496 | |
| 1497 | L<delete argument is keyE<sol>value hash slice, use hash slice|perldiag/"delete argument is key/value hash slice, use hash slice"> |
| 1498 | |
| 1499 | (F) You used key/value hash slice syntax (C<%hash{...}>) as the argument to |
| 1500 | C<delete>. You probably meant C<@hash{...}> with an @ symbol instead. |
| 1501 | |
| 1502 | =item * |
| 1503 | |
| 1504 | L<Magical list constants are not supported|perldiag/"Magical list constants are |
| 1505 | not supported"> |
| 1506 | |
| 1507 | (F) You assigned a magical array to a stash element, and then tried to use the |
| 1508 | subroutine from the same slot. You are asking Perl to do something it cannot |
| 1509 | do, details subject to change between Perl versions. |
| 1510 | |
| 1511 | =item * |
| 1512 | |
| 1513 | Added L<Setting $E<sol> to a %s reference is forbidden|perldiag/"Setting $E<sol> to %s reference is forbidden"> |
| 1514 | |
| 1515 | =back |
| 1516 | |
| 1517 | =head3 New Warnings |
| 1518 | |
| 1519 | =over 4 |
| 1520 | |
| 1521 | =item * |
| 1522 | |
| 1523 | L<%s on reference is experimental|perldiag/"push on reference is experimental">: |
| 1524 | |
| 1525 | The "auto-deref" feature is experimental. |
| 1526 | |
| 1527 | Starting in v5.14.0, it was possible to use push, pop, keys, and other |
| 1528 | built-in functions not only on aggregate types, but on references to |
| 1529 | them. The feature was not deployed to its original intended |
| 1530 | specification, and now may become redundant to postfix dereferencing. |
| 1531 | It has always been categorized as an experimental feature, and in |
| 1532 | v5.20.0 is carries a warning as such. |
| 1533 | |
| 1534 | Warnings will now be issued at compile time when these operations are |
| 1535 | detected. |
| 1536 | |
| 1537 | no if $] >= 5.01908, warnings => "experimental::autoderef"; |
| 1538 | |
| 1539 | Consider, though, replacing the use of these features, as they may |
| 1540 | change behavior again before becoming stable. |
| 1541 | |
| 1542 | =item * |
| 1543 | |
| 1544 | L<A sequence of multiple spaces in a charnames alias definition is deprecated|perldiag/"A sequence of multiple spaces in a charnames alias definition is deprecated"> |
| 1545 | |
| 1546 | L<Trailing white-space in a charnames alias definition is deprecated|perldiag/"Trailing white-space in a charnames alias definition is deprecated"> |
| 1547 | |
| 1548 | These two deprecation warnings involving C<\N{...}> were incorrectly |
| 1549 | implemented. They did not warn by default (now they do) and could not be |
| 1550 | made fatal via C<< use warnings FATAL => 'deprecated' >> (now they can). |
| 1551 | |
| 1552 | =item * |
| 1553 | |
| 1554 | L<Attribute prototype(%s) discards earlier prototype attribute in same sub|perldiag/"Attribute prototype(%s) discards earlier prototype attribute in same sub"> |
| 1555 | |
| 1556 | (W misc) A sub was declared as C<sub foo : prototype(A) : prototype(B) {}>, for |
| 1557 | example. Since each sub can only have one prototype, the earlier |
| 1558 | declaration(s) are discarded while the last one is applied. |
| 1559 | |
| 1560 | =item * |
| 1561 | |
| 1562 | L<Invalid \0 character in %s for %s: %s\0%s|perldiag/"Invalid \0 character in %s for %s: %s\0%s"> |
| 1563 | |
| 1564 | (W syscalls) Embedded \0 characters in pathnames or other system call arguments |
| 1565 | produce a warning as of 5.20. The parts after the \0 were formerly ignored by |
| 1566 | system calls. |
| 1567 | |
| 1568 | =item * |
| 1569 | |
| 1570 | L<Matched non-Unicode code point 0x%X against Unicode property; may not be portable|perldiag/"Matched non-Unicode code point 0x%X against Unicode property; may not be portable">. |
| 1571 | |
| 1572 | This replaces the message "Code point 0x%X is not Unicode, all \p{} matches |
| 1573 | fail; all \P{} matches succeed". |
| 1574 | |
| 1575 | =item * |
| 1576 | |
| 1577 | L<Missing ']' in prototype for %s : %s|perldiag/"Missing ']' in prototype for %s : %s"> |
| 1578 | |
| 1579 | (W illegalproto) A grouping was started with C<[> but never closed with C<]>. |
| 1580 | |
| 1581 | =item * |
| 1582 | |
| 1583 | L<Possible precedence issue with control flow operator|perldiag/"Possible precedence issue with control flow operator"> |
| 1584 | |
| 1585 | (W syntax) There is a possible problem with the mixing of a control flow |
| 1586 | operator (e.g. C<return>) and a low-precedence operator like C<or>. Consider: |
| 1587 | |
| 1588 | sub { return $a or $b; } |
| 1589 | |
| 1590 | This is parsed as: |
| 1591 | |
| 1592 | sub { (return $a) or $b; } |
| 1593 | |
| 1594 | Which is effectively just: |
| 1595 | |
| 1596 | sub { return $a; } |
| 1597 | |
| 1598 | Either use parentheses or the high-precedence variant of the operator. |
| 1599 | |
| 1600 | Note this may be also triggered for constructs like: |
| 1601 | |
| 1602 | sub { 1 if die; } |
| 1603 | |
| 1604 | =item * |
| 1605 | |
| 1606 | L<Postfix dereference is experimental|perldiag/"Postfix dereference is experimental"> |
| 1607 | |
| 1608 | (S experimental::postderef) This warning is emitted if you use the experimental |
| 1609 | postfix dereference syntax. Simply suppress the warning if you want to use the |
| 1610 | feature, but know that in doing so you are taking the risk of using an |
| 1611 | experimental feature which may change or be removed in a future Perl version: |
| 1612 | |
| 1613 | no warnings "experimental::postderef"; |
| 1614 | use feature "postderef", "postderef_qq"; |
| 1615 | $ref->$*; |
| 1616 | $aref->@*; |
| 1617 | $aref->@[@indices]; |
| 1618 | ... etc ... |
| 1619 | |
| 1620 | =item * |
| 1621 | |
| 1622 | L<Prototype '%s' overridden by attribute 'prototype(%s)' in %s|perldiag/"Prototype '%s' overridden by attribute 'prototype(%s)' in %s"> |
| 1623 | |
| 1624 | (W prototype) A prototype was declared in both the parentheses after the sub |
| 1625 | name and via the prototype attribute. The prototype in parentheses is useless, |
| 1626 | since it will be replaced by the prototype from the attribute before it's ever |
| 1627 | used. |
| 1628 | |
| 1629 | =item * |
| 1630 | |
| 1631 | L<Scalar value @%s[%s] better written as $%s[%s]|perldiag/"Scalar value @%s[%s] better written as $%s[%s]"> |
| 1632 | |
| 1633 | (W syntax) In scalar context, you've used an array index/value slice (indicated |
| 1634 | by %) to select a single element of an array. Generally it's better to ask for |
| 1635 | a scalar value (indicated by $). The difference is that C<$foo[&bar]> always |
| 1636 | behaves like a scalar, both in the value it returns and when evaluating its |
| 1637 | argument, while C<%foo[&bar]> provides a list context to its subscript, which |
| 1638 | can do weird things if you're expecting only one subscript. When called in |
| 1639 | list context, it also returns the index (what C<&bar> returns) in addition to |
| 1640 | the value. |
| 1641 | |
| 1642 | =item * |
| 1643 | |
| 1644 | L<Scalar value @%s{%s} better written as $%s{%s}|perldiag/"Scalar value @%s{%s} better written as $%s{%s}"> |
| 1645 | |
| 1646 | (W syntax) In scalar context, you've used a hash key/value slice (indicated by |
| 1647 | %) to select a single element of a hash. Generally it's better to ask for a |
| 1648 | scalar value (indicated by $). The difference is that C<$foo{&bar}> always |
| 1649 | behaves like a scalar, both in the value it returns and when evaluating its |
| 1650 | argument, while C<@foo{&bar}> and provides a list context to its subscript, |
| 1651 | which can do weird things if you're expecting only one subscript. When called |
| 1652 | in list context, it also returns the key in addition to the value. |
| 1653 | |
| 1654 | =item * |
| 1655 | |
| 1656 | L<Setting $E<sol> to a reference to %s as a form of slurp is deprecated, treating as undef|perldiag/"Setting $E<sol> to a reference to %s as a form of slurp is deprecated, treating as undef"> |
| 1657 | |
| 1658 | =item * |
| 1659 | |
| 1660 | L<Unexpected exit %u|perldiag/"Unexpected exit %u"> |
| 1661 | |
| 1662 | (S) exit() was called or the script otherwise finished gracefully when |
| 1663 | C<PERL_EXIT_WARN> was set in C<PL_exit_flags>. |
| 1664 | |
| 1665 | =item * |
| 1666 | |
| 1667 | L<Unexpected exit failure %d|perldiag/"Unexpected exit failure %d"> |
| 1668 | |
| 1669 | (S) An uncaught die() was called when C<PERL_EXIT_WARN> was set in |
| 1670 | C<PL_exit_flags>. |
| 1671 | |
| 1672 | =item * |
| 1673 | |
| 1674 | L<Use of literal control characters in variable names is deprecated|perldiag/"Use of literal control characters in variable names is deprecated"> |
| 1675 | |
| 1676 | (D deprecated) Using literal control characters in the source to refer to the |
| 1677 | ^FOO variables, like $^X and ${^GLOBAL_PHASE} is now deprecated. This only |
| 1678 | affects code like $\cT, where \cT is a control (like a C<SOH>) in the |
| 1679 | source code: ${"\cT"} and $^T remain valid. |
| 1680 | |
| 1681 | =item * |
| 1682 | |
| 1683 | L<Useless use of greediness modifier|perldiag/"Useless use of greediness modifier '%c' in regex; marked by <-- HERE in m/%s/"> |
| 1684 | |
| 1685 | This fixes [Perl #42957]. |
| 1686 | |
| 1687 | =back |
| 1688 | |
| 1689 | =head2 Changes to Existing Diagnostics |
| 1690 | |
| 1691 | =over 4 |
| 1692 | |
| 1693 | =item * |
| 1694 | |
| 1695 | Warnings and errors from the regexp engine are now UTF-8 clean. |
| 1696 | |
| 1697 | =item * |
| 1698 | |
| 1699 | The "Unknown switch condition" error message has some slight changes. This |
| 1700 | error triggers when there is an unknown condition in a C<(?(foo))> conditional. |
| 1701 | The error message used to read: |
| 1702 | |
| 1703 | Unknown switch condition (?(%s in regex; |
| 1704 | |
| 1705 | But what %s could be was mostly up to luck. For C<(?(foobar))>, you might have |
| 1706 | seen "fo" or "f". For Unicode characters, you would generally get a corrupted |
| 1707 | string. The message has been changed to read: |
| 1708 | |
| 1709 | Unknown switch condition (?(...)) in regex; |
| 1710 | |
| 1711 | Additionally, the C<'E<lt>-- HERE'> marker in the error will now point to the |
| 1712 | correct spot in the regex. |
| 1713 | |
| 1714 | =item * |
| 1715 | |
| 1716 | The "%s "\x%X" does not map to Unicode" warning is now correctly listed as a |
| 1717 | severe warning rather than as a fatal error. |
| 1718 | |
| 1719 | =item * |
| 1720 | |
| 1721 | Under rare circumstances, one could get a "Can't coerce readonly REF to |
| 1722 | string" instead of the customary "Modification of a read-only value". This |
| 1723 | alternate error message has been removed. |
| 1724 | |
| 1725 | =item * |
| 1726 | |
| 1727 | "Ambiguous use of * resolved as operator *": This and similar warnings |
| 1728 | about "%" and "&" used to occur in some circumstances where there was no |
| 1729 | operator of the type cited, so the warning was completely wrong. This has |
| 1730 | been fixed [perl #117535, #76910]. |
| 1731 | |
| 1732 | =item * |
| 1733 | |
| 1734 | Warnings about malformed subroutine prototypes are now more consistent in |
| 1735 | how the prototypes are rendered. Some of these warnings would truncate |
| 1736 | prototypes containing nulls. In other cases one warning would suppress |
| 1737 | another. The warning about illegal characters in prototypes no longer says |
| 1738 | "after '_'" if the bad character came before the underscore. |
| 1739 | |
| 1740 | =item * |
| 1741 | |
| 1742 | L<Perl folding rules are not up-to-date for 0x%X; please use the perlbug |
| 1743 | utility to report; in regex; marked by <-- HERE in |
| 1744 | mE<sol>%sE<sol>|perldiag/"Perl folding rules are not up-to-date for 0x%X; |
| 1745 | please use the perlbug utility to report; in regex; marked by <-- HERE in |
| 1746 | m/%s/"> |
| 1747 | |
| 1748 | This message is now only in the regexp category, and not in the deprecated |
| 1749 | category. It is still a default (i.e., severe) warning [perl #89648]. |
| 1750 | |
| 1751 | =item * |
| 1752 | |
| 1753 | L<%%s[%s] in scalar context better written as $%s[%s]|perldiag/"%%s[%s] in scalar context better written as $%s[%s]"> |
| 1754 | |
| 1755 | This warning now occurs for any C<%array[$index]> or C<%hash{key}> known to |
| 1756 | be in scalar context at compile time. Previously it was worded "Scalar |
| 1757 | value %%s[%s] better written as $%s[%s]". |
| 1758 | |
| 1759 | =item * |
| 1760 | |
| 1761 | L<Switch condition not recognized in regex; marked by <-- HERE in mE<sol>%sE<sol>|perldiag/"Switch condition not recognized in regex; marked by <-- HERE in m/%s/">: |
| 1762 | |
| 1763 | The description for this diagnostic has been extended to cover all cases where the warning may occur. |
| 1764 | Issues with the positioning of the arrow indicator have also been resolved. |
| 1765 | |
| 1766 | =item * |
| 1767 | |
| 1768 | The error messages for C<my($a?$b$c)> and C<my(do{})> now mention "conditional |
| 1769 | expression" and "do block", respectively, instead of reading 'Can't declare |
| 1770 | null operation in "my"'. |
| 1771 | |
| 1772 | =item * |
| 1773 | |
| 1774 | When C<use re "debug"> executes a regex containing a backreference, the |
| 1775 | debugging output now shows what string is being matched. |
| 1776 | |
| 1777 | =item * |
| 1778 | |
| 1779 | The now fatal error message C<Character following "\c" must be ASCII> has been |
| 1780 | reworded as C<Character following "\c" must be printable ASCII> to emphasize |
| 1781 | that in C<\cI<X>>, I<X> must be a I<printable (non-control)> ASCII character. |
| 1782 | |
| 1783 | =back |
| 1784 | |
| 1785 | =head1 Utility Changes |
| 1786 | |
| 1787 | =head3 L<a2p> |
| 1788 | |
| 1789 | =over 4 |
| 1790 | |
| 1791 | =item * |
| 1792 | |
| 1793 | A possible crash from an off-by-one error when trying to access before the |
| 1794 | beginning of a buffer has been fixed. [perl #120244] |
| 1795 | |
| 1796 | =back |
| 1797 | |
| 1798 | =head3 F<bisect.pl> |
| 1799 | |
| 1800 | The git bisection tool F<Porting/bisect.pl> has had many enhancements. |
| 1801 | |
| 1802 | It is provided as part of the source distribution but not installed because |
| 1803 | it is not self-contained as it relies on being run from within a git |
| 1804 | checkout. Note also that it makes no attempt to fix tests, correct runtime |
| 1805 | bugs or make something useful to install - its purpose is to make minimal |
| 1806 | changes to get any historical revision of interest to build and run as close |
| 1807 | as possible to "as-was", and thereby make C<git bisect> easy to use. |
| 1808 | |
| 1809 | =over 4 |
| 1810 | |
| 1811 | =item * |
| 1812 | |
| 1813 | Can optionally run the test case with a timeout. |
| 1814 | |
| 1815 | =item * |
| 1816 | |
| 1817 | Can now run in-place in a clean git checkout. |
| 1818 | |
| 1819 | =item * |
| 1820 | |
| 1821 | Can run the test case under C<valgrind>. |
| 1822 | |
| 1823 | =item * |
| 1824 | |
| 1825 | Can apply user supplied patches and fixes to the source checkout before |
| 1826 | building. |
| 1827 | |
| 1828 | =item * |
| 1829 | |
| 1830 | Now has fixups to enable building several more historical ranges of bleadperl, |
| 1831 | which can be useful for pinpointing the origins of bugs or behaviour changes. |
| 1832 | |
| 1833 | =back |
| 1834 | |
| 1835 | =head3 L<find2perl> |
| 1836 | |
| 1837 | =over 4 |
| 1838 | |
| 1839 | =item * |
| 1840 | |
| 1841 | L<find2perl> now handles C<?> wildcards correctly. [perl #113054] |
| 1842 | |
| 1843 | =back |
| 1844 | |
| 1845 | =head3 L<perlbug> |
| 1846 | |
| 1847 | =over 4 |
| 1848 | |
| 1849 | =item * |
| 1850 | |
| 1851 | F<perlbug> now has a C<-p> option for attaching patches with a bug report. |
| 1852 | |
| 1853 | =item * |
| 1854 | |
| 1855 | L<perlbug> has been modified to supply the report template with CRLF line |
| 1856 | endings on Windows. |
| 1857 | [L<perl #121277|https://rt.perl.org/Public/Bug/Display.html?id=121277>] |
| 1858 | |
| 1859 | =item * |
| 1860 | |
| 1861 | L<perlbug> now makes as few assumptions as possible about the encoding of the |
| 1862 | report. This will likely change in the future to assume UTF-8 by default but |
| 1863 | allow a user override. |
| 1864 | |
| 1865 | =back |
| 1866 | |
| 1867 | =head1 Configuration and Compilation |
| 1868 | |
| 1869 | =over 4 |
| 1870 | |
| 1871 | =item * |
| 1872 | |
| 1873 | The F<Makefile.PL> for L<SDBM_File> now generates a better F<Makefile>, which |
| 1874 | avoids a race condition during parallel makes, which could cause the build to |
| 1875 | fail. This is the last known parallel make problem (on *nix platforms), and |
| 1876 | therefore we believe that a parallel make should now always be error free. |
| 1877 | |
| 1878 | =item * |
| 1879 | |
| 1880 | F<installperl> and F<installman>'s option handling has been refactored to use |
| 1881 | L<Getopt::Long>. Both are used by the F<Makefile> C<install> targets, and |
| 1882 | are not installed, so these changes are only likely to affect custom |
| 1883 | installation scripts. |
| 1884 | |
| 1885 | =over 4 |
| 1886 | |
| 1887 | =item * |
| 1888 | |
| 1889 | Single letter options now also have long names. |
| 1890 | |
| 1891 | =item * |
| 1892 | |
| 1893 | Invalid options are now rejected. |
| 1894 | |
| 1895 | =item * |
| 1896 | |
| 1897 | Command line arguments that are not options are now rejected. |
| 1898 | |
| 1899 | =item * |
| 1900 | |
| 1901 | Each now has a C<--help> option to display the usage message. |
| 1902 | |
| 1903 | =back |
| 1904 | |
| 1905 | The behaviour for all valid documented invocations is unchanged. |
| 1906 | |
| 1907 | =item * |
| 1908 | |
| 1909 | Where possible, the build now avoids recursive invocations of F<make> when |
| 1910 | building pure-Perl extensions, without removing any parallelism from the |
| 1911 | build. Currently around 80 extensions can be processed directly by the |
| 1912 | F<make_ext.pl> tool, meaning that 80 invocations of F<make> and 160 |
| 1913 | invocations of F<miniperl> are no longer made. |
| 1914 | |
| 1915 | =item * |
| 1916 | |
| 1917 | The build system now works correctly when compiling under GCC or Clang with |
| 1918 | link-time optimization enabled (the C<-flto> option). [perl #113022] |
| 1919 | |
| 1920 | =item * |
| 1921 | |
| 1922 | Distinct library basenames with C<d_libname_unique>. |
| 1923 | |
| 1924 | When compiling perl with this option, the library files for XS modules are |
| 1925 | named something "unique" -- for example, Hash/Util/Util.so becomes |
| 1926 | Hash/Util/PL_Hash__Util.so. This behavior is similar to what currently |
| 1927 | happens on VMS, and serves as groundwork for the Android port. |
| 1928 | |
| 1929 | =item * |
| 1930 | |
| 1931 | C<sysroot> option to indicate the logical root directory under gcc and clang. |
| 1932 | |
| 1933 | When building with this option set, both Configure and the compilers search |
| 1934 | for all headers and libraries under this new sysroot, instead of /. |
| 1935 | |
| 1936 | This is a huge time saver if cross-compiling, but can also help |
| 1937 | on native builds if your toolchain's files have non-standard locations. |
| 1938 | |
| 1939 | =item * |
| 1940 | |
| 1941 | The cross-compilation model has been renovated. |
| 1942 | There's several new options, and some backwards-incompatible changes: |
| 1943 | |
| 1944 | We now build binaries for miniperl and generate_uudmap to be used on the host, |
| 1945 | rather than running every miniperl call on the target; this means that, short |
| 1946 | of 'make test', we no longer need access to the target system once Configure is |
| 1947 | done. You can provide already-built binaries through the C<hostperl> and |
| 1948 | C<hostgenerate> options to Configure. |
| 1949 | |
| 1950 | Additionally, if targeting an EBCDIC platform from an ASCII host, |
| 1951 | or viceversa, you'll need to run Configure with C<-Uhostgenerate>, to |
| 1952 | indicate that generate_uudmap should be run on the target. |
| 1953 | |
| 1954 | Finally, there's also a way of having Configure end early, right after |
| 1955 | building the host binaries, by cross-compiling without specifying a |
| 1956 | C<targethost>. |
| 1957 | |
| 1958 | The incompatible changes include no longer using xconfig.h, xlib, or |
| 1959 | Cross.pm, so canned config files and Makefiles will have to be updated. |
| 1960 | |
| 1961 | =item * |
| 1962 | |
| 1963 | Related to the above, there is now a way of specifying the location of sh |
| 1964 | (or equivalent) on the target system: C<targetsh>. |
| 1965 | |
| 1966 | For example, Android has its sh in /system/bin/sh, so if cross-compiling |
| 1967 | from a more normal Unixy system with sh in /bin/sh, "targetsh" would end |
| 1968 | up as /system/bin/sh, and "sh" as /bin/sh. |
| 1969 | |
| 1970 | =item * |
| 1971 | |
| 1972 | By default, B<gcc> 4.9 does some optimizations that break perl. The B<-fwrapv> |
| 1973 | option disables those optimizations (and probably others), so for B<gcc> 4.3 |
| 1974 | and later (since the there might be similar problems lurking on older versions |
| 1975 | too, but B<-fwrapv> was broken before 4.3, and the optimizations probably won't |
| 1976 | go away), F<Configure> now adds B<-fwrapv> unless the user requests |
| 1977 | B<-fno-wrapv>, which disables B<-fwrapv>, or B<-fsanitize=undefined>, which |
| 1978 | turns the overflows B<-fwrapv> ignores into runtime errors. |
| 1979 | [L<perl #121505|https://rt.perl.org/Public/Bug/Display.html?id=121505>] |
| 1980 | |
| 1981 | =back |
| 1982 | |
| 1983 | =head1 Testing |
| 1984 | |
| 1985 | =over 4 |
| 1986 | |
| 1987 | =item * |
| 1988 | |
| 1989 | The C<test.valgrind> make target now allows tests to be run in parallel. |
| 1990 | This target allows Perl's test suite to be run under Valgrind, which detects |
| 1991 | certain sorts of C programming errors, though at significant cost in running |
| 1992 | time. On suitable hardware, allowing parallel execution claws back a lot of |
| 1993 | that additional cost. [perl #121431] |
| 1994 | |
| 1995 | =item * |
| 1996 | |
| 1997 | Various tests in F<t/porting/> are no longer skipped when the perl |
| 1998 | F<.git> directory is outside the perl tree and pointed to by |
| 1999 | C<$GIT_DIR>. [perl #120505] |
| 2000 | |
| 2001 | =item * |
| 2002 | |
| 2003 | The test suite no longer fails when the user's interactive shell maintains a |
| 2004 | C<$PWD> environment variable, but the F</bin/sh> used for running tests |
| 2005 | doesn't. |
| 2006 | |
| 2007 | =back |
| 2008 | |
| 2009 | =head1 Platform Support |
| 2010 | |
| 2011 | =head2 New Platforms |
| 2012 | |
| 2013 | =over 4 |
| 2014 | |
| 2015 | =item Android |
| 2016 | |
| 2017 | Perl can now be built for Android, either natively or through |
| 2018 | cross-compilation, for all three currently available architectures (ARM, |
| 2019 | MIPS, and x86), on a wide range of versions. |
| 2020 | |
| 2021 | =item Bitrig |
| 2022 | |
| 2023 | Compile support has been added for Bitrig, a fork of OpenBSD. |
| 2024 | |
| 2025 | =item FreeMiNT |
| 2026 | |
| 2027 | Support has been added for FreeMiNT, a free open-source OS for the Atari ST |
| 2028 | system and its successors, based on the original MiNT that was officially |
| 2029 | adopted by Atari. |
| 2030 | |
| 2031 | =item Synology |
| 2032 | |
| 2033 | Synology ships its NAS boxes with a lean Linux distribution (DSM) on relative |
| 2034 | cheap CPU's (like the Marvell Kirkwood mv6282 - ARMv5tel or Freescale QorIQ |
| 2035 | P1022 ppc - e500v2) not meant for workstations or development. These boxes |
| 2036 | should build now. The basic problems are the non-standard location for tools. |
| 2037 | |
| 2038 | =back |
| 2039 | |
| 2040 | =head2 Discontinued Platforms |
| 2041 | |
| 2042 | =over 4 |
| 2043 | |
| 2044 | =item C<sfio> |
| 2045 | |
| 2046 | Code related to supporting the C<sfio> I/O system has been removed. |
| 2047 | |
| 2048 | Perl 5.004 added support to use the native API of C<sfio>, AT&T's Safe/Fast |
| 2049 | I/O library. This code still built with v5.8.0, albeit with many regression |
| 2050 | tests failing, but was inadvertently broken before the v5.8.1 release, |
| 2051 | meaning that it has not worked on any version of Perl released since then. |
| 2052 | In over a decade we have received no bug reports about this, hence it is clear |
| 2053 | that no-one is using this functionality on any version of Perl that is still |
| 2054 | supported to any degree. |
| 2055 | |
| 2056 | =item AT&T 3b1 |
| 2057 | |
| 2058 | Configure support for the 3b1, also known as the AT&T Unix PC (and the similar |
| 2059 | AT&T 7300), has been removed. |
| 2060 | |
| 2061 | =item DG/UX |
| 2062 | |
| 2063 | DG/UX was a Unix sold by Data General. The last release was in April 2001. |
| 2064 | It only runs on Data General's own hardware. |
| 2065 | |
| 2066 | =item EBCDIC |
| 2067 | |
| 2068 | In the absence of a regular source of smoke reports, code intended to support |
| 2069 | native EBCDIC platforms will be removed from perl before 5.22.0. |
| 2070 | |
| 2071 | =back |
| 2072 | |
| 2073 | =head2 Platform-Specific Notes |
| 2074 | |
| 2075 | =over 4 |
| 2076 | |
| 2077 | =item Cygwin |
| 2078 | |
| 2079 | =over 4 |
| 2080 | |
| 2081 | =item * |
| 2082 | |
| 2083 | recv() on a connected handle would populate the returned sender |
| 2084 | address with whatever happened to be in the working buffer. recv() |
| 2085 | now uses a workaround similar to the Win32 recv() wrapper and returns |
| 2086 | an empty string when recvfrom(2) doesn't modify the supplied address |
| 2087 | length. [perl #118843] |
| 2088 | |
| 2089 | =item * |
| 2090 | |
| 2091 | Fixed a build error in cygwin.c on Cygwin 1.7.28. |
| 2092 | |
| 2093 | Tests now handle the errors that occur when C<cygserver> isn't |
| 2094 | running. |
| 2095 | |
| 2096 | =back |
| 2097 | |
| 2098 | =item GNU/Hurd |
| 2099 | |
| 2100 | The BSD compatibility library C<libbsd> is no longer required for builds. |
| 2101 | |
| 2102 | =item Linux |
| 2103 | |
| 2104 | The hints file now looks for C<libgdbm_compat> only if C<libgdbm> itself is |
| 2105 | also wanted. The former is never useful without the latter, and in some |
| 2106 | circumstances, including it could actually prevent building. |
| 2107 | |
| 2108 | =item Mac OS |
| 2109 | |
| 2110 | The build system now honors an C<ld> setting supplied by the user running |
| 2111 | F<Configure>. |
| 2112 | |
| 2113 | =item MidnightBSD |
| 2114 | |
| 2115 | C<objformat> was removed from version 0.4-RELEASE of MidnightBSD and had been |
| 2116 | deprecated on earlier versions. This caused the build environment to be |
| 2117 | erroneously configured for C<a.out> rather than C<elf>. This has been now |
| 2118 | been corrected. |
| 2119 | |
| 2120 | =item Mixed-endian platforms |
| 2121 | |
| 2122 | The code supporting C<pack> and C<unpack> operations on mixed endian |
| 2123 | platforms has been removed. We believe that Perl has long been unable to |
| 2124 | build on mixed endian architectures (such as PDP-11s), so we don't think |
| 2125 | that this change will affect any platforms which were able to build v5.18.0. |
| 2126 | |
| 2127 | =item VMS |
| 2128 | |
| 2129 | =over 4 |
| 2130 | |
| 2131 | =item * |
| 2132 | |
| 2133 | The C<PERL_ENV_TABLES> feature to control the population of %ENV at perl |
| 2134 | start-up was broken in Perl 5.16.0 but has now been fixed. |
| 2135 | |
| 2136 | =item * |
| 2137 | |
| 2138 | Skip access checks on remotes in opendir(). [perl #121002] |
| 2139 | |
| 2140 | =item * |
| 2141 | |
| 2142 | A check for glob metacharacters in a path returned by the |
| 2143 | L<C<glob()>|perlfunc/glob> operator has been replaced with a check for VMS |
| 2144 | wildcard characters. This saves a significant number of unnecessary |
| 2145 | L<C<lstat()>|perlfunc/lstat> calls such that some simple glob operations become |
| 2146 | 60-80% faster. |
| 2147 | |
| 2148 | =back |
| 2149 | |
| 2150 | =item Win32 |
| 2151 | |
| 2152 | =over 4 |
| 2153 | |
| 2154 | =item * |
| 2155 | |
| 2156 | C<rename> and C<link> on Win32 now set $! to ENOSPC and EDQUOT when |
| 2157 | appropriate. [perl #119857] |
| 2158 | |
| 2159 | =item * |
| 2160 | |
| 2161 | The BUILD_STATIC and ALL_STATIC makefile options for linking some or (nearly) |
| 2162 | all extensions statically (into perl520.dll, and into a separate |
| 2163 | perl-static.exe too) were broken for MinGW builds. This has now been fixed. |
| 2164 | |
| 2165 | The ALL_STATIC option has also been improved to include the Encode and Win32 |
| 2166 | extensions (for both VC++ and MinGW builds). |
| 2167 | |
| 2168 | =item * |
| 2169 | |
| 2170 | Support for building with Visual C++ 2013 has been added. There are currently |
| 2171 | two possible test failures (see L<perlwin32/"Testing Perl on Windows">) which |
| 2172 | will hopefully be resolved soon. |
| 2173 | |
| 2174 | =item * |
| 2175 | |
| 2176 | Experimental support for building with Intel C++ Compiler has been added. The |
| 2177 | nmake makefile (win32/Makefile) and the dmake makefile (win32/makefile.mk) can |
| 2178 | be used. A "nmake test" will not pass at this time due to F<cpan/CGI/t/url.t>. |
| 2179 | |
| 2180 | =item * |
| 2181 | |
| 2182 | Killing a process tree with L<perlfunc/kill> and a negative signal, was broken |
| 2183 | starting in 5.18.0. In this bug, C<kill> always returned 0 for a negative |
| 2184 | signal even for valid PIDs, and no processes were terminated. This has been |
| 2185 | fixed [perl #121230]. |
| 2186 | |
| 2187 | =item * |
| 2188 | |
| 2189 | The time taken to build perl on Windows has been reduced quite significantly |
| 2190 | (time savings in the region of 30-40% are typically seen) by reducing the |
| 2191 | number of, usually failing, I/O calls for each L<C<require()>|perlfunc/require> |
| 2192 | (for B<miniperl.exe> only). |
| 2193 | [L<perl #121119|https://rt.perl.org/Public/Bug/Display.html?id=121119>] |
| 2194 | |
| 2195 | =item * |
| 2196 | |
| 2197 | About 15 minutes of idle sleeping was removed from running C<make test> due to |
| 2198 | a bug in which the timeout monitor used for tests could not be cancelled once |
| 2199 | the test completes, and the full timeout period elapsed before running the next |
| 2200 | test file. |
| 2201 | [L<perl #121395|https://rt.perl.org/Public/Bug/Display.html?id=121395>] |
| 2202 | |
| 2203 | =item * |
| 2204 | |
| 2205 | On a perl built without pseudo-fork (pseudo-fork builds were not affected by |
| 2206 | this bug), killing a process tree with L<C<kill()>|perlfunc/kill> and a negative |
| 2207 | signal resulted in C<kill()> inverting the returned value. For example, if |
| 2208 | C<kill()> killed 1 process tree PID then it returned 0 instead of 1, and if |
| 2209 | C<kill()> was passed 2 invalid PIDs then it returned 2 instead of 0. This has |
| 2210 | probably been the case since the process tree kill feature was implemented on |
| 2211 | Win32. It has now been corrected to follow the documented behaviour. |
| 2212 | [L<perl #121230|https://rt.perl.org/Public/Bug/Display.html?id=121230>] |
| 2213 | |
| 2214 | =item * |
| 2215 | |
| 2216 | When building a 64-bit perl, an uninitialized memory read in B<miniperl.exe>, |
| 2217 | used during the build process, could lead to a 4GB B<wperl.exe> being created. |
| 2218 | This has now been fixed. (Note that B<perl.exe> itself was unaffected, but |
| 2219 | obviously B<wperl.exe> would have been completely broken.) |
| 2220 | [L<perl #121471|https://rt.perl.org/Public/Bug/Display.html?id=121471>] |
| 2221 | |
| 2222 | =item * |
| 2223 | |
| 2224 | Perl can now be built with B<gcc> version 4.8.1 from L<http://www.mingw.org>. |
| 2225 | This was previously broken due to an incorrect definition of DllMain() in one |
| 2226 | of perl's source files. Earlier B<gcc> versions were also affected when using |
| 2227 | version 4 of the w32api package. Versions of B<gcc> available from |
| 2228 | L<http://mingw-w64.sourceforge.net/> were not affected. |
| 2229 | [L<perl #121643|https://rt.perl.org/Public/Bug/Display.html?id=121643>] |
| 2230 | |
| 2231 | =item * |
| 2232 | |
| 2233 | The test harness now has no failures when perl is built on a FAT drive with the |
| 2234 | Windows OS on an NTFS drive. |
| 2235 | [L<perl #21442|https://rt.perl.org/Public/Bug/Display.html?id=21442>] |
| 2236 | |
| 2237 | =item * |
| 2238 | |
| 2239 | When cloning the context stack in fork() emulation, Perl_cx_dup() |
| 2240 | would crash accessing parameter information for context stack entries |
| 2241 | that included no parameters, as with C<&foo;>. |
| 2242 | [L<perl #121721|https://rt.perl.org/Public/Bug/Display.html?id=121721>] |
| 2243 | |
| 2244 | =item * |
| 2245 | |
| 2246 | Introduced by |
| 2247 | L<perl #113536|https://rt.perl.org/Public/Bug/Display.html?id=113536>, a memory |
| 2248 | leak on every call to C<system> and backticks (C< `` >), on most Win32 Perls |
| 2249 | starting from 5.18.0 has been fixed. The memory leak only occurred if you |
| 2250 | enabled psuedo-fork in your build of Win32 Perl, and were running that build on |
| 2251 | Server 2003 R2 or newer OS. The leak does not appear on WinXP SP3. |
| 2252 | [L<perl #121676|https://rt.perl.org/Public/Bug/Display.html?id=121676>] |
| 2253 | |
| 2254 | =back |
| 2255 | |
| 2256 | =item WinCE |
| 2257 | |
| 2258 | =over 4 |
| 2259 | |
| 2260 | =item * |
| 2261 | |
| 2262 | The building of XS modules has largely been restored. Several still cannot |
| 2263 | (yet) be built but it is now possible to build Perl on WinCE with only a couple |
| 2264 | of further patches (to L<Socket> and L<ExtUtils::MakeMaker>), hopefully to be |
| 2265 | incorporated soon. |
| 2266 | |
| 2267 | =item * |
| 2268 | |
| 2269 | Perl can now be built in one shot with no user intervention on WinCE by running |
| 2270 | C<nmake -f Makefile.ce all>. |
| 2271 | |
| 2272 | Support for building with EVC (Embedded Visual C++) 4 has been restored. Perl |
| 2273 | can also be built using Smart Devices for Visual C++ 2005 or 2008. |
| 2274 | |
| 2275 | =back |
| 2276 | |
| 2277 | =back |
| 2278 | |
| 2279 | =head1 Internal Changes |
| 2280 | |
| 2281 | =over 4 |
| 2282 | |
| 2283 | =item * |
| 2284 | |
| 2285 | The internal representation has changed for the match variables $1, $2 etc., |
| 2286 | $`, $&, $', ${^PREMATCH}, ${^MATCH} and ${^POSTMATCH}. It uses slightly less |
| 2287 | memory, avoids string comparisons and numeric conversions during lookup, and |
| 2288 | uses 23 fewer lines of C. This change should not affect any external code. |
| 2289 | |
| 2290 | =item * |
| 2291 | |
| 2292 | Arrays now use NULL internally to represent unused slots, instead of |
| 2293 | &PL_sv_undef. &PL_sv_undef is no longer treated as a special value, so |
| 2294 | av_store(av, 0, &PL_sv_undef) will cause element 0 of that array to hold a |
| 2295 | read-only undefined scalar. C<$array[0] = anything> will croak and |
| 2296 | C<\$array[0]> will compare equal to C<\undef>. |
| 2297 | |
| 2298 | =item * |
| 2299 | |
| 2300 | The SV returned by HeSVKEY_force() now correctly reflects the UTF8ness of the |
| 2301 | underlying hash key when that key is not stored as a SV. [perl #79074] |
| 2302 | |
| 2303 | =item * |
| 2304 | |
| 2305 | Certain rarely used functions and macros available to XS code are now |
| 2306 | deprecated. These are: |
| 2307 | C<utf8_to_uvuni_buf> (use C<utf8_to_uvchr_buf> instead), |
| 2308 | C<valid_utf8_to_uvuni> (use C<utf8_to_uvchr_buf> instead), |
| 2309 | C<NATIVE_TO_NEED> (this did not work properly anyway), |
| 2310 | and C<ASCII_TO_NEED> (this did not work properly anyway). |
| 2311 | |
| 2312 | Starting in this release, almost never does application code need to |
| 2313 | distinguish between the platform's character set and Latin1, on which the |
| 2314 | lowest 256 characters of Unicode are based. New code should not use |
| 2315 | C<utf8n_to_uvuni> (use C<utf8_to_uvchr_buf> instead), |
| 2316 | nor |
| 2317 | C<uvuni_to_utf8> (use C<uvchr_to_utf8> instead), |
| 2318 | |
| 2319 | =item * |
| 2320 | |
| 2321 | The Makefile shortcut targets for many rarely (or never) used testing and |
| 2322 | profiling targets have been removed, or merged into the only other Makefile |
| 2323 | target that uses them. Specifically, these targets are gone, along with |
| 2324 | documentation that referenced them or explained how to use them: |
| 2325 | |
| 2326 | check.third check.utf16 check.utf8 coretest minitest.prep |
| 2327 | minitest.utf16 perl.config.dashg perl.config.dashpg |
| 2328 | perl.config.gcov perl.gcov perl.gprof perl.gprof.config |
| 2329 | perl.pixie perl.pixie.atom perl.pixie.config perl.pixie.irix |
| 2330 | perl.third perl.third.config perl.valgrind.config purecovperl |
| 2331 | pureperl quantperl test.deparse test.taintwarn test.third |
| 2332 | test.torture test.utf16 test.utf8 test_notty.deparse |
| 2333 | test_notty.third test_notty.valgrind test_prep.third |
| 2334 | test_prep.valgrind torturetest ucheck ucheck.third ucheck.utf16 |
| 2335 | ucheck.valgrind utest utest.third utest.utf16 utest.valgrind |
| 2336 | |
| 2337 | It's still possible to run the relevant commands by "hand" - no underlying |
| 2338 | functionality has been removed. |
| 2339 | |
| 2340 | =item * |
| 2341 | |
| 2342 | It is now possible to keep Perl from initializing locale handling. |
| 2343 | For the most part, Perl doesn't pay attention to locale. (See |
| 2344 | L<perllocale>.) Nonetheless, until now, on startup, it has always |
| 2345 | initialized locale handling to the system default, just in case the |
| 2346 | program being executed ends up using locales. (This is one of the first |
| 2347 | things a locale-aware program should do, long before Perl knows if it |
| 2348 | will actually be needed or not.) This works well except when Perl is |
| 2349 | embedded in another application which wants a locale that isn't the |
| 2350 | system default. Now, if the environment variable |
| 2351 | C<PERL_SKIP_LOCALE_INIT> is set at the time Perl is started, this |
| 2352 | initialization step is skipped. Prior to this, on Windows platforms, |
| 2353 | the only workaround for this deficiency was to use a hacked-up copy of |
| 2354 | internal Perl code. Applications that need to use older Perls can |
| 2355 | discover if the embedded Perl they are using needs the workaround by |
| 2356 | testing that the C preprocessor symbol C<HAS_SKIP_LOCALE_INIT> is not |
| 2357 | defined. [RT #38193] |
| 2358 | |
| 2359 | =item * |
| 2360 | |
| 2361 | C<BmRARE> and C<BmPREVIOUS> have been removed. They were not used anywhere |
| 2362 | and are not part of the API. For XS modules, they are now #defined as 0. |
| 2363 | |
| 2364 | =item * |
| 2365 | |
| 2366 | C<sv_force_normal>, which usually croaks on read-only values, used to allow |
| 2367 | read-only values to be modified at compile time. This has been changed to |
| 2368 | croak on read-only values regardless. This change uncovered several core |
| 2369 | bugs. |
| 2370 | |
| 2371 | =item * |
| 2372 | |
| 2373 | Perl's new copy-on-write mechanism (which is now enabled by default), |
| 2374 | allows any C<SvPOK> scalar to be automatically upgraded to a copy-on-write |
| 2375 | scalar when copied. A reference count on the string buffer is stored in |
| 2376 | the string buffer itself. |
| 2377 | |
| 2378 | For example: |
| 2379 | |
| 2380 | $ perl -MDevel::Peek -e'$a="abc"; $b = $a; Dump $a; Dump $b' |
| 2381 | SV = PV(0x260cd80) at 0x2620ad8 |
| 2382 | REFCNT = 1 |
| 2383 | FLAGS = (POK,IsCOW,pPOK) |
| 2384 | PV = 0x2619bc0 "abc"\0 |
| 2385 | CUR = 3 |
| 2386 | LEN = 16 |
| 2387 | COW_REFCNT = 1 |
| 2388 | SV = PV(0x260ce30) at 0x2620b20 |
| 2389 | REFCNT = 1 |
| 2390 | FLAGS = (POK,IsCOW,pPOK) |
| 2391 | PV = 0x2619bc0 "abc"\0 |
| 2392 | CUR = 3 |
| 2393 | LEN = 16 |
| 2394 | COW_REFCNT = 1 |
| 2395 | |
| 2396 | Note that both scalars share the same PV buffer and have a COW_REFCNT |
| 2397 | greater than zero. |
| 2398 | |
| 2399 | This means that XS code which wishes to modify the C<SvPVX()> buffer of an |
| 2400 | SV should call C<SvPV_force()> or similar first, to ensure a valid (and |
| 2401 | unshared) buffer, and to call C<SvSETMAGIC()> afterwards. This in fact has |
| 2402 | always been the case (for example hash keys were already copy-on-write); |
| 2403 | this change just spreads the COW behaviour to a wider variety of SVs. |
| 2404 | |
| 2405 | One important difference is that before 5.18.0, shared hash-key scalars |
| 2406 | used to have the C<SvREADONLY> flag set; this is no longer the case. |
| 2407 | |
| 2408 | This new behaviour can still be disabled by running F<Configure> with |
| 2409 | B<-Accflags=-DPERL_NO_COW>. This option will probably be removed in Perl |
| 2410 | 5.22. |
| 2411 | |
| 2412 | =item * |
| 2413 | |
| 2414 | C<PL_sawampersand> is now a constant. The switch this variable provided |
| 2415 | (to enable/disable the pre-match copy depending on whether C<$&> had been |
| 2416 | seen) has been removed and replaced with copy-on-write, eliminating a few |
| 2417 | bugs. |
| 2418 | |
| 2419 | The previous behaviour can still be enabled by running F<Configure> with |
| 2420 | B<-Accflags=-DPERL_SAWAMPERSAND>. |
| 2421 | |
| 2422 | =item * |
| 2423 | |
| 2424 | The functions C<my_swap>, C<my_htonl> and C<my_ntohl> have been removed. |
| 2425 | It is unclear why these functions were ever marked as I<A>, part of the |
| 2426 | API. XS code can't call them directly, as it can't rely on them being |
| 2427 | compiled. Unsurprisingly, no code on CPAN references them. |
| 2428 | |
| 2429 | =item * |
| 2430 | |
| 2431 | The signature of the C<Perl_re_intuit_start()> regex function has changed; |
| 2432 | the function pointer C<intuit> in the regex engine plugin structure |
| 2433 | has also changed accordingly. A new parameter, C<strbeg> has been added; |
| 2434 | this has the same meaning as the same-named parameter in |
| 2435 | C<Perl_regexec_flags>. Previously intuit would try to guess the start of |
| 2436 | the string from the passed SV (if any), and would sometimes get it wrong |
| 2437 | (e.g. with an overloaded SV). |
| 2438 | |
| 2439 | =item * |
| 2440 | |
| 2441 | The signature of the C<Perl_regexec_flags()> regex function has |
| 2442 | changed; the function pointer C<exec> in the regex engine plugin |
| 2443 | structure has also changed to match. The C<minend> parameter now has |
| 2444 | type C<SSize_t> to better support 64-bit systems. |
| 2445 | |
| 2446 | =item * |
| 2447 | |
| 2448 | XS code may use various macros to change the case of a character or code |
| 2449 | point (for example C<toLOWER_utf8()>). Only a couple of these were |
| 2450 | documented until now; |
| 2451 | and now they should be used in preference to calling the underlying |
| 2452 | functions. See L<perlapi/Character case changing>. |
| 2453 | |
| 2454 | =item * |
| 2455 | |
| 2456 | The code dealt rather inconsistently with uids and gids. Some |
| 2457 | places assumed that they could be safely stored in UVs, others |
| 2458 | in IVs, others in ints. Four new macros are introduced: |
| 2459 | SvUID(), sv_setuid(), SvGID(), and sv_setgid() |
| 2460 | |
| 2461 | =item * |
| 2462 | |
| 2463 | C<sv_pos_b2u_flags> has been added to the API. It is similar to C<sv_pos_b2u>, |
| 2464 | but supports long strings on 64-bit platforms. |
| 2465 | |
| 2466 | =item * |
| 2467 | |
| 2468 | C<PL_exit_flags> can now be used by perl embedders or other XS code to have |
| 2469 | perl C<warn> or C<abort> on an attempted exit. [perl #52000] |
| 2470 | |
| 2471 | =item * |
| 2472 | |
| 2473 | Compiling with C<-Accflags=-PERL_BOOL_AS_CHAR> now allows C99 and C++ |
| 2474 | compilers to emulate the aliasing of C<bool> to C<char> that perl does for |
| 2475 | C89 compilers. [perl #120314] |
| 2476 | |
| 2477 | =item * |
| 2478 | |
| 2479 | The C<sv> argument in L<perlapi/sv_2pv_flags>, L<perlapi/sv_2iv_flags>, |
| 2480 | L<perlapi/sv_2uv_flags>, and L<perlapi/sv_2nv_flags> and their older wrappers |
| 2481 | sv_2pv, sv_2iv, sv_2uv, sv_2nv, is now non-NULL. Passing NULL now will crash. |
| 2482 | When the non-NULL marker was introduced en masse in 5.9.3 the functions |
| 2483 | were marked non-NULL, but since the creation of the SV API in 5.0 alpha 2, if |
| 2484 | NULL was passed, the functions returned 0 or false-type values. The code that |
| 2485 | supports C<sv> argument being non-NULL dates to 5.0 alpha 2 directly, and |
| 2486 | indirectly to Perl 1.0 (pre 5.0 api). The lack of documentation that the |
| 2487 | functions accepted a NULL C<sv> was corrected in 5.11.0 and between 5.11.0 |
| 2488 | and 5.19.5 the functions were marked NULLOK. As an optimization the NULLOK code |
| 2489 | has now been removed, and the functions became non-NULL marked again, because |
| 2490 | core getter-type macros never pass NULL to these functions and would crash |
| 2491 | before ever passing NULL. |
| 2492 | |
| 2493 | The only way a NULL C<sv> can be passed to sv_2*v* functions is if XS code |
| 2494 | directly calls sv_2*v*. This is unlikely as XS code uses Sv*V* macros to get |
| 2495 | the underlying value out of the SV. One possible situation which leads to |
| 2496 | a NULL C<sv> being passed to sv_2*v* functions, is if XS code defines its own |
| 2497 | getter type Sv*V* macros, which check for NULL B<before> dereferencing and |
| 2498 | checking the SV's flags through public API Sv*OK* macros or directly using |
| 2499 | private API C<SvFLAGS>, and if C<sv> is NULL, then calling the sv_2*v functions |
| 2500 | with a NULL litteral or passing the C<sv> containing a NULL value. |
| 2501 | |
| 2502 | =item * |
| 2503 | |
| 2504 | newATTRSUB is now a macro |
| 2505 | |
| 2506 | The public API newATTRSUB was previously a macro to the private |
| 2507 | function Perl_newATTRSUB. Function Perl_newATTRSUB has been removed. newATTRSUB |
| 2508 | is now macro to a different internal function. |
| 2509 | |
| 2510 | =item * |
| 2511 | |
| 2512 | Changes in warnings raised by C<utf8n_to_uvchr()> |
| 2513 | |
| 2514 | This bottom level function decodes the first character of a UTF-8 string |
| 2515 | into a code point. It is accessible to C<XS> level code, but it's |
| 2516 | discouraged from using it directly. There are higher level functions |
| 2517 | that call this that should be used instead, such as |
| 2518 | L<perlapi/utf8_to_uvchr_buf>. For completeness though, this documents |
| 2519 | some changes to it. Now, tests for malformations are done before any |
| 2520 | tests for other potential issues. One of those issues involves code |
| 2521 | points so large that they have never appeared in any official standard |
| 2522 | (the current standard has scaled back the highest acceptable code point |
| 2523 | from earlier versions). It is possible (though not done in CPAN) to |
| 2524 | warn and/or forbid these code points, while accepting smaller code |
| 2525 | points that are still above the legal Unicode maximum. The warning |
| 2526 | message for this now includes the code point if representable on the |
| 2527 | machine. Previously it always displayed raw bytes, which is what it |
| 2528 | still does for non-representable code points. |
| 2529 | |
| 2530 | =item * |
| 2531 | |
| 2532 | Regexp engine changes that affect the pluggable regex engine interface |
| 2533 | |
| 2534 | Many flags that used to be exposed via regexp.h and used to populate the |
| 2535 | extflags member of struct regexp have been removed. These fields were |
| 2536 | technically private to Perl's own regexp engine and should not have been |
| 2537 | exposed there in the first place. |
| 2538 | |
| 2539 | The affected flags are: |
| 2540 | |
| 2541 | RXf_NOSCAN |
| 2542 | RXf_CANY_SEEN |
| 2543 | RXf_GPOS_SEEN |
| 2544 | RXf_GPOS_FLOAT |
| 2545 | RXf_ANCH_BOL |
| 2546 | RXf_ANCH_MBOL |
| 2547 | RXf_ANCH_SBOL |
| 2548 | RXf_ANCH_GPOS |
| 2549 | |
| 2550 | As well as the follow flag masks: |
| 2551 | |
| 2552 | RXf_ANCH_SINGLE |
| 2553 | RXf_ANCH |
| 2554 | |
| 2555 | All have been renamed to PREGf_ equivalents and moved to regcomp.h. |
| 2556 | |
| 2557 | The behavior previously achieved by setting one or more of the RXf_ANCH_ |
| 2558 | flags (via the RXf_ANCH mask) have now been replaced by a *single* flag bit |
| 2559 | in extflags: |
| 2560 | |
| 2561 | RXf_IS_ANCHORED |
| 2562 | |
| 2563 | pluggable regex engines which previously used to set these flags should |
| 2564 | now set this flag ALONE. |
| 2565 | |
| 2566 | =item * |
| 2567 | |
| 2568 | The Perl core now consistently uses C<av_tindex()> ("the top index of an |
| 2569 | array") as a more clearly-named synonym for C<av_len()>. |
| 2570 | |
| 2571 | =item * |
| 2572 | |
| 2573 | The obscure interpreter variable C<PL_timesbuf> is expected to be removed |
| 2574 | early in the 5.21.x development series, so that Perl 5.22.0 will not provide |
| 2575 | it to XS authors. While the variable still exists in 5.20.0, we hope that |
| 2576 | this advance warning of the deprecation will help anyone who is using that |
| 2577 | variable. |
| 2578 | |
| 2579 | =back |
| 2580 | |
| 2581 | =head1 Selected Bug Fixes |
| 2582 | |
| 2583 | =head2 Regular Expressions |
| 2584 | |
| 2585 | =over 4 |
| 2586 | |
| 2587 | =item * |
| 2588 | |
| 2589 | Fixed a small number of regexp constructions that could either fail to |
| 2590 | match or crash perl when the string being matched against was |
| 2591 | allocated above the 2GB line on 32-bit systems. [RT #118175] |
| 2592 | |
| 2593 | =item * |
| 2594 | |
| 2595 | Various memory leaks involving the parsing of the C<(?[...])> regular |
| 2596 | expression construct have been fixed. |
| 2597 | |
| 2598 | =item * |
| 2599 | |
| 2600 | C<(?[...])> now allows interpolation of precompiled patterns consisting of |
| 2601 | C<(?[...])> with bracketed character classes inside (C<$pat = |
| 2602 | S<qr/(?[ [a] ])/;> S</(?[ $pat ])/>>). Formerly, the brackets would |
| 2603 | confuse the regular expression parser. |
| 2604 | |
| 2605 | =item * |
| 2606 | |
| 2607 | The "Quantifier unexpected on zero-length expression" warning message could |
| 2608 | appear twice starting in Perl v5.10 for a regular expression also |
| 2609 | containing alternations (e.g., "a|b") triggering the trie optimisation. |
| 2610 | |
| 2611 | =item * |
| 2612 | |
| 2613 | Perl v5.18 inadvertently introduced a bug whereby interpolating mixed up- |
| 2614 | and down-graded UTF-8 strings in a regex could result in malformed UTF-8 |
| 2615 | in the pattern: specifically if a downgraded character in the range |
| 2616 | C<\x80..\xff> followed a UTF-8 string, e.g. |
| 2617 | |
| 2618 | utf8::upgrade( my $u = "\x{e5}"); |
| 2619 | utf8::downgrade(my $d = "\x{e5}"); |
| 2620 | /$u$d/ |
| 2621 | |
| 2622 | [RT #118297] |
| 2623 | |
| 2624 | =item * |
| 2625 | |
| 2626 | In regular expressions containing multiple code blocks, the values of |
| 2627 | C<$1>, C<$2>, etc., set by nested regular expression calls would leak from |
| 2628 | one block to the next. Now these variables always refer to the outer |
| 2629 | regular expression at the start of an embedded block [perl #117917]. |
| 2630 | |
| 2631 | =item * |
| 2632 | |
| 2633 | C</$qr/p> was broken in Perl 5.18.0; the C</p> flag was ignored. This has been |
| 2634 | fixed. [perl #118213] |
| 2635 | |
| 2636 | =item * |
| 2637 | |
| 2638 | Starting in Perl 5.18.0, a construct like C</[#](?{})/x> would have its C<#> |
| 2639 | incorrectly interpreted as a comment. The code block would be skipped, |
| 2640 | unparsed. This has been corrected. |
| 2641 | |
| 2642 | =item * |
| 2643 | |
| 2644 | Starting in Perl 5.001, a regular expression like C</[#$a]/x> or C</[#]$a/x> |
| 2645 | would have its C<#> incorrectly interpreted as a comment, so the variable would |
| 2646 | not interpolate. This has been corrected. [perl #45667] |
| 2647 | |
| 2648 | =item * |
| 2649 | |
| 2650 | Perl 5.18.0 inadvertently made dereferenced regular expressions |
| 2651 | S<(C<${ qr// }>)> false as booleans. This has been fixed. |
| 2652 | |
| 2653 | =item * |
| 2654 | |
| 2655 | The use of C<\G> in regular expressions, where it's not at the start of the |
| 2656 | pattern, is now slightly less buggy (although it is still somewhat |
| 2657 | problematic). |
| 2658 | |
| 2659 | =item * |
| 2660 | |
| 2661 | Where a regular expression included code blocks (C</(?{...})/>), and where the |
| 2662 | use of constant overloading triggered a re-compilation of the code block, the |
| 2663 | second compilation didn't see its outer lexical scope. This was a regression |
| 2664 | in Perl 5.18.0. |
| 2665 | |
| 2666 | =item * |
| 2667 | |
| 2668 | The string position set by C<pos> could shift if the string changed |
| 2669 | representation internally to or from utf8. This could happen, e.g., with |
| 2670 | references to objects with string overloading. |
| 2671 | |
| 2672 | =item * |
| 2673 | |
| 2674 | Taking references to the return values of two C<pos> calls with the same |
| 2675 | argument, and then assigning a reference to one and C<undef> to the other, |
| 2676 | could result in assertion failures or memory leaks. |
| 2677 | |
| 2678 | =item * |
| 2679 | |
| 2680 | Elements of @- and @+ now update correctly when they refer to non-existent |
| 2681 | captures. Previously, a referenced element (C<$ref = \$-[1]>) could refer to |
| 2682 | the wrong match after subsequent matches. |
| 2683 | |
| 2684 | =item * |
| 2685 | |
| 2686 | The code that parses regex backrefs (or ambiguous backref/octals) such as \123 |
| 2687 | did a simple atoi(), which could wrap round to negative values on long digit |
| 2688 | strings and cause segmentation faults. This has now been fixed. [perl |
| 2689 | #119505] |
| 2690 | |
| 2691 | =item * |
| 2692 | |
| 2693 | Assigning another typeglob to C<*^R> no longer makes the regular expression |
| 2694 | engine crash. |
| 2695 | |
| 2696 | =item * |
| 2697 | |
| 2698 | The C<\N> regular expression escape, when used without the curly braces (to |
| 2699 | mean C<[^\n]>), was ignoring a following C<*> if followed by whitespace |
| 2700 | under /x. It had been this way since C<\N> to mean C<[^\n]> was introduced |
| 2701 | in 5.12.0. |
| 2702 | |
| 2703 | =item * |
| 2704 | |
| 2705 | C<s///>, C<tr///> and C<y///> now work when a wide character is used as the |
| 2706 | delimiter. [perl #120463] |
| 2707 | |
| 2708 | =item * |
| 2709 | |
| 2710 | Some cases of unterminated (?...) sequences in regular expressions (e.g., |
| 2711 | C</(?</>) have been fixed to produce the proper error message instead of |
| 2712 | "panic: memory wrap". Other cases (e.g., C</(?(/>) have yet to be fixed. |
| 2713 | |
| 2714 | =item * |
| 2715 | |
| 2716 | When a reference to a reference to an overloaded object was returned from |
| 2717 | a regular expression C<(??{...})> code block, an incorrect implicit |
| 2718 | dereference could take place if the inner reference had been returned by |
| 2719 | a code block previously. |
| 2720 | |
| 2721 | =item * |
| 2722 | |
| 2723 | A tied variable returned from C<(??{...})> sees the inner values of match |
| 2724 | variables (i.e., the $1 etc. from any matches inside the block) in its |
| 2725 | FETCH method. This was not the case if a reference to an overloaded object |
| 2726 | was the last thing assigned to the tied variable. Instead, the match |
| 2727 | variables referred to the outer pattern during the FETCH call. |
| 2728 | |
| 2729 | =item * |
| 2730 | |
| 2731 | Fix unexpected tainting via regexp using locale. Previously, under certain |
| 2732 | conditions, the use of character classes could cause tainting when it |
| 2733 | shouldn't. Some character classes are locale-dependent, but before this |
| 2734 | patch, sometimes tainting was happening even for character classes that |
| 2735 | don't depend on the locale. [perl #120675] |
| 2736 | |
| 2737 | =item * |
| 2738 | |
| 2739 | Under certain conditions, Perl would throw an error if in an lookbehind |
| 2740 | assertion in a regexp, the assertion referred to a named subpattern, |
| 2741 | complaining the lookbehind was variable when it wasn't. This has been |
| 2742 | fixed. [perl #120600], [perl #120618]. The current fix may be improved |
| 2743 | on in the future. |
| 2744 | |
| 2745 | =item * |
| 2746 | |
| 2747 | C<$^R> wasn't available outside of the regular expression that |
| 2748 | initialized it. [perl #121070] |
| 2749 | |
| 2750 | =item * |
| 2751 | |
| 2752 | A large set of fixes and refactoring for re_intuit_start() was merged, |
| 2753 | the highlights are: |
| 2754 | |
| 2755 | =over |
| 2756 | |
| 2757 | =item * |
| 2758 | |
| 2759 | Fixed a panic when compiling the regular expression |
| 2760 | C</\x{100}[xy]\x{100}{2}/>. |
| 2761 | |
| 2762 | =item * |
| 2763 | |
| 2764 | Fixed a performance regression when performing a global pattern match |
| 2765 | against a UTF-8 string. [perl #120692] |
| 2766 | |
| 2767 | =item * |
| 2768 | |
| 2769 | Fixed another performance issue where matching a regular expression |
| 2770 | like C</ab.{1,2}x/> against a long UTF-8 string would unnecessarily |
| 2771 | calculate byte offsets for a large portion of the string. [perl |
| 2772 | #120692] |
| 2773 | |
| 2774 | =back |
| 2775 | |
| 2776 | =item * |
| 2777 | |
| 2778 | Fixed an alignment error when compiling regular expressions when built |
| 2779 | with GCC on HP-UX 64-bit. |
| 2780 | |
| 2781 | =item * |
| 2782 | |
| 2783 | On 64-bit platforms C<pos> can now be set to a value higher than 2**31-1. |
| 2784 | [perl #72766] |
| 2785 | |
| 2786 | =back |
| 2787 | |
| 2788 | =head2 Perl 5 Debugger and -d |
| 2789 | |
| 2790 | =over 4 |
| 2791 | |
| 2792 | =item * |
| 2793 | |
| 2794 | The debugger's C<man> command been fixed. It was broken in the v5.18.0 |
| 2795 | release. The C<man> command is aliased to the names C<doc> and C<perldoc> - |
| 2796 | all now work again. |
| 2797 | |
| 2798 | =item * |
| 2799 | |
| 2800 | C<@_> is now correctly visible in the debugger, fixing a regression |
| 2801 | introduced in v5.18.0's debugger. [RT #118169] |
| 2802 | |
| 2803 | =item * |
| 2804 | |
| 2805 | Under copy-on-write builds (the default as of 5.20.0) C<< ${'_<-e'}[0] >> |
| 2806 | no longer gets mangled. This is the first line of input saved for the |
| 2807 | debugger's use for one-liners [perl #118627]. |
| 2808 | |
| 2809 | =item * |
| 2810 | |
| 2811 | On non-threaded builds, setting C<${"_E<lt>filename"}> to a reference or |
| 2812 | typeglob no longer causes C<__FILE__> and some error messages to produce a |
| 2813 | corrupt string, and no longer prevents C<#line> directives in string evals from |
| 2814 | providing the source lines to the debugger. Threaded builds were unaffected. |
| 2815 | |
| 2816 | =item * |
| 2817 | |
| 2818 | Starting with Perl 5.12, line numbers were off by one if the B<-d> switch was |
| 2819 | used on the #! line. Now they are correct. |
| 2820 | |
| 2821 | =item * |
| 2822 | |
| 2823 | C<*DB::DB = sub {} if 0> no longer stops Perl's debugging mode from finding |
| 2824 | C<DB::DB> subs declared thereafter. |
| 2825 | |
| 2826 | =item * |
| 2827 | |
| 2828 | C<%{'_<...'}> hashes now set breakpoints on the corresponding C<@{'_<...'}> |
| 2829 | rather than whichever array C<@DB::dbline> is aliased to. [perl #119799] |
| 2830 | |
| 2831 | =item * |
| 2832 | |
| 2833 | Call set-magic when setting $DB::sub. [perl #121255] |
| 2834 | |
| 2835 | =item * |
| 2836 | |
| 2837 | The debugger's "n" command now respects lvalue subroutines and steps over |
| 2838 | them [perl #118839]. |
| 2839 | |
| 2840 | =back |
| 2841 | |
| 2842 | =head2 Lexical Subroutines |
| 2843 | |
| 2844 | =over 4 |
| 2845 | |
| 2846 | =item * |
| 2847 | |
| 2848 | Lexical constants (C<my sub a() { 42 }>) no longer crash when inlined. |
| 2849 | |
| 2850 | =item * |
| 2851 | |
| 2852 | Parameter prototypes attached to lexical subroutines are now respected when |
| 2853 | compiling sub calls without parentheses. Previously, the prototypes were |
| 2854 | honoured only for calls I<with> parentheses. [RT #116735] |
| 2855 | |
| 2856 | =item * |
| 2857 | |
| 2858 | Syntax errors in lexical subroutines in combination with calls to the same |
| 2859 | subroutines no longer cause crashes at compile time. |
| 2860 | |
| 2861 | =item * |
| 2862 | |
| 2863 | Deep recursion warnings no longer crash lexical subroutines. [RT #118521] |
| 2864 | |
| 2865 | =item * |
| 2866 | |
| 2867 | The dtrace sub-entry probe now works with lexical subs, instead of |
| 2868 | crashing [perl #118305]. |
| 2869 | |
| 2870 | =item * |
| 2871 | |
| 2872 | Undefining an inlinable lexical subroutine (C<my sub foo() { 42 } undef |
| 2873 | &foo>) would result in a crash if warnings were turned on. |
| 2874 | |
| 2875 | =item * |
| 2876 | |
| 2877 | An undefined lexical sub used as an inherited method no longer crashes. |
| 2878 | |
| 2879 | =item * |
| 2880 | |
| 2881 | The presence of a lexical sub named "CORE" no longer stops the CORE:: |
| 2882 | prefix from working. |
| 2883 | |
| 2884 | =back |
| 2885 | |
| 2886 | =head2 Everything Else |
| 2887 | |
| 2888 | =over 4 |
| 2889 | |
| 2890 | =item * |
| 2891 | |
| 2892 | The OP allocation code now returns correctly aligned memory in all cases |
| 2893 | for C<struct pmop>. Previously it could return memory only aligned to a |
| 2894 | 4-byte boundary, which is not correct for an ithreads build with 64 bit IVs |
| 2895 | on some 32 bit platforms. Notably, this caused the build to fail completely |
| 2896 | on sparc GNU/Linux. [RT #118055] |
| 2897 | |
| 2898 | =item * |
| 2899 | |
| 2900 | Evaluating large hashes in scalar context is now much faster, as the number |
| 2901 | of used chains in the hash is now cached for larger hashes. Smaller hashes |
| 2902 | continue not to store it and calculate it when needed, as this saves one IV. |
| 2903 | That would be 1 IV overhead for every object built from a hash. [RT #114576] |
| 2904 | |
| 2905 | =item * |
| 2906 | |
| 2907 | Perl v5.16 inadvertently introduced a bug whereby calls to XSUBs that were |
| 2908 | not visible at compile time were treated as lvalues and could be assigned |
| 2909 | to, even when the subroutine was not an lvalue sub. This has been fixed. |
| 2910 | [RT #117947] |
| 2911 | |
| 2912 | =item * |
| 2913 | |
| 2914 | In Perl v5.18.0 dualvars that had an empty string for the string part but a |
| 2915 | non-zero number for the number part starting being treated as true. In |
| 2916 | previous versions they were treated as false, the string representation |
| 2917 | taking precedeence. The old behaviour has been restored. [RT #118159] |
| 2918 | |
| 2919 | =item * |
| 2920 | |
| 2921 | Since Perl v5.12, inlining of constants that override built-in keywords of |
| 2922 | the same name had countermanded C<use subs>, causing subsequent mentions of |
| 2923 | the constant to use the built-in keyword instead. This has been fixed. |
| 2924 | |
| 2925 | =item * |
| 2926 | |
| 2927 | The warning produced by C<-l $handle> now applies to IO refs and globs, not |
| 2928 | just to glob refs. That warning is also now UTF8-clean. [RT #117595] |
| 2929 | |
| 2930 | =item * |
| 2931 | |
| 2932 | C<delete local $ENV{nonexistent_env_var}> no longer leaks memory. |
| 2933 | |
| 2934 | =item * |
| 2935 | |
| 2936 | C<sort> and C<require> followed by a keyword prefixed with C<CORE::> now |
| 2937 | treat it as a keyword, and not as a subroutine or module name. [RT #24482] |
| 2938 | |
| 2939 | =item * |
| 2940 | |
| 2941 | Through certain conundrums, it is possible to cause the current package to |
| 2942 | be freed. Certain operators (C<bless>, C<reset>, C<open>, C<eval>) could |
| 2943 | not cope and would crash. They have been made more resilient. [RT #117941] |
| 2944 | |
| 2945 | =item * |
| 2946 | |
| 2947 | Aliasing filehandles through glob-to-glob assignment would not update |
| 2948 | internal method caches properly if a package of the same name as the |
| 2949 | filehandle existed, resulting in filehandle method calls going to the |
| 2950 | package instead. This has been fixed. |
| 2951 | |
| 2952 | =item * |
| 2953 | |
| 2954 | C<./Configure -de -Dusevendorprefix> didn't default. [RT #64126] |
| 2955 | |
| 2956 | =item * |
| 2957 | |
| 2958 | The C<Statement unlikely to be reached> warning was listed in |
| 2959 | L<perldiag> as an C<exec>-category warning, but was enabled and disabled |
| 2960 | by the C<syntax> category. On the other hand, the C<exec> category |
| 2961 | controlled its fatal-ness. It is now entirely handled by the C<exec> |
| 2962 | category. |
| 2963 | |
| 2964 | =item * |
| 2965 | |
| 2966 | The "Replacement list is longer that search list" warning for C<tr///> and |
| 2967 | C<y///> no longer occurs in the presence of the C</c> flag. [RT #118047] |
| 2968 | |
| 2969 | =item * |
| 2970 | |
| 2971 | Stringification of NVs are not cached so that the lexical locale controls |
| 2972 | stringification of the decimal point. [perl #108378] [perl #115800] |
| 2973 | |
| 2974 | =item * |
| 2975 | |
| 2976 | There have been several fixes related to Perl's handling of locales. perl |
| 2977 | #38193 was described above in L</Internal Changes>. |
| 2978 | Also fixed is |
| 2979 | #118197, where the radix (decimal point) character had to be an ASCII |
| 2980 | character (which doesn't work for some non-Western languages); |
| 2981 | and #115808, in which C<POSIX::setlocale()> on failure returned an |
| 2982 | C<undef> which didn't warn about not being defined even if those |
| 2983 | warnings were enabled. |
| 2984 | |
| 2985 | =item * |
| 2986 | |
| 2987 | Compiling a C<split> operator whose third argument is a named constant |
| 2988 | evaluating to 0 no longer causes the constant's value to change. |
| 2989 | |
| 2990 | =item * |
| 2991 | |
| 2992 | A named constant used as the second argument to C<index> no longer gets |
| 2993 | coerced to a string if it is a reference, regular expression, dualvar, etc. |
| 2994 | |
| 2995 | =item * |
| 2996 | |
| 2997 | A named constant evaluating to the undefined value used as the second |
| 2998 | argument to C<index> no longer produces "uninitialized" warnings at compile |
| 2999 | time. It will still produce them at run time. |
| 3000 | |
| 3001 | =item * |
| 3002 | |
| 3003 | When a scalar was returned from a subroutine in @INC, the referenced scalar |
| 3004 | was magically converted into an IO thingy, possibly resulting in "Bizarre |
| 3005 | copy" errors if that scalar continued to be used elsewhere. Now Perl uses |
| 3006 | an internal copy of the scalar instead. |
| 3007 | |
| 3008 | =item * |
| 3009 | |
| 3010 | Certain uses of the C<sort> operator are optimised to modify an array in |
| 3011 | place, such as C<@a = sort @a>. During the sorting, the array is made |
| 3012 | read-only. If a sort block should happen to die, then the array remained |
| 3013 | read-only even outside the C<sort>. This has been fixed. |
| 3014 | |
| 3015 | =item * |
| 3016 | |
| 3017 | C<$a> and C<$b> inside a sort block are aliased to the actual arguments to |
| 3018 | C<sort>, so they can be modified through those two variables. This did not |
| 3019 | always work, e.g., for lvalue subs and C<$#ary>, and probably many other |
| 3020 | operators. It works now. |
| 3021 | |
| 3022 | =item * |
| 3023 | |
| 3024 | The arguments to C<sort> are now all in list context. If the C<sort> |
| 3025 | itself were called in void or scalar context, then I<some>, but not all, of |
| 3026 | the arguments used to be in void or scalar context. |
| 3027 | |
| 3028 | =item * |
| 3029 | |
| 3030 | Subroutine prototypes with Unicode characters above U+00FF were getting |
| 3031 | mangled during closure cloning. This would happen with subroutines closing |
| 3032 | over lexical variables declared outside, and with lexical subs. |
| 3033 | |
| 3034 | =item * |
| 3035 | |
| 3036 | C<UNIVERSAL::can> now treats its first argument the same way that method |
| 3037 | calls do: Typeglobs and glob references with non-empty IO slots are treated |
| 3038 | as handles, and strings are treated as filehandles, rather than packages, |
| 3039 | if a handle with that name exists [perl #113932]. |
| 3040 | |
| 3041 | =item * |
| 3042 | |
| 3043 | Method calls on typeglobs (e.g., C<< *ARGV->getline >>) used to stringify |
| 3044 | the typeglob and then look it up again. Combined with changes in Perl |
| 3045 | 5.18.0, this allowed C<< *foo->bar >> to call methods on the "foo" package |
| 3046 | (like C<< foo->bar >>). In some cases it could cause the method to be |
| 3047 | called on the wrong handle. Now a typeglob argument is treated as a |
| 3048 | handle (just like C<< (\*foo)->bar >>), or, if its IO slot is empty, an |
| 3049 | error is raised. |
| 3050 | |
| 3051 | =item * |
| 3052 | |
| 3053 | Assigning a vstring to a tied variable or to a subroutine argument aliased |
| 3054 | to a nonexistent hash or array element now works, without flattening the |
| 3055 | vstring into a regular string. |
| 3056 | |
| 3057 | =item * |
| 3058 | |
| 3059 | C<pos>, C<tie>, C<tied> and C<untie> did not work |
| 3060 | properly on subroutine arguments aliased to nonexistent |
| 3061 | hash and array elements [perl #77814, #27010]. |
| 3062 | |
| 3063 | =item * |
| 3064 | |
| 3065 | The C<< => >> fat arrow operator can now quote built-in keywords even if it |
| 3066 | occurs on the next line, making it consistent with how it treats other |
| 3067 | barewords. |
| 3068 | |
| 3069 | =item * |
| 3070 | |
| 3071 | Autovivifying a subroutine stub via C<\&$glob> started causing crashes in Perl |
| 3072 | 5.18.0 if the $glob was merely a copy of a real glob, i.e., a scalar that had |
| 3073 | had a glob assigned to it. This has been fixed. [perl #119051] |
| 3074 | |
| 3075 | =item * |
| 3076 | |
| 3077 | Perl used to leak an implementation detail when it came to referencing the |
| 3078 | return values of certain operators. C<for ($a+$b) { warn \$_; warn \$_ }> used |
| 3079 | to display two different memory addresses, because the C<\> operator was |
| 3080 | copying the variable. Under threaded builds, it would also happen for |
| 3081 | constants (C<for(1) { ... }>). This has been fixed. [perl #21979, #78194, |
| 3082 | #89188, #109746, #114838, #115388] |
| 3083 | |
| 3084 | =item * |
| 3085 | |
| 3086 | The range operator C<..> was returning the same modifiable scalars with each |
| 3087 | call, unless it was the only thing in a C<foreach> loop header. This meant |
| 3088 | that changes to values within the list returned would be visible the next time |
| 3089 | the operator was executed. [perl #3105] |
| 3090 | |
| 3091 | =item * |
| 3092 | |
| 3093 | Constant folding and subroutine inlining no longer cause operations that would |
| 3094 | normally return new modifiable scalars to return read-only values instead. |
| 3095 | |
| 3096 | =item * |
| 3097 | |
| 3098 | Closures of the form C<sub () { $some_variable }> are no longer inlined, |
| 3099 | causing changes to the variable to be ignored by callers of the subroutine. |
| 3100 | [perl #79908] |
| 3101 | |
| 3102 | =item * |
| 3103 | |
| 3104 | Return values of certain operators such as C<ref> would sometimes be shared |
| 3105 | between recursive calls to the same subroutine, causing the inner call to |
| 3106 | modify the value returned by C<ref> in the outer call. This has been fixed. |
| 3107 | |
| 3108 | =item * |
| 3109 | |
| 3110 | C<__PACKAGE__> and constants returning a package name or hash key are now |
| 3111 | consistently read-only. In various previous Perl releases, they have become |
| 3112 | mutable under certain circumstances. |
| 3113 | |
| 3114 | =item * |
| 3115 | |
| 3116 | Enabling "used once" warnings no longer causes crashes on stash circularities |
| 3117 | created at compile time (C<*Foo::Bar::Foo:: = *Foo::>). |
| 3118 | |
| 3119 | =item * |
| 3120 | |
| 3121 | Undef constants used in hash keys (C<use constant u =E<gt> undef; $h{+u}>) no |
| 3122 | longer produce "uninitialized" warnings at compile time. |
| 3123 | |
| 3124 | =item * |
| 3125 | |
| 3126 | Modifying a substitution target inside the substitution replacement no longer |
| 3127 | causes crashes. |
| 3128 | |
| 3129 | =item * |
| 3130 | |
| 3131 | The first statement inside a string eval used to use the wrong pragma setting |
| 3132 | sometimes during constant folding. C<eval 'uc chr 0xe0'> would randomly choose |
| 3133 | between Unicode, byte, and locale semantics. This has been fixed. |
| 3134 | |
| 3135 | =item * |
| 3136 | |
| 3137 | The handling of return values of @INC filters (subroutines returned by |
| 3138 | subroutines in @INC) has been fixed in various ways. Previously tied variables |
| 3139 | were mishandled, and setting $_ to a reference or typeglob could result in |
| 3140 | crashes. |
| 3141 | |
| 3142 | =item * |
| 3143 | |
| 3144 | The C<SvPVbyte> XS function has been fixed to work with tied scalars returning |
| 3145 | something other than a string. It used to return utf8 in those cases where |
| 3146 | C<SvPV> would. |
| 3147 | |
| 3148 | =item * |
| 3149 | |
| 3150 | Perl 5.18.0 inadvertently made C<--> and C<++> crash on dereferenced regular |
| 3151 | expressions, and stopped C<++> from flattening vstrings. |
| 3152 | |
| 3153 | =item * |
| 3154 | |
| 3155 | C<bless> no longer dies with "Can't bless non-reference value" if its first |
| 3156 | argument is a tied reference. |
| 3157 | |
| 3158 | =item * |
| 3159 | |
| 3160 | C<reset> with an argument no longer skips copy-on-write scalars, regular |
| 3161 | expressions, typeglob copies, and vstrings. Also, when encountering those or |
| 3162 | read-only values, it no longer skips any array or hash with the same name. |
| 3163 | |
| 3164 | =item * |
| 3165 | |
| 3166 | C<reset> with an argument now skips scalars aliased to typeglobs |
| 3167 | (C<for $z (*foo) { reset "z" }>). Previously it would corrupt memory or crash. |
| 3168 | |
| 3169 | =item * |
| 3170 | |
| 3171 | C<ucfirst> and C<lcfirst> were not respecting the bytes pragma. This was a |
| 3172 | regression from Perl 5.12. [perl #117355] |
| 3173 | |
| 3174 | =item * |
| 3175 | |
| 3176 | Changes to C<UNIVERSAL::DESTROY> now update DESTROY caches in all classes, |
| 3177 | instead of causing classes that have already had objects destroyed to continue |
| 3178 | using the old sub. This was a regression in Perl 5.18. [perl #114864] |
| 3179 | |
| 3180 | =item * |
| 3181 | |
| 3182 | All known false-positive occurrences of the deprecation warning "Useless use of |
| 3183 | '\'; doesn't escape metacharacter '%c'", added in Perl 5.18.0, have been |
| 3184 | removed. [perl #119101] |
| 3185 | |
| 3186 | =item * |
| 3187 | |
| 3188 | The value of $^E is now saved across signal handlers on Windows. [perl #85104] |
| 3189 | |
| 3190 | =item * |
| 3191 | |
| 3192 | A lexical filehandle (as in C<open my $fh...>) is usually given a name based on |
| 3193 | the current package and the name of the variable, e.g. "main::$fh". Under |
| 3194 | recursion, the filehandle was losing the "$fh" part of the name. This has been |
| 3195 | fixed. |
| 3196 | |
| 3197 | =item * |
| 3198 | |
| 3199 | Uninitialized values returned by XSUBs are no longer exempt from uninitialized |
| 3200 | warnings. [perl #118693] |
| 3201 | |
| 3202 | =item * |
| 3203 | |
| 3204 | C<elsif ("")> no longer erroneously produces a warning about void context. |
| 3205 | [perl #118753] |
| 3206 | |
| 3207 | =item * |
| 3208 | |
| 3209 | Passing C<undef> to a subroutine now causes @_ to contain the same read-only |
| 3210 | undefined scalar that C<undef> returns. Furthermore, C<exists $_[0]> will now |
| 3211 | return true if C<undef> was the first argument. [perl #7508, #109726] |
| 3212 | |
| 3213 | =item * |
| 3214 | |
| 3215 | Passing a non-existent array element to a subroutine does not usually |
| 3216 | autovivify it unless the subroutine modifies its argument. This did not work |
| 3217 | correctly with negative indices and with non-existent elements within the |
| 3218 | array. The element would be vivified immediately. The delayed vivification |
| 3219 | has been extended to work with those. [perl #118691] |
| 3220 | |
| 3221 | =item * |
| 3222 | |
| 3223 | Assigning references or globs to the scalar returned by $#foo after the @foo |
| 3224 | array has been freed no longer causes assertion failures on debugging builds |
| 3225 | and memory leaks on regular builds. |
| 3226 | |
| 3227 | =item * |
| 3228 | |
| 3229 | On 64-bit platforms, large ranges like 1..1000000000000 no longer crash, but |
| 3230 | eat up all your memory instead. [perl #119161] |
| 3231 | |
| 3232 | =item * |
| 3233 | |
| 3234 | C<__DATA__> now puts the C<DATA> handle in the right package, even if the |
| 3235 | current package has been renamed through glob assignment. |
| 3236 | |
| 3237 | =item * |
| 3238 | |
| 3239 | When C<die>, C<last>, C<next>, C<redo>, C<goto> and C<exit> unwind the scope, |
| 3240 | it is possible for C<DESTROY> recursively to call a subroutine or format that |
| 3241 | is currently being exited. It that case, sometimes the lexical variables |
| 3242 | inside the sub would start out having values from the outer call, instead of |
| 3243 | being undefined as they should. This has been fixed. [perl #119311] |
| 3244 | |
| 3245 | =item * |
| 3246 | |
| 3247 | ${^MPEN} is no longer treated as a synonym for ${^MATCH}. |
| 3248 | |
| 3249 | =item * |
| 3250 | |
| 3251 | Perl now tries a little harder to return the correct line number in |
| 3252 | C<(caller)[2]>. [perl #115768] |
| 3253 | |
| 3254 | =item * |
| 3255 | |
| 3256 | Line numbers inside multiline quote-like operators are now reported correctly. |
| 3257 | [perl #3643] |
| 3258 | |
| 3259 | =item * |
| 3260 | |
| 3261 | C<#line> directives inside code embedded in quote-like operators are now |
| 3262 | respected. |
| 3263 | |
| 3264 | =item * |
| 3265 | |
| 3266 | Line numbers are now correct inside the second here-doc when two here-doc |
| 3267 | markers occur on the same line. |
| 3268 | |
| 3269 | =item * |
| 3270 | |
| 3271 | An optimization in Perl 5.18 made incorrect assumptions causing a bad |
| 3272 | interaction with the L<Devel::CallParser> CPAN module. If the module was |
| 3273 | loaded then lexical variables declared in separate statements following a |
| 3274 | C<my(...)> list might fail to be cleared on scope exit. |
| 3275 | |
| 3276 | =item * |
| 3277 | |
| 3278 | C<&xsub> and C<goto &xsub> calls now allow the called subroutine to autovivify |
| 3279 | elements of @_. |
| 3280 | |
| 3281 | =item * |
| 3282 | |
| 3283 | C<&xsub> and C<goto &xsub> no longer crash if *_ has been undefined and has no |
| 3284 | ARRAY entry (i.e. @_ does not exist). |
| 3285 | |
| 3286 | =item * |
| 3287 | |
| 3288 | C<&xsub> and C<goto &xsub> now work with tied @_. |
| 3289 | |
| 3290 | =item * |
| 3291 | |
| 3292 | Overlong identifiers no longer cause a buffer overflow (and a crash). They |
| 3293 | started doing so in Perl 5.18. |
| 3294 | |
| 3295 | =item * |
| 3296 | |
| 3297 | The warning "Scalar value @hash{foo} better written as $hash{foo}" now produces |
| 3298 | far fewer false positives. In particular, C<@hash{+function_returning_a_list}> |
| 3299 | and C<@hash{ qw "foo bar baz" }> no longer warn. The same applies to array |
| 3300 | slices. [perl #28380, #114024] |
| 3301 | |
| 3302 | =item * |
| 3303 | |
| 3304 | C<$! = EINVAL; waitpid(0, WNOHANG);> no longer goes into an internal infinite |
| 3305 | loop. [perl #85228] |
| 3306 | |
| 3307 | =item * |
| 3308 | |
| 3309 | A possible segmentation fault in filehandle duplication has been fixed. |
| 3310 | |
| 3311 | =item * |
| 3312 | |
| 3313 | A subroutine in @INC can return a reference to a scalar containing the initial |
| 3314 | contents of the file. However, that scalar was freed prematurely if not |
| 3315 | referenced elsewhere, giving random results. |
| 3316 | |
| 3317 | =item * |
| 3318 | |
| 3319 | C<last> no longer returns values that the same statement has accumulated so |
| 3320 | far, fixing amongst other things the long-standing bug that C<push @a, last> |
| 3321 | would try to return the @a, copying it like a scalar in the process and |
| 3322 | resulting in the error, "Bizarre copy of ARRAY in last." [perl #3112] |
| 3323 | |
| 3324 | =item * |
| 3325 | |
| 3326 | In some cases, closing file handles opened to pipe to or from a process, which |
| 3327 | had been duplicated into a standard handle, would call perl's internal waitpid |
| 3328 | wrapper with a pid of zero. With the fix for [perl #85228] this zero pid was |
| 3329 | passed to C<waitpid>, possibly blocking the process. This wait for process |
| 3330 | zero no longer occurs. [perl #119893] |
| 3331 | |
| 3332 | =item * |
| 3333 | |
| 3334 | C<select> used to ignore magic on the fourth (timeout) argument, leading to |
| 3335 | effects such as C<select> blocking indefinitely rather than the expected sleep |
| 3336 | time. This has now been fixed. [perl #120102] |
| 3337 | |
| 3338 | =item * |
| 3339 | |
| 3340 | The class name in C<for my class $foo> is now parsed correctly. In the case of |
| 3341 | the second character of the class name being followed by a digit (e.g. 'a1b') |
| 3342 | this used to give the error "Missing $ on loop variable". [perl #120112] |
| 3343 | |
| 3344 | =item * |
| 3345 | |
| 3346 | Perl 5.18.0 accidentally disallowed C<-bareword> under C<use strict> and |
| 3347 | C<use integer>. This has been fixed. [perl #120288] |
| 3348 | |
| 3349 | =item * |
| 3350 | |
| 3351 | C<-a> at the start of a line (or a hyphen with any single letter that is |
| 3352 | not a filetest operator) no longer produces an erroneous 'Use of "-a" |
| 3353 | without parentheses is ambiguous' warning. [perl #120288] |
| 3354 | |
| 3355 | =item * |
| 3356 | |
| 3357 | Lvalue context is now properly propagated into bare blocks and C<if> and |
| 3358 | C<else> blocks in lvalue subroutines. Previously, arrays and hashes would |
| 3359 | sometimes incorrectly be flattened when returned in lvalue list context, or |
| 3360 | "Bizarre copy" errors could occur. [perl #119797] |
| 3361 | |
| 3362 | =item * |
| 3363 | |
| 3364 | Lvalue context is now propagated to the branches of C<||> and C<&&> (and |
| 3365 | their alphabetic equivalents, C<or> and C<and>). This means |
| 3366 | C<foreach (pos $x || pos $y) {...}> now allows C<pos> to be modified |
| 3367 | through $_. |
| 3368 | |
| 3369 | =item * |
| 3370 | |
| 3371 | C<stat> and C<readline> remember the last handle used; the former |
| 3372 | for the special C<_> filehandle, the latter for C<${^LAST_FH}>. |
| 3373 | C<eval "*foo if 0"> where *foo was the last handle passed to C<stat> |
| 3374 | or C<readline> could cause that handle to be forgotten if the |
| 3375 | handle were not opened yet. This has been fixed. |
| 3376 | |
| 3377 | =item * |
| 3378 | |
| 3379 | Various cases of C<delete $::{a}>, C<delete $::{ENV}> etc. causing a crash |
| 3380 | have been fixed. [perl #54044] |
| 3381 | |
| 3382 | =item * |
| 3383 | |
| 3384 | Setting C<$!> to EACCESS before calling C<require> could affect |
| 3385 | C<require>'s behaviour. This has been fixed. |
| 3386 | |
| 3387 | =item * |
| 3388 | |
| 3389 | The "Can't use \1 to mean $1 in expression" warning message now only occurs |
| 3390 | on the right-hand (replacement) part of a substitution. Formerly it could |
| 3391 | happen in code embedded in the left-hand side, or in any other quote-like |
| 3392 | operator. |
| 3393 | |
| 3394 | =item * |
| 3395 | |
| 3396 | Blessing into a reference (C<bless $thisref, $thatref>) has long been |
| 3397 | disallowed, but magical scalars for the second like C<$/> and those tied |
| 3398 | were exempt. They no longer are. [perl #119809] |
| 3399 | |
| 3400 | =item * |
| 3401 | |
| 3402 | Blessing into a reference was accidentally allowed in 5.18 if the class |
| 3403 | argument were a blessed reference with stale method caches (i.e., whose |
| 3404 | class had had subs defined since the last method call). They are |
| 3405 | disallowed once more, as in 5.16. |
| 3406 | |
| 3407 | =item * |
| 3408 | |
| 3409 | C<< $x->{key} >> where $x was declared as C<my Class $x> no longer crashes |
| 3410 | if a Class::FIELDS subroutine stub has been declared. |
| 3411 | |
| 3412 | =item * |
| 3413 | |
| 3414 | C<@$obj{'key'}> and C<${$obj}{key}> used to be exempt from compile-time |
| 3415 | field checking ("No such class field"; see L<fields>) but no longer are. |
| 3416 | |
| 3417 | =item * |
| 3418 | |
| 3419 | A nonexistent array element with a large index passed to a subroutine that |
| 3420 | ties the array and then tries to access the element no longer results in a |
| 3421 | crash. |
| 3422 | |
| 3423 | =item * |
| 3424 | |
| 3425 | Declaring a subroutine stub named NEGATIVE_INDICES no longer makes negative |
| 3426 | array indices crash when the current package is a tied array class. |
| 3427 | |
| 3428 | =item * |
| 3429 | |
| 3430 | Declaring a C<require>, C<glob>, or C<do> subroutine stub in the |
| 3431 | CORE::GLOBAL:: package no longer makes compilation of calls to the |
| 3432 | corresponding functions crash. |
| 3433 | |
| 3434 | =item * |
| 3435 | |
| 3436 | Aliasing CORE::GLOBAL:: functions to constants stopped working in Perl 5.10 |
| 3437 | but has now been fixed. |
| 3438 | |
| 3439 | =item * |
| 3440 | |
| 3441 | When C<`...`> or C<qx/.../> calls a C<readpipe> override, double-quotish |
| 3442 | interpolation now happens, as is the case when there is no override. |
| 3443 | Previously, the presence of an override would make these quote-like |
| 3444 | operators act like C<q{}>, suppressing interpolation. [perl #115330] |
| 3445 | |
| 3446 | =item * |
| 3447 | |
| 3448 | C<<<<`...`> here-docs (with backticks as the delimiters) now call |
| 3449 | C<readpipe> overrides. [perl #119827] |
| 3450 | |
| 3451 | =item * |
| 3452 | |
| 3453 | C<&CORE::exit()> and C<&CORE::die()> now respect L<vmsish> hints. |
| 3454 | |
| 3455 | =item * |
| 3456 | |
| 3457 | Undefining a glob that triggers a DESTROY method that undefines the same |
| 3458 | glob is now safe. It used to produce "Attempt to free unreferenced glob |
| 3459 | pointer" warnings and leak memory. |
| 3460 | |
| 3461 | =item * |
| 3462 | |
| 3463 | If subroutine redefinition (C<eval 'sub foo{}'> or C<newXS> for XS code) |
| 3464 | triggers a DESTROY method on the sub that is being redefined, and that |
| 3465 | method assigns a subroutine to the same slot (C<*foo = sub {}>), C<$_[0]> |
| 3466 | is no longer left pointing to a freed scalar. Now DESTROY is delayed until |
| 3467 | the new subroutine has been installed. |
| 3468 | |
| 3469 | =item * |
| 3470 | |
| 3471 | On Windows, perl no longer calls CloseHandle() on a socket handle. This makes |
| 3472 | debugging easier on Windows by removing certain irrelevant bad handle |
| 3473 | exceptions. It also fixes a race condition that made socket functions randomly |
| 3474 | fail in a Perl process with multiple OS threads, and possible test failures in |
| 3475 | F<dist/IO/t/cachepropagate-tcp.t>. [perl #120091/118059] |
| 3476 | |
| 3477 | =item * |
| 3478 | |
| 3479 | Formats involving UTF-8 encoded strings, or strange vars like ties, |
| 3480 | overloads, or stringified refs (and in recent |
| 3481 | perls, pure NOK vars) would generally do the wrong thing in formats |
| 3482 | when the var is treated as a string and repeatedly chopped, as in |
| 3483 | C<< ^<<<~~ >> and similar. This has now been resolved. |
| 3484 | [perl #33832/45325/113868/119847/119849/119851] |
| 3485 | |
| 3486 | =item * |
| 3487 | |
| 3488 | C<< semctl(..., SETVAL, ...) >> would set the semaphore to the top |
| 3489 | 32-bits of the supplied integer instead of the bottom 32-bits on |
| 3490 | 64-bit big-endian systems. [perl #120635] |
| 3491 | |
| 3492 | =item * |
| 3493 | |
| 3494 | C<< readdir() >> now only sets C<$!> on error. C<$!> is no longer set |
| 3495 | to C<EBADF> when then terminating C<undef> is read from the directory |
| 3496 | unless the system call sets C<$!>. [perl #118651] |
| 3497 | |
| 3498 | =item * |
| 3499 | |
| 3500 | C<&CORE::glob> no longer causes an intermittent crash due to perl's stack |
| 3501 | getting corrupted. [perl #119993] |
| 3502 | |
| 3503 | =item * |
| 3504 | |
| 3505 | C<open> with layers that load modules (e.g., "<:encoding(utf8)") no longer |
| 3506 | runs the risk of crashing due to stack corruption. |
| 3507 | |
| 3508 | =item * |
| 3509 | |
| 3510 | Perl 5.18 broke autoloading via C<< ->SUPER::foo >> method calls by looking |
| 3511 | up AUTOLOAD from the current package rather than the current package's |
| 3512 | superclass. This has been fixed. [perl #120694] |
| 3513 | |
| 3514 | =item * |
| 3515 | |
| 3516 | A longstanding bug causing C<do {} until CONSTANT>, where the constant |
| 3517 | holds a true value, to read unallocated memory has been resolved. This |
| 3518 | would usually happen after a syntax error. In past versions of Perl it has |
| 3519 | crashed intermittently. [perl #72406] |
| 3520 | |
| 3521 | =item * |
| 3522 | |
| 3523 | Fix HP-UX C<$!> failure. HP-UX strerror() returns an empty string for an |
| 3524 | unknown error code. This caused an assertion to fail under DEBUGGING |
| 3525 | builds. Now instead, the returned string for C<"$!"> contains text |
| 3526 | indicating the code is for an unknown error. |
| 3527 | |
| 3528 | =item * |
| 3529 | |
| 3530 | Individually-tied elements of @INC (as in C<tie $INC[0]...>) are now |
| 3531 | handled correctly. Formerly, whether a sub returned by such a tied element |
| 3532 | would be treated as a sub depended on whether a FETCH had occurred |
| 3533 | previously. |
| 3534 | |
| 3535 | =item * |
| 3536 | |
| 3537 | C<getc> on a byte-sized handle after the same C<getc> operator had been |
| 3538 | used on a utf8 handle used to treat the bytes as utf8, resulting in erratic |
| 3539 | behavior (e.g., malformed UTF-8 warnings). |
| 3540 | |
| 3541 | =item * |
| 3542 | |
| 3543 | An initial C<{> at the beginning of a format argument line was always |
| 3544 | interpreted as the beginning of a block prior to v5.18. In Perl v5.18, it |
| 3545 | started being treated as an ambiguous token. The parser would guess |
| 3546 | whether it was supposed to be an anonymous hash constructor or a block |
| 3547 | based on the contents. Now the previous behavious has been restored. |
| 3548 | [perl #119973] |
| 3549 | |
| 3550 | =item * |
| 3551 | |
| 3552 | In Perl v5.18 C<undef *_; goto &sub> and C<local *_; goto &sub> started |
| 3553 | crashing. This has been fixed. [perl #119949] |
| 3554 | |
| 3555 | =item * |
| 3556 | |
| 3557 | Backticks (C< `` > or C< qx// >) combined with multiple threads on |
| 3558 | Win32 could result in output sent to stdout on one thread being |
| 3559 | captured by backticks of an external command in another thread. |
| 3560 | |
| 3561 | This could occur for pseudo-forked processes too, as Win32's |
| 3562 | pseudo-fork is implemented in terms of threads. [perl #77672] |
| 3563 | |
| 3564 | =item * |
| 3565 | |
| 3566 | C<< open $fh, ">+", undef >> no longer leaks memory when TMPDIR is set |
| 3567 | but points to a directory a temporary file cannot be created in. [perl |
| 3568 | #120951] |
| 3569 | |
| 3570 | =item * |
| 3571 | |
| 3572 | C< for ( $h{k} || '' ) > no longer auto-vivifies C<$h{k}>. [perl |
| 3573 | #120374] |
| 3574 | |
| 3575 | =item * |
| 3576 | |
| 3577 | On Windows machines, Perl now emulates the POSIX use of the environment |
| 3578 | for locale initialization. Previously, the environment was ignored. |
| 3579 | See L<perllocale/ENVIRONMENT>. |
| 3580 | |
| 3581 | =item * |
| 3582 | |
| 3583 | Fixed a crash when destroying a self-referencing GLOB. [perl #121242] |
| 3584 | |
| 3585 | =back |
| 3586 | |
| 3587 | =head1 Known Problems |
| 3588 | |
| 3589 | =over 4 |
| 3590 | |
| 3591 | =item * |
| 3592 | |
| 3593 | L<IO::Socket> is known to fail tests on AIX 5.3. There is |
| 3594 | L<a patch|https://rt.perl.org/Ticket/Display.html?id=120835> in the request |
| 3595 | tracker, #120835, which may be applied to future releases. |
| 3596 | |
| 3597 | =item * |
| 3598 | |
| 3599 | The following modules are known to have test failures with this version of |
| 3600 | Perl. Patches have been submitted, so there will hopefully be new releases |
| 3601 | soon: |
| 3602 | |
| 3603 | =over |
| 3604 | |
| 3605 | =item * |
| 3606 | |
| 3607 | L<Data::Structure::Util> version 0.15 |
| 3608 | |
| 3609 | =item * |
| 3610 | |
| 3611 | L<HTML::StripScripts> version 1.05 |
| 3612 | |
| 3613 | =item * |
| 3614 | |
| 3615 | L<List::Gather> version 0.08. |
| 3616 | |
| 3617 | =back |
| 3618 | |
| 3619 | =back |
| 3620 | |
| 3621 | =head1 Obituary |
| 3622 | |
| 3623 | Diana Rosa, 27, of Rio de Janeiro, went to her long rest on May 10, |
| 3624 | 2014, along with the plush camel she kept hanging on her computer screen |
| 3625 | all the time. She was a passionate Perl hacker who loved the language and its |
| 3626 | community, and who never missed a Rio.pm event. She was a true artist, an |
| 3627 | enthusiast about writing code, singing arias and graffiting walls. We'll never |
| 3628 | forget you. |
| 3629 | |
| 3630 | Greg McCarroll died on August 28, 2013. |
| 3631 | |
| 3632 | Greg was well known for many good reasons. He was one of the organisers of |
| 3633 | the first YAPC::Europe, which concluded with an unscheduled auction where he |
| 3634 | frantically tried to raise extra money to avoid the conference making a |
| 3635 | loss. It was Greg who mistakenly arrived for a london.pm meeting a week |
| 3636 | late; some years later he was the one who sold the choice of official |
| 3637 | meeting date at a YAPC::Europe auction, and eventually as glorious leader of |
| 3638 | london.pm he got to inherit the irreverent confusion that he had created. |
| 3639 | |
| 3640 | Always helpful, friendly and cheerfully optimistic, you will be missed, but |
| 3641 | never forgotten. |
| 3642 | |
| 3643 | =head1 Acknowledgements |
| 3644 | |
| 3645 | Perl 5.20.0 represents approximately 12 months of development since Perl 5.18.0 |
| 3646 | and contains approximately 470,000 lines of changes across 2,900 files from 124 |
| 3647 | authors. |
| 3648 | |
| 3649 | Excluding auto-generated files, documentation and release tools, there were |
| 3650 | approximately 280,000 lines of changes to 1,800 .pm, .t, .c and .h files. |
| 3651 | |
| 3652 | Perl continues to flourish into its third decade thanks to a vibrant community |
| 3653 | of users and developers. The following people are known to have contributed the |
| 3654 | improvements that became Perl 5.20.0: |
| 3655 | |
| 3656 | Aaron Crane, Abhijit Menon-Sen, Abigail, Abir Viqar, Alan Haggai Alavi, Alan |
| 3657 | Hourihane, Alexander Voronov, Alexandr Ciornii, Andy Dougherty, Anno Siegel, |
| 3658 | Aristotle Pagaltzis, Arthur Axel 'fREW' Schmidt, Brad Gilbert, Brendan Byrd, |
| 3659 | Brian Childs, Brian Fraser, Brian Gottreu, Chris 'BinGOs' Williams, Christian |
| 3660 | Millour, Colin Kuskie, Craig A. Berry, Dabrien 'Dabe' Murphy, Dagfinn Ilmari |
| 3661 | Mannsåker, Daniel Dragan, Darin McBride, David Golden, David Leadbeater, David |
| 3662 | Mitchell, David Nicol, David Steinbrunner, Dennis Kaarsemaker, Dominic |
| 3663 | Hargreaves, Ed Avis, Eric Brine, Evan Zacks, Father Chrysostomos, Florian |
| 3664 | Ragwitz, François Perrad, Gavin Shelley, Gideon Israel Dsouza, Gisle Aas, |
| 3665 | Graham Knop, H.Merijn Brand, Hauke D, Heiko Eissfeldt, Hiroo Hayashi, Hojung |
| 3666 | Youn, James E Keenan, Jarkko Hietaniemi, Jerry D. Hedden, Jess Robinson, Jesse |
| 3667 | Luehrs, Johan Vromans, John Gardiner Myers, John Goodyear, John P. Linderman, |
| 3668 | John Peacock, kafka, Kang-min Liu, Karen Etheridge, Karl Williamson, Keedi Kim, |
| 3669 | Kent Fredric, kevin dawson, Kevin Falcone, Kevin Ryde, Leon Timmermans, Lukas |
| 3670 | Mai, Marc Simpson, Marcel Grünauer, Marco Peereboom, Marcus Holland-Moritz, |
| 3671 | Mark Jason Dominus, Martin McGrath, Matthew Horsfall, Max Maischein, Mike |
| 3672 | Doherty, Moritz Lenz, Nathan Glenn, Nathan Trapuzzano, Neil Bowers, Neil |
| 3673 | Williams, Nicholas Clark, Niels Thykier, Niko Tyni, Olivier Mengué, Owain G. |
| 3674 | Ainsworth, Paul Green, Paul Johnson, Peter John Acklam, Peter Martini, Peter |
| 3675 | Rabbitson, Petr Písař, Philip Boulain, Philip Guenther, Piotr Roszatycki, |
| 3676 | Rafael Garcia-Suarez, Reini Urban, Reuben Thomas, Ricardo Signes, Ruslan |
| 3677 | Zakirov, Sergey Alekseev, Shirakata Kentaro, Shlomi Fish, Slaven Rezic, |
| 3678 | Smylers, Steffen Müller, Steve Hay, Sullivan Beck, Thomas Sibley, Tobias |
| 3679 | Leich, Toby Inkster, Tokuhiro Matsuno, Tom Christiansen, Tom Hukins, Tony Cook, |
| 3680 | Victor Efimov, Viktor Turskyi, Vladimir Timofeev, YAMASHINA Hio, Yves Orton, |
| 3681 | Zefram, Zsbán Ambrus, Ævar Arnfjörð Bjarmason. |
| 3682 | |
| 3683 | The list above is almost certainly incomplete as it is automatically generated |
| 3684 | from version control history. In particular, it does not include the names of |
| 3685 | the (very much appreciated) contributors who reported issues to the Perl bug |
| 3686 | tracker. |
| 3687 | |
| 3688 | Many of the changes included in this version originated in the CPAN modules |
| 3689 | included in Perl's core. We're grateful to the entire CPAN community for |
| 3690 | helping Perl to flourish. |
| 3691 | |
| 3692 | For a more complete list of all of Perl's historical contributors, please see |
| 3693 | the F<AUTHORS> file in the Perl source distribution. |
| 3694 | |
| 3695 | =head1 Reporting Bugs |
| 3696 | |
| 3697 | If you find what you think is a bug, you might check the articles recently |
| 3698 | posted to the comp.lang.perl.misc newsgroup and the perl bug database at |
| 3699 | http://rt.perl.org/perlbug/ . There may also be information at |
| 3700 | http://www.perl.org/ , the Perl Home Page. |
| 3701 | |
| 3702 | If you believe you have an unreported bug, please run the L<perlbug> program |
| 3703 | included with your release. Be sure to trim your bug down to a tiny but |
| 3704 | sufficient test case. Your bug report, along with the output of C<perl -V>, |
| 3705 | will be sent off to perlbug@perl.org to be analysed by the Perl porting team. |
| 3706 | |
| 3707 | If the bug you are reporting has security implications, which make it |
| 3708 | inappropriate to send to a publicly archived mailing list, then please send it |
| 3709 | to perl5-security-report@perl.org. This points to a closed subscription |
| 3710 | unarchived mailing list, which includes all the core committers, who will be |
| 3711 | able to help assess the impact of issues, figure out a resolution, and help |
| 3712 | co-ordinate the release of patches to mitigate or fix the problem across all |
| 3713 | platforms on which Perl is supported. Please only use this address for |
| 3714 | security issues in the Perl core, not for modules independently distributed on |
| 3715 | CPAN. |
| 3716 | |
| 3717 | =head1 SEE ALSO |
| 3718 | |
| 3719 | The F<Changes> file for an explanation of how to view exhaustive details on |
| 3720 | what changed. |
| 3721 | |
| 3722 | The F<INSTALL> file for how to build Perl. |
| 3723 | |
| 3724 | The F<README> file for general stuff. |
| 3725 | |
| 3726 | The F<Artistic> and F<Copying> files for copyright information. |
| 3727 | |
| 3728 | =cut |