| 1 | =encoding utf8 |
| 2 | |
| 3 | =head1 NAME |
| 4 | |
| 5 | perl5140delta - what is new for perl v5.14.0 |
| 6 | |
| 7 | =head1 DESCRIPTION |
| 8 | |
| 9 | This document describes differences between the 5.12.0 release and |
| 10 | the 5.14.0 release. |
| 11 | |
| 12 | If you are upgrading from an earlier release such as 5.10.0, first read |
| 13 | L<perl5120delta>, which describes differences between 5.10.0 and |
| 14 | 5.12.0. |
| 15 | |
| 16 | Some of the bug fixes in this release have been backported to subsequent |
| 17 | releases of 5.12.x. Those are indicated with the 5.12.x version in |
| 18 | parentheses. |
| 19 | |
| 20 | =head1 Notice |
| 21 | |
| 22 | As described in L<perlpolicy>, the release of Perl 5.14.0 marks the |
| 23 | official end of support for Perl 5.10. Users of Perl 5.10 or earlier |
| 24 | should consider upgrading to a more recent release of Perl. |
| 25 | |
| 26 | =head1 Core Enhancements |
| 27 | |
| 28 | =head2 Unicode |
| 29 | |
| 30 | =head3 Unicode Version 6.0 is now supported (mostly) |
| 31 | |
| 32 | Perl comes with the Unicode 6.0 data base updated with |
| 33 | L<Corrigendum #8|http://www.unicode.org/versions/corrigendum8.html>, |
| 34 | with one exception noted below. |
| 35 | See L<http://unicode.org/versions/Unicode6.0.0/> for details on the new |
| 36 | release. Perl does not support any Unicode provisional properties, |
| 37 | including the new ones for this release. |
| 38 | |
| 39 | Unicode 6.0 has chosen to use the name C<BELL> for the character at U+1F514, |
| 40 | which is a symbol that looks like a bell, and is used in Japanese cell |
| 41 | phones. This conflicts with the long-standing Perl usage of having |
| 42 | C<BELL> mean the ASCII C<BEL> character, U+0007. In Perl 5.14, |
| 43 | C<\N{BELL}> continues to mean U+0007, but its use generates a |
| 44 | deprecation warning message unless such warnings are turned off. The |
| 45 | new name for U+0007 in Perl is C<ALERT>, which corresponds nicely |
| 46 | with the existing shorthand sequence for it, C<"\a">. C<\N{BEL}> |
| 47 | means U+0007, with no warning given. The character at U+1F514 has no |
| 48 | name in 5.14, but can be referred to by C<\N{U+1F514}>. |
| 49 | In Perl 5.16, C<\N{BELL}> will refer to U+1F514; all code |
| 50 | that uses C<\N{BELL}> should be converted to use C<\N{ALERT}>, |
| 51 | C<\N{BEL}>, or C<"\a"> before upgrading. |
| 52 | |
| 53 | =head3 Full functionality for C<use feature 'unicode_strings'> |
| 54 | |
| 55 | This release provides full functionality for C<use feature |
| 56 | 'unicode_strings'>. Under its scope, all string operations executed and |
| 57 | regular expressions compiled (even if executed outside its scope) have |
| 58 | Unicode semantics. See L<feature/"the 'unicode_strings' feature">. |
| 59 | However, see L</Inverted bracketed character classes and multi-character folds>, |
| 60 | below. |
| 61 | |
| 62 | This feature avoids most forms of the "Unicode Bug" (see |
| 63 | L<perlunicode/The "Unicode Bug"> for details). If there is any |
| 64 | possibility that your code will process Unicode strings, you are |
| 65 | I<strongly> encouraged to use this subpragma to avoid nasty surprises. |
| 66 | |
| 67 | =head3 C<\N{I<NAME>}> and C<charnames> enhancements |
| 68 | |
| 69 | =over |
| 70 | |
| 71 | =item * |
| 72 | |
| 73 | C<\N{I<NAME>}> and C<charnames::vianame> now know about the abbreviated |
| 74 | character names listed by Unicode, such as NBSP, SHY, LRO, ZWJ, etc.; all |
| 75 | customary abbreviations for the C0 and C1 control characters (such as |
| 76 | ACK, BEL, CAN, etc.); and a few new variants of some C1 full names that |
| 77 | are in common usage. |
| 78 | |
| 79 | =item * |
| 80 | |
| 81 | Unicode has several I<named character sequences>, in which particular sequences |
| 82 | of code points are given names. C<\N{I<NAME>}> now recognizes these. |
| 83 | |
| 84 | =item * |
| 85 | |
| 86 | C<\N{I<NAME>}>, C<charnames::vianame>, and C<charnames::viacode> |
| 87 | now know about every character in Unicode. In earlier releases of |
| 88 | Perl, they didn't know about the Hangul syllables nor several |
| 89 | CJK (Chinese/Japanese/Korean) characters. |
| 90 | |
| 91 | =item * |
| 92 | |
| 93 | It is now possible to override Perl's abbreviations with your own custom aliases. |
| 94 | |
| 95 | =item * |
| 96 | |
| 97 | You can now create a custom alias of the ordinal of a |
| 98 | character, known by C<\N{I<NAME>}>, C<charnames::vianame()>, and |
| 99 | C<charnames::viacode()>. Previously, aliases had to be to official |
| 100 | Unicode character names. This made it impossible to create an alias for |
| 101 | unnamed code points, such as those reserved for private |
| 102 | use. |
| 103 | |
| 104 | =item * |
| 105 | |
| 106 | The new function charnames::string_vianame() is a run-time version |
| 107 | of C<\N{I<NAME>}}>, returning the string of characters whose Unicode |
| 108 | name is its parameter. It can handle Unicode named character |
| 109 | sequences, whereas the pre-existing charnames::vianame() cannot, |
| 110 | as the latter returns a single code point. |
| 111 | |
| 112 | =back |
| 113 | |
| 114 | See L<charnames> for details on all these changes. |
| 115 | |
| 116 | =head3 New warnings categories for problematic (non-)Unicode code points. |
| 117 | |
| 118 | Three new warnings subcategories of "utf8" have been added. These |
| 119 | allow you to turn off some "utf8" warnings, while allowing |
| 120 | other warnings to remain on. The three categories are: |
| 121 | C<surrogate> when UTF-16 surrogates are encountered; |
| 122 | C<nonchar> when Unicode non-character code points are encountered; |
| 123 | and C<non_unicode> when code points above the legal Unicode |
| 124 | maximum of 0x10FFFF are encountered. |
| 125 | |
| 126 | =head3 Any unsigned value can be encoded as a character |
| 127 | |
| 128 | With this release, Perl is adopting a model that any unsigned value |
| 129 | can be treated as a code point and encoded internally (as utf8) |
| 130 | without warnings, not just the code points that are legal in Unicode. |
| 131 | However, unless utf8 or the corresponding sub-category (see previous |
| 132 | item) of lexical warnings have been explicitly turned off, outputting |
| 133 | or executing a Unicode-defined operation such as upper-casing |
| 134 | on such a code point generates a warning. Attempting to input these |
| 135 | using strict rules (such as with the C<:encoding(UTF-8)> layer) |
| 136 | will continue to fail. Prior to this release, handling was |
| 137 | inconsistent and in places, incorrect. |
| 138 | |
| 139 | Unicode non-characters, some of which previously were erroneously |
| 140 | considered illegal in places by Perl, contrary to the Unicode Standard, |
| 141 | are now always legal internally. Inputting or outputting them |
| 142 | works the same as with the non-legal Unicode code points, because the Unicode |
| 143 | Standard says they are (only) illegal for "open interchange". |
| 144 | |
| 145 | =head3 Unicode database files not installed |
| 146 | |
| 147 | The Unicode database files are no longer installed with Perl. This |
| 148 | doesn't affect any functionality in Perl and saves significant disk |
| 149 | space. If you need these files, you can download them from |
| 150 | L<http://www.unicode.org/Public/zipped/6.0.0/>. |
| 151 | |
| 152 | =head2 Regular Expressions |
| 153 | |
| 154 | =head3 C<(?^...)> construct signifies default modifiers |
| 155 | |
| 156 | An ASCII caret C<"^"> immediately following a C<"(?"> in a regular |
| 157 | expression now means that the subexpression does not inherit surrounding |
| 158 | modifiers such as C</i>, but reverts to the Perl defaults. Any modifiers |
| 159 | following the caret override the defaults. |
| 160 | |
| 161 | Stringification of regular expressions now uses this notation. |
| 162 | For example, C<qr/hlagh/i> would previously be stringified as |
| 163 | C<(?i-xsm:hlagh)>, but now it's stringified as C<(?^i:hlagh)>. |
| 164 | |
| 165 | The main purpose of this change is to allow tests that rely on the |
| 166 | stringification I<not> to have to change whenever new modifiers are added. |
| 167 | See L<perlre/Extended Patterns>. |
| 168 | |
| 169 | This change is likely to break code that compares stringified regular |
| 170 | expressions with fixed strings containing C<?-xism>. |
| 171 | |
| 172 | =head3 C</d>, C</l>, C</u>, and C</a> modifiers |
| 173 | |
| 174 | Four new regular expression modifiers have been added. These are mutually |
| 175 | exclusive: one only can be turned on at a time. |
| 176 | |
| 177 | =over |
| 178 | |
| 179 | =item * |
| 180 | |
| 181 | The C</l> modifier says to compile the regular expression as if it were |
| 182 | in the scope of C<use locale>, even if it is not. |
| 183 | |
| 184 | =item * |
| 185 | |
| 186 | The C</u> modifier says to compile the regular expression as if it were |
| 187 | in the scope of a C<use feature 'unicode_strings'> pragma. |
| 188 | |
| 189 | =item * |
| 190 | |
| 191 | The C</d> (default) modifier is used to override any C<use locale> and |
| 192 | C<use feature 'unicode_strings'> pragmas in effect at the time |
| 193 | of compiling the regular expression. |
| 194 | |
| 195 | =item * |
| 196 | |
| 197 | The C</a> regular expression modifier restricts C<\s>, C<\d> and C<\w> and |
| 198 | the POSIX (C<[[:posix:]]>) character classes to the ASCII range. Their |
| 199 | complements and C<\b> and C<\B> are correspondingly |
| 200 | affected. Otherwise, C</a> behaves like the C</u> modifier, in that |
| 201 | case-insensitive matching uses Unicode semantics. |
| 202 | |
| 203 | If the C</a> modifier is repeated, then additionally in case-insensitive |
| 204 | matching, no ASCII character can match a non-ASCII character. |
| 205 | For example, |
| 206 | |
| 207 | "k" =~ /\N{KELVIN SIGN}/ai |
| 208 | "\xDF" =~ /ss/ai |
| 209 | |
| 210 | match but |
| 211 | |
| 212 | "k" =~ /\N{KELVIN SIGN}/aai |
| 213 | "\xDF" =~ /ss/aai |
| 214 | |
| 215 | do not match. |
| 216 | |
| 217 | =back |
| 218 | |
| 219 | See L<perlre/Modifiers> for more detail. |
| 220 | |
| 221 | =head3 Non-destructive substitution |
| 222 | |
| 223 | The substitution (C<s///>) and transliteration |
| 224 | (C<y///>) operators now support an C</r> option that |
| 225 | copies the input variable, carries out the substitution on |
| 226 | the copy, and returns the result. The original remains unmodified. |
| 227 | |
| 228 | my $old = "cat"; |
| 229 | my $new = $old =~ s/cat/dog/r; |
| 230 | # $old is "cat" and $new is "dog" |
| 231 | |
| 232 | This is particularly useful with C<map>. See L<perlop> for more examples. |
| 233 | |
| 234 | =head3 Re-entrant regular expression engine |
| 235 | |
| 236 | It is now safe to use regular expressions within C<(?{...})> and |
| 237 | C<(??{...})> code blocks inside regular expressions. |
| 238 | |
| 239 | These blocks are still experimental, however, and still have problems with |
| 240 | lexical (C<my>) variables and abnormal exiting. |
| 241 | |
| 242 | =head3 C<use re '/flags'> |
| 243 | |
| 244 | The C<re> pragma now has the ability to turn on regular expression flags |
| 245 | till the end of the lexical scope: |
| 246 | |
| 247 | use re "/x"; |
| 248 | "foo" =~ / (.+) /; # /x implied |
| 249 | |
| 250 | See L<re/"'/flags' mode"> for details. |
| 251 | |
| 252 | =head3 \o{...} for octals |
| 253 | |
| 254 | There is a new octal escape sequence, C<"\o">, in doublequote-like |
| 255 | contexts. This construct allows large octal ordinals beyond the |
| 256 | current max of 0777 to be represented. It also allows you to specify a |
| 257 | character in octal which can safely be concatenated with other regex |
| 258 | snippets and which won't be confused with being a backreference to |
| 259 | a regex capture group. See L<perlre/Capture groups>. |
| 260 | |
| 261 | =head3 Add C<\p{Titlecase}> as a synonym for C<\p{Title}> |
| 262 | |
| 263 | This synonym is added for symmetry with the Unicode property names |
| 264 | C<\p{Uppercase}> and C<\p{Lowercase}>. |
| 265 | |
| 266 | =head3 Regular expression debugging output improvement |
| 267 | |
| 268 | Regular expression debugging output (turned on by C<use re 'debug'>) now |
| 269 | uses hexadecimal when escaping non-ASCII characters, instead of octal. |
| 270 | |
| 271 | =head3 Return value of C<delete $+{...}> |
| 272 | |
| 273 | Custom regular expression engines can now determine the return value of |
| 274 | C<delete> on an entry of C<%+> or C<%->. |
| 275 | |
| 276 | =head2 Syntactical Enhancements |
| 277 | |
| 278 | =head3 Array and hash container functions accept references |
| 279 | |
| 280 | B<Warning:> This feature is considered experimental, as the exact behaviour |
| 281 | may change in a future version of Perl. |
| 282 | |
| 283 | All builtin functions that operate directly on array or hash |
| 284 | containers now also accept unblessed hard references to arrays |
| 285 | or hashes: |
| 286 | |
| 287 | |----------------------------+---------------------------| |
| 288 | | Traditional syntax | Terse syntax | |
| 289 | |----------------------------+---------------------------| |
| 290 | | push @$arrayref, @stuff | push $arrayref, @stuff | |
| 291 | | unshift @$arrayref, @stuff | unshift $arrayref, @stuff | |
| 292 | | pop @$arrayref | pop $arrayref | |
| 293 | | shift @$arrayref | shift $arrayref | |
| 294 | | splice @$arrayref, 0, 2 | splice $arrayref, 0, 2 | |
| 295 | | keys %$hashref | keys $hashref | |
| 296 | | keys @$arrayref | keys $arrayref | |
| 297 | | values %$hashref | values $hashref | |
| 298 | | values @$arrayref | values $arrayref | |
| 299 | | ($k,$v) = each %$hashref | ($k,$v) = each $hashref | |
| 300 | | ($k,$v) = each @$arrayref | ($k,$v) = each $arrayref | |
| 301 | |----------------------------+---------------------------| |
| 302 | |
| 303 | This allows these builtin functions to act on long dereferencing chains |
| 304 | or on the return value of subroutines without needing to wrap them in |
| 305 | C<@{}> or C<%{}>: |
| 306 | |
| 307 | push @{$obj->tags}, $new_tag; # old way |
| 308 | push $obj->tags, $new_tag; # new way |
| 309 | |
| 310 | for ( keys %{$hoh->{genres}{artists}} ) {...} # old way |
| 311 | for ( keys $hoh->{genres}{artists} ) {...} # new way |
| 312 | |
| 313 | =head3 Single term prototype |
| 314 | |
| 315 | The C<+> prototype is a special alternative to C<$> that acts like |
| 316 | C<\[@%]> when given a literal array or hash variable, but will otherwise |
| 317 | force scalar context on the argument. See L<perlsub/Prototypes>. |
| 318 | |
| 319 | =head3 C<package> block syntax |
| 320 | |
| 321 | A package declaration can now contain a code block, in which case the |
| 322 | declaration is in scope inside that block only. So C<package Foo { ... }> |
| 323 | is precisely equivalent to C<{ package Foo; ... }>. It also works with |
| 324 | a version number in the declaration, as in C<package Foo 1.2 { ... }>, |
| 325 | which is its most attractive feature. See L<perlfunc>. |
| 326 | |
| 327 | =head3 Statement labels can appear in more places |
| 328 | |
| 329 | Statement labels can now occur before any type of statement or declaration, |
| 330 | such as C<package>. |
| 331 | |
| 332 | =head3 Stacked labels |
| 333 | |
| 334 | Multiple statement labels can now appear before a single statement. |
| 335 | |
| 336 | =head3 Uppercase X/B allowed in hexadecimal/binary literals |
| 337 | |
| 338 | Literals may now use either upper case C<0X...> or C<0B...> prefixes, |
| 339 | in addition to the already supported C<0x...> and C<0b...> |
| 340 | syntax [perl #76296]. |
| 341 | |
| 342 | C, Ruby, Python, and PHP already support this syntax, and it makes |
| 343 | Perl more internally consistent: a round-trip with C<eval sprintf |
| 344 | "%#X", 0x10> now returns C<16>, just like C<eval sprintf "%#x", 0x10>. |
| 345 | |
| 346 | =head3 Overridable tie functions |
| 347 | |
| 348 | C<tie>, C<tied> and C<untie> can now be overridden [perl #75902]. |
| 349 | |
| 350 | =head2 Exception Handling |
| 351 | |
| 352 | To make them more reliable and consistent, several changes have been made |
| 353 | to how C<die>, C<warn>, and C<$@> behave. |
| 354 | |
| 355 | =over |
| 356 | |
| 357 | =item * |
| 358 | |
| 359 | When an exception is thrown inside an C<eval>, the exception is no |
| 360 | longer at risk of being clobbered by destructor code running during unwinding. |
| 361 | Previously, the exception was written into C<$@> |
| 362 | early in the throwing process, and would be overwritten if C<eval> was |
| 363 | used internally in the destructor for an object that had to be freed |
| 364 | while exiting from the outer C<eval>. Now the exception is written |
| 365 | into C<$@> last thing before exiting the outer C<eval>, so the code |
| 366 | running immediately thereafter can rely on the value in C<$@> correctly |
| 367 | corresponding to that C<eval>. (C<$@> is still also set before exiting the |
| 368 | C<eval>, for the sake of destructors that rely on this.) |
| 369 | |
| 370 | Likewise, a C<local $@> inside an C<eval> no longer clobbers any |
| 371 | exception thrown in its scope. Previously, the restoration of C<$@> upon |
| 372 | unwinding would overwrite any exception being thrown. Now the exception |
| 373 | gets to the C<eval> anyway. So C<local $@> is safe before a C<die>. |
| 374 | |
| 375 | Exceptions thrown from object destructors no longer modify the C<$@> |
| 376 | of the surrounding context. (If the surrounding context was exception |
| 377 | unwinding, this used to be another way to clobber the exception being |
| 378 | thrown.) Previously such an exception was |
| 379 | sometimes emitted as a warning, and then either was |
| 380 | string-appended to the surrounding C<$@> or completely replaced the |
| 381 | surrounding C<$@>, depending on whether that exception and the surrounding |
| 382 | C<$@> were strings or objects. Now, an exception in this situation is |
| 383 | always emitted as a warning, leaving the surrounding C<$@> untouched. |
| 384 | In addition to object destructors, this also affects any function call |
| 385 | run by XS code using the C<G_KEEPERR> flag. |
| 386 | |
| 387 | =item * |
| 388 | |
| 389 | Warnings for C<warn> can now be objects in the same way as exceptions |
| 390 | for C<die>. If an object-based warning gets the default handling |
| 391 | of writing to standard error, it is stringified as before with the |
| 392 | filename and line number appended. But a C<$SIG{__WARN__}> handler now |
| 393 | receives an object-based warning as an object, where previously it |
| 394 | was passed the result of stringifying the object. |
| 395 | |
| 396 | =back |
| 397 | |
| 398 | =head2 Other Enhancements |
| 399 | |
| 400 | =head3 Assignment to C<$0> sets the legacy process name with prctl() on Linux |
| 401 | |
| 402 | On Linux the legacy process name is now set with L<prctl(2)>, in |
| 403 | addition to altering the POSIX name via C<argv[0]>, as Perl has done |
| 404 | since version 4.000. Now system utilities that read the legacy process |
| 405 | name such as I<ps>, I<top>, and I<killall> recognize the name you set when |
| 406 | assigning to C<$0>. The string you supply is truncated at 16 bytes; |
| 407 | this limitation is imposed by Linux. |
| 408 | |
| 409 | =head3 srand() now returns the seed |
| 410 | |
| 411 | This allows programs that need to have repeatable results not to have to come |
| 412 | up with their own seed-generating mechanism. Instead, they can use srand() |
| 413 | and stash the return value for future use. One example is a test program with |
| 414 | too many combinations to test comprehensively in the time available for |
| 415 | each run. It can test a random subset each time and, should there be a failure, |
| 416 | log the seed used for that run so this can later be used to produce the same results. |
| 417 | |
| 418 | =head3 printf-like functions understand post-1980 size modifiers |
| 419 | |
| 420 | Perl's printf and sprintf operators, and Perl's internal printf replacement |
| 421 | function, now understand the C90 size modifiers "hh" (C<char>), "z" |
| 422 | (C<size_t>), and "t" (C<ptrdiff_t>). Also, when compiled with a C99 |
| 423 | compiler, Perl now understands the size modifier "j" (C<intmax_t>) |
| 424 | (but this is not portable). |
| 425 | |
| 426 | So, for example, on any modern machine, C<sprintf("%hhd", 257)> returns "1". |
| 427 | |
| 428 | =head3 New global variable C<${^GLOBAL_PHASE}> |
| 429 | |
| 430 | A new global variable, C<${^GLOBAL_PHASE}>, has been added to allow |
| 431 | introspection of the current phase of the Perl interpreter. It's explained in |
| 432 | detail in L<perlvar/"${^GLOBAL_PHASE}"> and in |
| 433 | L<perlmod/"BEGIN, UNITCHECK, CHECK, INIT and END">. |
| 434 | |
| 435 | =head3 C<-d:-foo> calls C<Devel::foo::unimport> |
| 436 | |
| 437 | The syntax B<-d:foo> was extended in 5.6.1 to make B<-d:foo=bar> |
| 438 | equivalent to B<-MDevel::foo=bar>, which expands |
| 439 | internally to C<use Devel::foo 'bar'>. |
| 440 | Perl now allows prefixing the module name with B<->, with the same |
| 441 | semantics as B<-M>; that is: |
| 442 | |
| 443 | =over 4 |
| 444 | |
| 445 | =item C<-d:-foo> |
| 446 | |
| 447 | Equivalent to B<-M-Devel::foo>: expands to |
| 448 | C<no Devel::foo> and calls C<< Devel::foo->unimport() >> |
| 449 | if that method exists. |
| 450 | |
| 451 | =item C<-d:-foo=bar> |
| 452 | |
| 453 | Equivalent to B<-M-Devel::foo=bar>: expands to C<no Devel::foo 'bar'>, |
| 454 | and calls C<< Devel::foo->unimport("bar") >> if that method exists. |
| 455 | |
| 456 | =back |
| 457 | |
| 458 | This is particularly useful for suppressing the default actions of a |
| 459 | C<Devel::*> module's C<import> method whilst still loading it for debugging. |
| 460 | |
| 461 | =head3 Filehandle method calls load L<IO::File> on demand |
| 462 | |
| 463 | When a method call on a filehandle would die because the method cannot |
| 464 | be resolved and L<IO::File> has not been loaded, Perl now loads L<IO::File> |
| 465 | via C<require> and attempts method resolution again: |
| 466 | |
| 467 | open my $fh, ">", $file; |
| 468 | $fh->binmode(":raw"); # loads IO::File and succeeds |
| 469 | |
| 470 | This also works for globs like C<STDOUT>, C<STDERR>, and C<STDIN>: |
| 471 | |
| 472 | STDOUT->autoflush(1); |
| 473 | |
| 474 | Because this on-demand load happens only if method resolution fails, the |
| 475 | legacy approach of manually loading an L<IO::File> parent class for partial |
| 476 | method support still works as expected: |
| 477 | |
| 478 | use IO::Handle; |
| 479 | open my $fh, ">", $file; |
| 480 | $fh->autoflush(1); # IO::File not loaded |
| 481 | |
| 482 | =head3 Improved IPv6 support |
| 483 | |
| 484 | The C<Socket> module provides new affordances for IPv6, |
| 485 | including implementations of the C<Socket::getaddrinfo()> and |
| 486 | C<Socket::getnameinfo()> functions, along with related constants and a |
| 487 | handful of new functions. See L<Socket>. |
| 488 | |
| 489 | =head3 DTrace probes now include package name |
| 490 | |
| 491 | The C<DTrace> probes now include an additional argument, C<arg3>, which contains |
| 492 | the package the subroutine being entered or left was compiled in. |
| 493 | |
| 494 | For example, using the following DTrace script: |
| 495 | |
| 496 | perl$target:::sub-entry |
| 497 | { |
| 498 | printf("%s::%s\n", copyinstr(arg0), copyinstr(arg3)); |
| 499 | } |
| 500 | |
| 501 | and then running: |
| 502 | |
| 503 | $ perl -e 'sub test { }; test' |
| 504 | |
| 505 | C<DTrace> will print: |
| 506 | |
| 507 | main::test |
| 508 | |
| 509 | =head2 New C APIs |
| 510 | |
| 511 | See L</Internal Changes>. |
| 512 | |
| 513 | =head1 Security |
| 514 | |
| 515 | =head2 User-defined regular expression properties |
| 516 | |
| 517 | L<perlunicode/"User-Defined Character Properties"> documented that you can |
| 518 | create custom properties by defining subroutines whose names begin with |
| 519 | "In" or "Is". However, Perl did not actually enforce that naming |
| 520 | restriction, so C<\p{foo::bar}> could call foo::bar() if it existed. The documented |
| 521 | convention is now enforced. |
| 522 | |
| 523 | Also, Perl no longer allows tainted regular expressions to invoke a |
| 524 | user-defined property. It simply dies instead [perl #82616]. |
| 525 | |
| 526 | =head1 Incompatible Changes |
| 527 | |
| 528 | Perl 5.14.0 is not binary-compatible with any previous stable release. |
| 529 | |
| 530 | In addition to the sections that follow, see L</C API Changes>. |
| 531 | |
| 532 | =head2 Regular Expressions and String Escapes |
| 533 | |
| 534 | =head3 Inverted bracketed character classes and multi-character folds |
| 535 | |
| 536 | Some characters match a sequence of two or three characters in C</i> |
| 537 | regular expression matching under Unicode rules. One example is |
| 538 | C<LATIN SMALL LETTER SHARP S> which matches the sequence C<ss>. |
| 539 | |
| 540 | 'ss' =~ /\A[\N{LATIN SMALL LETTER SHARP S}]\z/i # Matches |
| 541 | |
| 542 | This, however, can lead to very counter-intuitive results, especially |
| 543 | when inverted. Because of this, Perl 5.14 does not use multi-character C</i> |
| 544 | matching in inverted character classes. |
| 545 | |
| 546 | 'ss' =~ /\A[^\N{LATIN SMALL LETTER SHARP S}]+\z/i # ??? |
| 547 | |
| 548 | This should match any sequences of characters that aren't the C<SHARP S> |
| 549 | nor what C<SHARP S> matches under C</i>. C<"s"> isn't C<SHARP S>, but |
| 550 | Unicode says that C<"ss"> is what C<SHARP S> matches under C</i>. So |
| 551 | which one "wins"? Do you fail the match because the string has C<ss> or |
| 552 | accept it because it has an C<s> followed by another C<s>? |
| 553 | |
| 554 | Earlier releases of Perl did allow this multi-character matching, |
| 555 | but due to bugs, it mostly did not work. |
| 556 | |
| 557 | =head3 \400-\777 |
| 558 | |
| 559 | In certain circumstances, C<\400>-C<\777> in regexes have behaved |
| 560 | differently than they behave in all other doublequote-like contexts. |
| 561 | Since 5.10.1, Perl has issued a deprecation warning when this happens. |
| 562 | Now, these literals behave the same in all doublequote-like contexts, |
| 563 | namely to be equivalent to C<\x{100}>-C<\x{1FF}>, with no deprecation |
| 564 | warning. |
| 565 | |
| 566 | Use of C<\400>-C<\777> in the command-line option B<-0> retain their |
| 567 | conventional meaning. They slurp whole input files; previously, this |
| 568 | was documented only for B<-0777>. |
| 569 | |
| 570 | Because of various ambiguities, you should use the new |
| 571 | C<\o{...}> construct to represent characters in octal instead. |
| 572 | |
| 573 | =head3 Most C<\p{}> properties are now immune to case-insensitive matching |
| 574 | |
| 575 | For most Unicode properties, it doesn't make sense to have them match |
| 576 | differently under C</i> case-insensitive matching. Doing so can lead |
| 577 | to unexpected results and potential security holes. For example |
| 578 | |
| 579 | m/\p{ASCII_Hex_Digit}+/i |
| 580 | |
| 581 | could previously match non-ASCII characters because of the Unicode |
| 582 | matching rules (although there were several bugs with this). Now |
| 583 | matching under C</i> gives the same results as non-C</i> matching except |
| 584 | for those few properties where people have come to expect differences, |
| 585 | namely the ones where casing is an integral part of their meaning, such |
| 586 | as C<m/\p{Uppercase}/i> and C<m/\p{Lowercase}/i>, both of which match |
| 587 | the same code points as matched by C<m/\p{Cased}/i>. |
| 588 | Details are in L<perlrecharclass/Unicode Properties>. |
| 589 | |
| 590 | User-defined property handlers that need to match differently under C</i> |
| 591 | must be changed to read the new boolean parameter passed to them, which |
| 592 | is non-zero if case-insensitive matching is in effect and 0 otherwise. |
| 593 | See L<perlunicode/User-Defined Character Properties>. |
| 594 | |
| 595 | =head3 \p{} implies Unicode semantics |
| 596 | |
| 597 | Specifying a Unicode property in the pattern indicates |
| 598 | that the pattern is meant for matching according to Unicode rules, the way |
| 599 | C<\N{I<NAME>}> does. |
| 600 | |
| 601 | =head3 Regular expressions retain their localeness when interpolated |
| 602 | |
| 603 | Regular expressions compiled under C<use locale> now retain this when |
| 604 | interpolated into a new regular expression compiled outside a |
| 605 | C<use locale>, and vice-versa. |
| 606 | |
| 607 | Previously, one regular expression interpolated into another inherited |
| 608 | the localeness of the surrounding regex, losing whatever state it |
| 609 | originally had. This is considered a bug fix, but may trip up code that |
| 610 | has come to rely on the incorrect behaviour. |
| 611 | |
| 612 | =head3 Stringification of regexes has changed |
| 613 | |
| 614 | Default regular expression modifiers are now notated using |
| 615 | C<(?^...)>. Code relying on the old stringification will fail. |
| 616 | This is so that when new modifiers are added, such code won't |
| 617 | have to keep changing each time this happens, because the stringification |
| 618 | will automatically incorporate the new modifiers. |
| 619 | |
| 620 | Code that needs to work properly with both old- and new-style regexes |
| 621 | can avoid the whole issue by using (for perls since 5.9.5; see L<re>): |
| 622 | |
| 623 | use re qw(regexp_pattern); |
| 624 | my ($pat, $mods) = regexp_pattern($re_ref); |
| 625 | |
| 626 | If the actual stringification is important or older Perls need to be |
| 627 | supported, you can use something like the following: |
| 628 | |
| 629 | # Accept both old and new-style stringification |
| 630 | my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? "^" : "-xism"; |
| 631 | |
| 632 | And then use C<$modifiers> instead of C<-xism>. |
| 633 | |
| 634 | =head3 Run-time code blocks in regular expressions inherit pragmata |
| 635 | |
| 636 | Code blocks in regular expressions (C<(?{...})> and C<(??{...})>) previously |
| 637 | did not inherit pragmata (strict, warnings, etc.) if the regular expression |
| 638 | was compiled at run time as happens in cases like these two: |
| 639 | |
| 640 | use re "eval"; |
| 641 | $foo =~ $bar; # when $bar contains (?{...}) |
| 642 | $foo =~ /$bar(?{ $finished = 1 })/; |
| 643 | |
| 644 | This bug has now been fixed, but code that relied on the buggy behaviour |
| 645 | may need to be fixed to account for the correct behaviour. |
| 646 | |
| 647 | =head2 Stashes and Package Variables |
| 648 | |
| 649 | =head3 Localised tied hashes and arrays are no longed tied |
| 650 | |
| 651 | In the following: |
| 652 | |
| 653 | tie @a, ...; |
| 654 | { |
| 655 | local @a; |
| 656 | # here, @a is a now a new, untied array |
| 657 | } |
| 658 | # here, @a refers again to the old, tied array |
| 659 | |
| 660 | Earlier versions of Perl incorrectly tied the new local array. This has |
| 661 | now been fixed. This fix could however potentially cause a change in |
| 662 | behaviour of some code. |
| 663 | |
| 664 | =head3 Stashes are now always defined |
| 665 | |
| 666 | C<defined %Foo::> now always returns true, even when no symbols have yet been |
| 667 | defined in that package. |
| 668 | |
| 669 | This is a side-effect of removing a special-case kludge in the tokeniser, |
| 670 | added for 5.10.0, to hide side-effects of changes to the internal storage of |
| 671 | hashes. The fix drastically reduces hashes' memory overhead. |
| 672 | |
| 673 | Calling defined on a stash has been deprecated since 5.6.0, warned on |
| 674 | lexicals since 5.6.0, and warned for stashes and other package |
| 675 | variables since 5.12.0. C<defined %hash> has always exposed an |
| 676 | implementation detail: emptying a hash by deleting all entries from it does |
| 677 | not make C<defined %hash> false. Hence C<defined %hash> is not valid code to |
| 678 | determine whether an arbitrary hash is empty. Instead, use the behaviour |
| 679 | of an empty C<%hash> always returning false in scalar context. |
| 680 | |
| 681 | =head3 Clearing stashes |
| 682 | |
| 683 | Stash list assignment C<%foo:: = ()> used to make the stash temporarily |
| 684 | anonymous while it was being emptied. Consequently, any of its |
| 685 | subroutines referenced elsewhere would become anonymous, showing up as |
| 686 | "(unknown)" in C<caller>. They now retain their package names such that |
| 687 | C<caller> returns the original sub name if there is still a reference |
| 688 | to its typeglob and "foo::__ANON__" otherwise [perl #79208]. |
| 689 | |
| 690 | =head3 Dereferencing typeglobs |
| 691 | |
| 692 | If you assign a typeglob to a scalar variable: |
| 693 | |
| 694 | $glob = *foo; |
| 695 | |
| 696 | the glob that is copied to C<$glob> is marked with a special flag |
| 697 | indicating that the glob is just a copy. This allows subsequent |
| 698 | assignments to C<$glob> to overwrite the glob. The original glob, |
| 699 | however, is immutable. |
| 700 | |
| 701 | Some Perl operators did not distinguish between these two types of globs. |
| 702 | This would result in strange behaviour in edge cases: C<untie $scalar> |
| 703 | would not untie the scalar if the last thing assigned to it was a glob |
| 704 | (because it treated it as C<untie *$scalar>, which unties a handle). |
| 705 | Assignment to a glob slot (such as C<*$glob = \@some_array>) would simply |
| 706 | assign C<\@some_array> to C<$glob>. |
| 707 | |
| 708 | To fix this, the C<*{}> operator (including its C<*foo> and C<*$foo> forms) |
| 709 | has been modified to make a new immutable glob if its operand is a glob |
| 710 | copy. This allows operators that make a distinction between globs and |
| 711 | scalars to be modified to treat only immutable globs as globs. (C<tie>, |
| 712 | C<tied> and C<untie> have been left as they are for compatibility's sake, |
| 713 | but will warn. See L</Deprecations>.) |
| 714 | |
| 715 | This causes an incompatible change in code that assigns a glob to the |
| 716 | return value of C<*{}> when that operator was passed a glob copy. Take the |
| 717 | following code, for instance: |
| 718 | |
| 719 | $glob = *foo; |
| 720 | *$glob = *bar; |
| 721 | |
| 722 | The C<*$glob> on the second line returns a new immutable glob. That new |
| 723 | glob is made an alias to C<*bar>. Then it is discarded. So the second |
| 724 | assignment has no effect. |
| 725 | |
| 726 | See L<http://rt.perl.org/rt3/Public/Bug/Display.html?id=77810> for |
| 727 | more detail. |
| 728 | |
| 729 | =head3 Magic variables outside the main package |
| 730 | |
| 731 | In previous versions of Perl, magic variables like C<$!>, C<%SIG>, etc. would |
| 732 | "leak" into other packages. So C<%foo::SIG> could be used to access signals, |
| 733 | C<${"foo::!"}> (with strict mode off) to access C's C<errno>, etc. |
| 734 | |
| 735 | This was a bug, or an "unintentional" feature, which caused various ill effects, |
| 736 | such as signal handlers being wiped when modules were loaded, etc. |
| 737 | |
| 738 | This has been fixed (or the feature has been removed, depending on how you see |
| 739 | it). |
| 740 | |
| 741 | =head3 local($_) strips all magic from $_ |
| 742 | |
| 743 | local() on scalar variables gives them a new value but keeps all |
| 744 | their magic intact. This has proven problematic for the default |
| 745 | scalar variable $_, where L<perlsub> recommends that any subroutine |
| 746 | that assigns to $_ should first localize it. This would throw an |
| 747 | exception if $_ is aliased to a read-only variable, and could in general have |
| 748 | various unintentional side-effects. |
| 749 | |
| 750 | Therefore, as an exception to the general rule, local($_) will not |
| 751 | only assign a new value to $_, but also remove all existing magic from |
| 752 | it as well. |
| 753 | |
| 754 | =head3 Parsing of package and variable names |
| 755 | |
| 756 | Parsing the names of packages and package variables has changed: |
| 757 | multiple adjacent pairs of colons, as in C<foo::::bar>, are now all |
| 758 | treated as package separators. |
| 759 | |
| 760 | Regardless of this change, the exact parsing of package separators has |
| 761 | never been guaranteed and is subject to change in future Perl versions. |
| 762 | |
| 763 | =head2 Changes to Syntax or to Perl Operators |
| 764 | |
| 765 | =head3 C<given> return values |
| 766 | |
| 767 | C<given> blocks now return the last evaluated |
| 768 | expression, or an empty list if the block was exited by C<break>. Thus you |
| 769 | can now write: |
| 770 | |
| 771 | my $type = do { |
| 772 | given ($num) { |
| 773 | break when undef; |
| 774 | "integer" when /^[+-]?[0-9]+$/; |
| 775 | "float" when /^[+-]?[0-9]+(?:\.[0-9]+)?$/; |
| 776 | "unknown"; |
| 777 | } |
| 778 | }; |
| 779 | |
| 780 | See L<perlsyn/Return value> for details. |
| 781 | |
| 782 | =head3 Change in parsing of certain prototypes |
| 783 | |
| 784 | Functions declared with the following prototypes now behave correctly as unary |
| 785 | functions: |
| 786 | |
| 787 | * |
| 788 | \$ \% \@ \* \& |
| 789 | \[...] |
| 790 | ;$ ;* |
| 791 | ;\$ ;\% etc. |
| 792 | ;\[...] |
| 793 | |
| 794 | Due to this bug fix [perl #75904], functions |
| 795 | using the C<(*)>, C<(;$)> and C<(;*)> prototypes |
| 796 | are parsed with higher precedence than before. So |
| 797 | in the following example: |
| 798 | |
| 799 | sub foo(;$); |
| 800 | foo $a < $b; |
| 801 | |
| 802 | the second line is now parsed correctly as C<< foo($a) < $b >>, rather than |
| 803 | C<< foo($a < $b) >>. This happens when one of these operators is used in |
| 804 | an unparenthesised argument: |
| 805 | |
| 806 | < > <= >= lt gt le ge |
| 807 | == != <=> eq ne cmp ~~ |
| 808 | & |
| 809 | | ^ |
| 810 | && |
| 811 | || // |
| 812 | .. ... |
| 813 | ?: |
| 814 | = += -= *= etc. |
| 815 | , => |
| 816 | |
| 817 | =head3 Smart-matching against array slices |
| 818 | |
| 819 | Previously, the following code resulted in a successful match: |
| 820 | |
| 821 | my @a = qw(a y0 z); |
| 822 | my @b = qw(a x0 z); |
| 823 | @a[0 .. $#b] ~~ @b; |
| 824 | |
| 825 | This odd behaviour has now been fixed [perl #77468]. |
| 826 | |
| 827 | =head3 Negation treats strings differently from before |
| 828 | |
| 829 | The unary negation operator, C<->, now treats strings that look like numbers |
| 830 | as numbers [perl #57706]. |
| 831 | |
| 832 | =head3 Negative zero |
| 833 | |
| 834 | Negative zero (-0.0), when converted to a string, now becomes "0" on all |
| 835 | platforms. It used to become "-0" on some, but "0" on others. |
| 836 | |
| 837 | If you still need to determine whether a zero is negative, use |
| 838 | C<sprintf("%g", $zero) =~ /^-/> or the L<Data::Float> module on CPAN. |
| 839 | |
| 840 | =head3 C<:=> is now a syntax error |
| 841 | |
| 842 | Previously C<my $pi := 4> was exactly equivalent to C<my $pi : = 4>, |
| 843 | with the C<:> being treated as the start of an attribute list, ending before |
| 844 | the C<=>. The use of C<:=> to mean C<: => was deprecated in 5.12.0, and is |
| 845 | now a syntax error. This allows future use of C<:=> as a new token. |
| 846 | |
| 847 | Outside the core's tests for it, we find no Perl 5 code on CPAN |
| 848 | using this construction, so we believe that this change will have |
| 849 | little impact on real-world codebases. |
| 850 | |
| 851 | If it is absolutely necessary to have empty attribute lists (for example, |
| 852 | because of a code generator), simply avoid the error by adding a space before |
| 853 | the C<=>. |
| 854 | |
| 855 | =head3 Change in the parsing of identifiers |
| 856 | |
| 857 | Characters outside the Unicode "XIDStart" set are no longer allowed at the |
| 858 | beginning of an identifier. This means that certain accents and marks |
| 859 | that normally follow an alphabetic character may no longer be the first |
| 860 | character of an identifier. |
| 861 | |
| 862 | =head2 Threads and Processes |
| 863 | |
| 864 | =head3 Directory handles not copied to threads |
| 865 | |
| 866 | On systems other than Windows that do not have |
| 867 | a C<fchdir> function, newly-created threads no |
| 868 | longer inherit directory handles from their parent threads. Such programs |
| 869 | would usually have crashed anyway [perl #75154]. |
| 870 | |
| 871 | =head3 C<close> on shared pipes |
| 872 | |
| 873 | To avoid deadlocks, the C<close> function no longer waits for the |
| 874 | child process to exit if the underlying file descriptor is still |
| 875 | in use by another thread. It returns true in such cases. |
| 876 | |
| 877 | =head3 fork() emulation will not wait for signalled children |
| 878 | |
| 879 | On Windows parent processes would not terminate until all forked |
| 880 | children had terminated first. However, C<kill("KILL", ...)> is |
| 881 | inherently unstable on pseudo-processes, and C<kill("TERM", ...)> |
| 882 | might not get delivered if the child is blocked in a system call. |
| 883 | |
| 884 | To avoid the deadlock and still provide a safe mechanism to terminate |
| 885 | the hosting process, Perl now no longer waits for children that |
| 886 | have been sent a SIGTERM signal. It is up to the parent process to |
| 887 | waitpid() for these children if child-cleanup processing must be |
| 888 | allowed to finish. However, it is also then the responsibility of the |
| 889 | parent to avoid the deadlock by making sure the child process |
| 890 | can't be blocked on I/O. |
| 891 | |
| 892 | See L<perlfork> for more information about the fork() emulation on |
| 893 | Windows. |
| 894 | |
| 895 | =head2 Configuration |
| 896 | |
| 897 | =head3 Naming fixes in Policy_sh.SH may invalidate Policy.sh |
| 898 | |
| 899 | Several long-standing typos and naming confusions in F<Policy_sh.SH> have |
| 900 | been fixed, standardizing on the variable names used in F<config.sh>. |
| 901 | |
| 902 | This will change the behaviour of F<Policy.sh> if you happen to have been |
| 903 | accidentally relying on its incorrect behaviour. |
| 904 | |
| 905 | =head3 Perl source code is read in text mode on Windows |
| 906 | |
| 907 | Perl scripts used to be read in binary mode on Windows for the benefit |
| 908 | of the L<ByteLoader> module (which is no longer part of core Perl). This |
| 909 | had the side-effect of breaking various operations on the C<DATA> filehandle, |
| 910 | including seek()/tell(), and even simply reading from C<DATA> after filehandles |
| 911 | have been flushed by a call to system(), backticks, fork() etc. |
| 912 | |
| 913 | The default build options for Windows have been changed to read Perl source |
| 914 | code on Windows in text mode now. L<ByteLoader> will (hopefully) be updated on |
| 915 | CPAN to automatically handle this situation [perl #28106]. |
| 916 | |
| 917 | =head1 Deprecations |
| 918 | |
| 919 | See also L</Deprecated C APIs>. |
| 920 | |
| 921 | =head2 Omitting a space between a regular expression and subsequent word |
| 922 | |
| 923 | Omitting the space between a regular expression operator or |
| 924 | its modifiers and the following word is deprecated. For |
| 925 | example, C<< m/foo/sand $bar >> is for now still parsed |
| 926 | as C<< m/foo/s and $bar >>, but will now issue a warning. |
| 927 | |
| 928 | =head2 C<\cI<X>> |
| 929 | |
| 930 | The backslash-c construct was designed as a way of specifying |
| 931 | non-printable characters, but there were no restrictions (on ASCII |
| 932 | platforms) on what the character following the C<c> could be. Now, |
| 933 | a deprecation warning is raised if that character isn't an ASCII character. |
| 934 | Also, a deprecation warning is raised for C<"\c{"> (which is the same |
| 935 | as simply saying C<";">). |
| 936 | |
| 937 | =head2 C<"\b{"> and C<"\B{"> |
| 938 | |
| 939 | In regular expressions, a literal C<"{"> immediately following a C<"\b"> |
| 940 | (not in a bracketed character class) or a C<"\B{"> is now deprecated |
| 941 | to allow for its future use by Perl itself. |
| 942 | |
| 943 | =head2 Perl 4-era .pl libraries |
| 944 | |
| 945 | Perl bundles a handful of library files that predate Perl 5. |
| 946 | This bundling is now deprecated for most of these files, which are now |
| 947 | available from CPAN. The affected files now warn when run, if they were |
| 948 | installed as part of the core. |
| 949 | |
| 950 | This is a mandatory warning, not obeying B<-X> or lexical warning bits. |
| 951 | The warning is modelled on that supplied by F<deprecate.pm> for |
| 952 | deprecated-in-core F<.pm> libraries. It points to the specific CPAN |
| 953 | distribution that contains the F<.pl> libraries. The CPAN versions, of |
| 954 | course, do not generate the warning. |
| 955 | |
| 956 | =head2 List assignment to C<$[> |
| 957 | |
| 958 | Assignment to C<$[> was deprecated and started to give warnings in |
| 959 | Perl version 5.12.0. This version of Perl (5.14) now also emits a warning |
| 960 | when assigning to C<$[> in list context. This fixes an oversight in 5.12.0. |
| 961 | |
| 962 | =head2 Use of qw(...) as parentheses |
| 963 | |
| 964 | Historically the parser fooled itself into thinking that C<qw(...)> literals |
| 965 | were always enclosed in parentheses, and as a result you could sometimes omit |
| 966 | parentheses around them: |
| 967 | |
| 968 | for $x qw(a b c) { ... } |
| 969 | |
| 970 | The parser no longer lies to itself in this way. Wrap the list literal in |
| 971 | parentheses like this: |
| 972 | |
| 973 | for $x (qw(a b c)) { ... } |
| 974 | |
| 975 | This is being deprecated because the parentheses in C<for $i (1,2,3) { ... }> |
| 976 | are not part of expression syntax. They are part of the statement |
| 977 | syntax, with the C<for> statement wanting literal parentheses. |
| 978 | The synthetic parentheses that a C<qw> expression acquired were only |
| 979 | intended to be treated as part of expression syntax. |
| 980 | |
| 981 | Note that this does not change the behaviour of cases like: |
| 982 | |
| 983 | use POSIX qw(setlocale localeconv); |
| 984 | our @EXPORT = qw(foo bar baz); |
| 985 | |
| 986 | where parentheses were never required around the expression. |
| 987 | |
| 988 | =head2 C<\N{BELL}> |
| 989 | |
| 990 | This is because Unicode is using that name for a different character. |
| 991 | See L</Unicode Version 6.0 is now supported (mostly)> for more |
| 992 | explanation. |
| 993 | |
| 994 | =head2 C<?PATTERN?> |
| 995 | |
| 996 | C<?PATTERN?> (without the initial C<m>) has been deprecated and now produces |
| 997 | a warning. This is to allow future use of C<?> in new operators. |
| 998 | The match-once functionality is still available as C<m?PATTERN?>. |
| 999 | |
| 1000 | =head2 Tie functions on scalars holding typeglobs |
| 1001 | |
| 1002 | Calling a tie function (C<tie>, C<tied>, C<untie>) with a scalar argument |
| 1003 | acts on a filehandle if the scalar happens to hold a typeglob. |
| 1004 | |
| 1005 | This is a long-standing bug that will be removed in Perl 5.16, as |
| 1006 | there is currently no way to tie the scalar itself when it holds |
| 1007 | a typeglob, and no way to untie a scalar that has had a typeglob |
| 1008 | assigned to it. |
| 1009 | |
| 1010 | Now there is a deprecation warning whenever a tie |
| 1011 | function is used on a handle without an explicit C<*>. |
| 1012 | |
| 1013 | =head2 User-defined case-mapping |
| 1014 | |
| 1015 | This feature is being deprecated due to its many issues, as documented in |
| 1016 | L<perlunicode/User-Defined Case Mappings (for serious hackers only)>. |
| 1017 | This feature will be removed in Perl 5.16. Instead use the CPAN module |
| 1018 | L<Unicode::Casing>, which provides improved functionality. |
| 1019 | |
| 1020 | =head2 Deprecated modules |
| 1021 | |
| 1022 | The following module will be removed from the core distribution in a |
| 1023 | future release, and should be installed from CPAN instead. Distributions |
| 1024 | on CPAN that require this should add it to their prerequisites. The |
| 1025 | core version of these module now issues a deprecation warning. |
| 1026 | |
| 1027 | If you ship a packaged version of Perl, either alone or as part of a |
| 1028 | larger system, then you should carefully consider the repercussions of |
| 1029 | core module deprecations. You may want to consider shipping your default |
| 1030 | build of Perl with a package for the deprecated module that |
| 1031 | installs into C<vendor> or C<site> Perl library directories. This will |
| 1032 | inhibit the deprecation warnings. |
| 1033 | |
| 1034 | Alternatively, you may want to consider patching F<lib/deprecate.pm> |
| 1035 | to provide deprecation warnings specific to your packaging system |
| 1036 | or distribution of Perl, consistent with how your packaging system |
| 1037 | or distribution manages a staged transition from a release where the |
| 1038 | installation of a single package provides the given functionality, to |
| 1039 | a later release where the system administrator needs to know to install |
| 1040 | multiple packages to get that same functionality. |
| 1041 | |
| 1042 | You can silence these deprecation warnings by installing the module |
| 1043 | in question from CPAN. To install the latest version of it by role |
| 1044 | rather than by name, just install C<Task::Deprecations::5_14>. |
| 1045 | |
| 1046 | =over |
| 1047 | |
| 1048 | =item L<Devel::DProf> |
| 1049 | |
| 1050 | We strongly recommend that you install and use L<Devel::NYTProf> instead |
| 1051 | of L<Devel::DProf>, as L<Devel::NYTProf> offers significantly |
| 1052 | improved profiling and reporting. |
| 1053 | |
| 1054 | =back |
| 1055 | |
| 1056 | =head1 Performance Enhancements |
| 1057 | |
| 1058 | =head2 "Safe signals" optimisation |
| 1059 | |
| 1060 | Signal dispatch has been moved from the runloop into control ops. |
| 1061 | This should give a few percent speed increase, and eliminates nearly |
| 1062 | all the speed penalty caused by the introduction of "safe signals" |
| 1063 | in 5.8.0. Signals should still be dispatched within the same |
| 1064 | statement as they were previously. If this does I<not> happen, or |
| 1065 | if you find it possible to create uninterruptible loops, this is a |
| 1066 | bug, and reports are encouraged of how to recreate such issues. |
| 1067 | |
| 1068 | =head2 Optimisation of shift() and pop() calls without arguments |
| 1069 | |
| 1070 | Two fewer OPs are used for shift() and pop() calls with no argument (with |
| 1071 | implicit C<@_>). This change makes shift() 5% faster than C<shift @_> |
| 1072 | on non-threaded perls, and 25% faster on threaded ones. |
| 1073 | |
| 1074 | =head2 Optimisation of regexp engine string comparison work |
| 1075 | |
| 1076 | The C<foldEQ_utf8> API function for case-insensitive comparison of strings (which |
| 1077 | is used heavily by the regexp engine) was substantially refactored and |
| 1078 | optimised -- and its documentation much improved as a free bonus. |
| 1079 | |
| 1080 | =head2 Regular expression compilation speed-up |
| 1081 | |
| 1082 | Compiling regular expressions has been made faster when upgrading |
| 1083 | the regex to utf8 is necessary but this isn't known when the compilation begins. |
| 1084 | |
| 1085 | =head2 String appending is 100 times faster |
| 1086 | |
| 1087 | When doing a lot of string appending, perls built to use the system's |
| 1088 | C<malloc> could end up allocating a lot more memory than needed in a |
| 1089 | inefficient way. |
| 1090 | |
| 1091 | C<sv_grow>, the function used to allocate more memory if necessary |
| 1092 | when appending to a string, has been taught to round up the memory |
| 1093 | it requests to a certain geometric progression, making it much faster on |
| 1094 | certain platforms and configurations. On Win32, it's now about 100 times |
| 1095 | faster. |
| 1096 | |
| 1097 | =head2 Eliminate C<PL_*> accessor functions under ithreads |
| 1098 | |
| 1099 | When C<MULTIPLICITY> was first developed, and interpreter state moved into |
| 1100 | an interpreter struct, thread- and interpreter-local C<PL_*> variables |
| 1101 | were defined as macros that called accessor functions (returning the |
| 1102 | address of the value) outside the Perl core. The intent was to allow |
| 1103 | members within the interpreter struct to change size without breaking |
| 1104 | binary compatibility, so that bug fixes could be merged to a maintenance |
| 1105 | branch that necessitated such a size change. This mechanism was redundant |
| 1106 | and penalised well-behaved code. It has been removed. |
| 1107 | |
| 1108 | =head2 Freeing weak references |
| 1109 | |
| 1110 | When there are many weak references to an object, freeing that object |
| 1111 | can under some circumstances take O(I<N*N>) time to free, where |
| 1112 | I<N> is the number of references. The circumstances in which this can happen |
| 1113 | have been reduced [perl #75254] |
| 1114 | |
| 1115 | =head2 Lexical array and hash assignments |
| 1116 | |
| 1117 | An earlier optimisation to speed up C<my @array = ...> and |
| 1118 | C<my %hash = ...> assignments caused a bug and was disabled in Perl 5.12.0. |
| 1119 | |
| 1120 | Now we have found another way to speed up these assignments [perl #82110]. |
| 1121 | |
| 1122 | =head2 C<@_> uses less memory |
| 1123 | |
| 1124 | Previously, C<@_> was allocated for every subroutine at compile time with |
| 1125 | enough space for four entries. Now this allocation is done on demand when |
| 1126 | the subroutine is called [perl #72416]. |
| 1127 | |
| 1128 | =head2 Size optimisations to SV and HV structures |
| 1129 | |
| 1130 | C<xhv_fill> has been eliminated from C<struct xpvhv>, saving 1 IV per hash and |
| 1131 | on some systems will cause C<struct xpvhv> to become cache-aligned. To avoid |
| 1132 | this memory saving causing a slowdown elsewhere, boolean use of C<HvFILL> |
| 1133 | now calls C<HvTOTALKEYS> instead (which is equivalent), so while the fill |
| 1134 | data when actually required are now calculated on demand, cases when |
| 1135 | this needs to be done should be rare. |
| 1136 | |
| 1137 | The order of structure elements in SV bodies has changed. Effectively, |
| 1138 | the NV slot has swapped location with STASH and MAGIC. As all access to |
| 1139 | SV members is via macros, this should be completely transparent. This |
| 1140 | change allows the space saving for PVHVs documented above, and may reduce |
| 1141 | the memory allocation needed for PVIVs on some architectures. |
| 1142 | |
| 1143 | C<XPV>, C<XPVIV>, and C<XPVNV> now allocate only the parts of the C<SV> body |
| 1144 | they actually use, saving some space. |
| 1145 | |
| 1146 | Scalars containing regular expressions now allocate only the part of the C<SV> |
| 1147 | body they actually use, saving some space. |
| 1148 | |
| 1149 | =head2 Memory consumption improvements to Exporter |
| 1150 | |
| 1151 | The C<@EXPORT_FAIL> AV is no longer created unless needed, hence neither is |
| 1152 | the typeglob backing it. This saves about 200 bytes for every package that |
| 1153 | uses Exporter but doesn't use this functionality. |
| 1154 | |
| 1155 | =head2 Memory savings for weak references |
| 1156 | |
| 1157 | For weak references, the common case of just a single weak reference |
| 1158 | per referent has been optimised to reduce the storage required. In this |
| 1159 | case it saves the equivalent of one small Perl array per referent. |
| 1160 | |
| 1161 | =head2 C<%+> and C<%-> use less memory |
| 1162 | |
| 1163 | The bulk of the C<Tie::Hash::NamedCapture> module used to be in the Perl |
| 1164 | core. It has now been moved to an XS module to reduce overhead for |
| 1165 | programs that do not use C<%+> or C<%->. |
| 1166 | |
| 1167 | =head2 Multiple small improvements to threads |
| 1168 | |
| 1169 | The internal structures of threading now make fewer API calls and fewer |
| 1170 | allocations, resulting in noticeably smaller object code. Additionally, |
| 1171 | many thread context checks have been deferred so they're done only |
| 1172 | as needed (although this is only possible for non-debugging builds). |
| 1173 | |
| 1174 | =head2 Adjacent pairs of nextstate opcodes are now optimized away |
| 1175 | |
| 1176 | Previously, in code such as |
| 1177 | |
| 1178 | use constant DEBUG => 0; |
| 1179 | |
| 1180 | sub GAK { |
| 1181 | warn if DEBUG; |
| 1182 | print "stuff\n"; |
| 1183 | } |
| 1184 | |
| 1185 | the ops for C<warn if DEBUG> would be folded to a C<null> op (C<ex-const>), but |
| 1186 | the C<nextstate> op would remain, resulting in a runtime op dispatch of |
| 1187 | C<nextstate>, C<nextstate>, etc. |
| 1188 | |
| 1189 | The execution of a sequence of C<nextstate> ops is indistinguishable from just |
| 1190 | the last C<nextstate> op so the peephole optimizer now eliminates the first of |
| 1191 | a pair of C<nextstate> ops except when the first carries a label, since labels |
| 1192 | must not be eliminated by the optimizer, and label usage isn't conclusively known |
| 1193 | at compile time. |
| 1194 | |
| 1195 | =head1 Modules and Pragmata |
| 1196 | |
| 1197 | =head2 New Modules and Pragmata |
| 1198 | |
| 1199 | =over 4 |
| 1200 | |
| 1201 | =item * |
| 1202 | |
| 1203 | L<CPAN::Meta::YAML> 0.003 has been added as a dual-life module. It supports a |
| 1204 | subset of YAML sufficient for reading and writing F<META.yml> and F<MYMETA.yml> files |
| 1205 | included with CPAN distributions or generated by the module installation |
| 1206 | toolchain. It should not be used for any other general YAML parsing or |
| 1207 | generation task. |
| 1208 | |
| 1209 | =item * |
| 1210 | |
| 1211 | L<CPAN::Meta> version 2.110440 has been added as a dual-life module. It |
| 1212 | provides a standard library to read, interpret and write CPAN distribution |
| 1213 | metadata files (like F<META.json> and F<META.yml>) that describe a |
| 1214 | distribution, its contents, and the requirements for building it and |
| 1215 | installing it. The latest CPAN distribution metadata specification is |
| 1216 | included as L<CPAN::Meta::Spec> and notes on changes in the specification |
| 1217 | over time are given in L<CPAN::Meta::History>. |
| 1218 | |
| 1219 | =item * |
| 1220 | |
| 1221 | L<HTTP::Tiny> 0.012 has been added as a dual-life module. It is a very |
| 1222 | small, simple HTTP/1.1 client designed for simple GET requests and file |
| 1223 | mirroring. It has been added so that F<CPAN.pm> and L<CPANPLUS> can |
| 1224 | "bootstrap" HTTP access to CPAN using pure Perl without relying on external |
| 1225 | binaries like L<curl(1)> or L<wget(1)>. |
| 1226 | |
| 1227 | =item * |
| 1228 | |
| 1229 | L<JSON::PP> 2.27105 has been added as a dual-life module to allow CPAN |
| 1230 | clients to read F<META.json> files in CPAN distributions. |
| 1231 | |
| 1232 | =item * |
| 1233 | |
| 1234 | L<Module::Metadata> 1.000004 has been added as a dual-life module. It gathers |
| 1235 | package and POD information from Perl module files. It is a standalone module |
| 1236 | based on L<Module::Build::ModuleInfo> for use by other module installation |
| 1237 | toolchain components. L<Module::Build::ModuleInfo> has been deprecated in |
| 1238 | favor of this module instead. |
| 1239 | |
| 1240 | =item * |
| 1241 | |
| 1242 | L<Perl::OSType> 1.002 has been added as a dual-life module. It maps Perl |
| 1243 | operating system names (like "dragonfly" or "MSWin32") to more generic types |
| 1244 | with standardized names (like "Unix" or "Windows"). It has been refactored |
| 1245 | out of L<Module::Build> and L<ExtUtils::CBuilder> and consolidates such mappings into |
| 1246 | a single location for easier maintenance. |
| 1247 | |
| 1248 | =item * |
| 1249 | |
| 1250 | The following modules were added by the L<Unicode::Collate> |
| 1251 | upgrade. See below for details. |
| 1252 | |
| 1253 | L<Unicode::Collate::CJK::Big5> |
| 1254 | |
| 1255 | L<Unicode::Collate::CJK::GB2312> |
| 1256 | |
| 1257 | L<Unicode::Collate::CJK::JISX0208> |
| 1258 | |
| 1259 | L<Unicode::Collate::CJK::Korean> |
| 1260 | |
| 1261 | L<Unicode::Collate::CJK::Pinyin> |
| 1262 | |
| 1263 | L<Unicode::Collate::CJK::Stroke> |
| 1264 | |
| 1265 | =item * |
| 1266 | |
| 1267 | L<Version::Requirements> version 0.101020 has been added as a dual-life |
| 1268 | module. It provides a standard library to model and manipulates module |
| 1269 | prerequisites and version constraints defined in L<CPAN::Meta::Spec>. |
| 1270 | |
| 1271 | =back |
| 1272 | |
| 1273 | =head2 Updated Modules and Pragma |
| 1274 | |
| 1275 | =over 4 |
| 1276 | |
| 1277 | =item * |
| 1278 | |
| 1279 | L<attributes> has been upgraded from version 0.12 to 0.14. |
| 1280 | |
| 1281 | =item * |
| 1282 | |
| 1283 | L<Archive::Extract> has been upgraded from version 0.38 to 0.48. |
| 1284 | |
| 1285 | Updates since 0.38 include: a safe print method that guards |
| 1286 | L<Archive::Extract> from changes to C<$\>; a fix to the tests when run in core |
| 1287 | Perl; support for TZ files; a modification for the lzma |
| 1288 | logic to favour L<IO::Uncompress::Unlzma>; and a fix |
| 1289 | for an issue with NetBSD-current and its new L<unzip(1)> |
| 1290 | executable. |
| 1291 | |
| 1292 | =item * |
| 1293 | |
| 1294 | L<Archive::Tar> has been upgraded from version 1.54 to 1.76. |
| 1295 | |
| 1296 | Important changes since 1.54 include the following: |
| 1297 | |
| 1298 | =over |
| 1299 | |
| 1300 | =item * |
| 1301 | |
| 1302 | Compatibility with busybox implementations of L<tar(1)>. |
| 1303 | |
| 1304 | =item * |
| 1305 | |
| 1306 | A fix so that write() and create_archive() |
| 1307 | close only filehandles they themselves opened. |
| 1308 | |
| 1309 | =item * |
| 1310 | |
| 1311 | A bug was fixed regarding the exit code of extract_archive. |
| 1312 | |
| 1313 | =item * |
| 1314 | |
| 1315 | The L<ptar(1)> utility has a new option to allow safe creation of |
| 1316 | tarballs without world-writable files on Windows, allowing those |
| 1317 | archives to be uploaded to CPAN. |
| 1318 | |
| 1319 | =item * |
| 1320 | |
| 1321 | A new L<ptargrep(1)> utility for using regular expressions against |
| 1322 | the contents of files in a tar archive. |
| 1323 | |
| 1324 | =item * |
| 1325 | |
| 1326 | L<pax> extended headers are now skipped. |
| 1327 | |
| 1328 | =back |
| 1329 | |
| 1330 | =item * |
| 1331 | |
| 1332 | L<Attribute::Handlers> has been upgraded from version 0.87 to 0.89. |
| 1333 | |
| 1334 | =item * |
| 1335 | |
| 1336 | L<autodie> has been upgraded from version 2.06_01 to 2.1001. |
| 1337 | |
| 1338 | =item * |
| 1339 | |
| 1340 | L<AutoLoader> has been upgraded from version 5.70 to 5.71. |
| 1341 | |
| 1342 | =item * |
| 1343 | |
| 1344 | The L<B> module has been upgraded from version 1.23 to 1.29. |
| 1345 | |
| 1346 | It no longer crashes when taking apart a C<y///> containing characters |
| 1347 | outside the octet range or compiled in a C<use utf8> scope. |
| 1348 | |
| 1349 | The size of the shared object has been reduced by about 40%, with no |
| 1350 | reduction in functionality. |
| 1351 | |
| 1352 | =item * |
| 1353 | |
| 1354 | L<B::Concise> has been upgraded from version 0.78 to 0.83. |
| 1355 | |
| 1356 | L<B::Concise> marks rv2sv(), rv2av(), and rv2hv() ops with the new |
| 1357 | C<OPpDEREF> flag as "DREFed". |
| 1358 | |
| 1359 | It no longer produces mangled output with the B<-tree> option |
| 1360 | [perl #80632]. |
| 1361 | |
| 1362 | =item * |
| 1363 | |
| 1364 | L<B::Debug> has been upgraded from version 1.12 to 1.16. |
| 1365 | |
| 1366 | =item * |
| 1367 | |
| 1368 | L<B::Deparse> has been upgraded from version 0.96 to 1.03. |
| 1369 | |
| 1370 | The deparsing of a C<nextstate> op has changed when it has both a |
| 1371 | change of package relative to the previous nextstate, or a change of |
| 1372 | C<%^H> or other state and a label. The label was previously emitted |
| 1373 | first, but is now emitted last (5.12.1). |
| 1374 | |
| 1375 | The C<no 5.13.2> or similar form is now correctly handled by L<B::Deparse> |
| 1376 | (5.12.3). |
| 1377 | |
| 1378 | L<B::Deparse> now properly handles the code that applies a conditional |
| 1379 | pattern match against implicit C<$_> as it was fixed in [perl #20444]. |
| 1380 | |
| 1381 | Deparsing of C<our> followed by a variable with funny characters |
| 1382 | (as permitted under the C<use utf8> pragma) has also been fixed [perl #33752]. |
| 1383 | |
| 1384 | =item * |
| 1385 | |
| 1386 | L<B::Lint> has been upgraded from version 1.11_01 to 1.13. |
| 1387 | |
| 1388 | =item * |
| 1389 | |
| 1390 | L<base> has been upgraded from version 2.15 to 2.16. |
| 1391 | |
| 1392 | =item * |
| 1393 | |
| 1394 | L<Benchmark> has been upgraded from version 1.11 to 1.12. |
| 1395 | |
| 1396 | =item * |
| 1397 | |
| 1398 | L<bignum> has been upgraded from version 0.23 to 0.27. |
| 1399 | |
| 1400 | =item * |
| 1401 | |
| 1402 | L<Carp> has been upgraded from version 1.15 to 1.20. |
| 1403 | |
| 1404 | L<Carp> now detects incomplete L<caller()|perlfunc/"caller EXPR"> |
| 1405 | overrides and avoids using bogus C<@DB::args>. To provide backtraces, |
| 1406 | Carp relies on particular behaviour of the caller() builtin. |
| 1407 | L<Carp> now detects if other code has overridden this with an |
| 1408 | incomplete implementation, and modifies its backtrace accordingly. |
| 1409 | Previously incomplete overrides would cause incorrect values in |
| 1410 | backtraces (best case), or obscure fatal errors (worst case). |
| 1411 | |
| 1412 | This fixes certain cases of "Bizarre copy of ARRAY" caused by modules |
| 1413 | overriding caller() incorrectly (5.12.2). |
| 1414 | |
| 1415 | It now also avoids using regular expressions that cause Perl to |
| 1416 | load its Unicode tables, so as to avoid the "BEGIN not safe after |
| 1417 | errors" error that ensue if there has been a syntax error |
| 1418 | [perl #82854]. |
| 1419 | |
| 1420 | =item * |
| 1421 | |
| 1422 | L<CGI> has been upgraded from version 3.48 to 3.52. |
| 1423 | |
| 1424 | This provides the following security fixes: the MIME boundary in |
| 1425 | multipart_init() is now random and the handling of |
| 1426 | newlines embedded in header values has been improved. |
| 1427 | |
| 1428 | =item * |
| 1429 | |
| 1430 | L<Compress::Raw::Bzip2> has been upgraded from version 2.024 to 2.033. |
| 1431 | |
| 1432 | It has been updated to use L<bzip2(1)> 1.0.6. |
| 1433 | |
| 1434 | =item * |
| 1435 | |
| 1436 | L<Compress::Raw::Zlib> has been upgraded from version 2.024 to 2.033. |
| 1437 | |
| 1438 | =item * |
| 1439 | |
| 1440 | L<constant> has been upgraded from version 1.20 to 1.21. |
| 1441 | |
| 1442 | Unicode constants work once more. They have been broken since Perl 5.10.0 |
| 1443 | [CPAN RT #67525]. |
| 1444 | |
| 1445 | =item * |
| 1446 | |
| 1447 | L<CPAN> has been upgraded from version 1.94_56 to 1.9600. |
| 1448 | |
| 1449 | Major highlights: |
| 1450 | |
| 1451 | =over 4 |
| 1452 | |
| 1453 | =item * much less configuration dialog hassle |
| 1454 | |
| 1455 | =item * support for F<META/MYMETA.json> |
| 1456 | |
| 1457 | =item * support for L<local::lib> |
| 1458 | |
| 1459 | =item * support for L<HTTP::Tiny> to reduce the dependency on FTP sites |
| 1460 | |
| 1461 | =item * automatic mirror selection |
| 1462 | |
| 1463 | =item * iron out all known bugs in configure_requires |
| 1464 | |
| 1465 | =item * support for distributions compressed with L<bzip2(1)> |
| 1466 | |
| 1467 | =item * allow F<Foo/Bar.pm> on the command line to mean C<Foo::Bar> |
| 1468 | |
| 1469 | =back |
| 1470 | |
| 1471 | =item * |
| 1472 | |
| 1473 | L<CPANPLUS> has been upgraded from version 0.90 to 0.9103. |
| 1474 | |
| 1475 | A change to F<cpanp-run-perl> |
| 1476 | resolves L<RT #55964|http://rt.cpan.org/Public/Bug/Display.html?id=55964> |
| 1477 | and L<RT #57106|http://rt.cpan.org/Public/Bug/Display.html?id=57106>, both |
| 1478 | of which related to failures to install distributions that use |
| 1479 | C<Module::Install::DSL> (5.12.2). |
| 1480 | |
| 1481 | A dependency on L<Config> was not recognised as a |
| 1482 | core module dependency. This has been fixed. |
| 1483 | |
| 1484 | L<CPANPLUS> now includes support for F<META.json> and F<MYMETA.json>. |
| 1485 | |
| 1486 | =item * |
| 1487 | |
| 1488 | L<CPANPLUS::Dist::Build> has been upgraded from version 0.46 to 0.54. |
| 1489 | |
| 1490 | =item * |
| 1491 | |
| 1492 | L<Data::Dumper> has been upgraded from version 2.125 to 2.130_02. |
| 1493 | |
| 1494 | The indentation used to be off when C<$Data::Dumper::Terse> was set. This |
| 1495 | has been fixed [perl #73604]. |
| 1496 | |
| 1497 | This upgrade also fixes a crash when using custom sort functions that might |
| 1498 | cause the stack to change [perl #74170]. |
| 1499 | |
| 1500 | L<Dumpxs> no longer crashes with globs returned by C<*$io_ref> |
| 1501 | [perl #72332]. |
| 1502 | |
| 1503 | =item * |
| 1504 | |
| 1505 | L<DB_File> has been upgraded from version 1.820 to 1.821. |
| 1506 | |
| 1507 | =item * |
| 1508 | |
| 1509 | L<DBM_Filter> has been upgraded from version 0.03 to 0.04. |
| 1510 | |
| 1511 | =item * |
| 1512 | |
| 1513 | L<Devel::DProf> has been upgraded from version 20080331.00 to 20110228.00. |
| 1514 | |
| 1515 | Merely loading L<Devel::DProf> now no longer triggers profiling to start. |
| 1516 | Both C<use Devel::DProf> and C<perl -d:DProf ...> behave as before and start |
| 1517 | the profiler. |
| 1518 | |
| 1519 | B<NOTE>: L<Devel::DProf> is deprecated and will be removed from a future |
| 1520 | version of Perl. We strongly recommend that you install and use |
| 1521 | L<Devel::NYTProf> instead, as it offers significantly improved |
| 1522 | profiling and reporting. |
| 1523 | |
| 1524 | =item * |
| 1525 | |
| 1526 | L<Devel::Peek> has been upgraded from version 1.04 to 1.07. |
| 1527 | |
| 1528 | =item * |
| 1529 | |
| 1530 | L<Devel::SelfStubber> has been upgraded from version 1.03 to 1.05. |
| 1531 | |
| 1532 | =item * |
| 1533 | |
| 1534 | L<diagnostics> has been upgraded from version 1.19 to 1.22. |
| 1535 | |
| 1536 | It now renders pod links slightly better, and has been taught to find |
| 1537 | descriptions for messages that share their descriptions with other |
| 1538 | messages. |
| 1539 | |
| 1540 | =item * |
| 1541 | |
| 1542 | L<Digest::MD5> has been upgraded from version 2.39 to 2.51. |
| 1543 | |
| 1544 | It is now safe to use this module in combination with threads. |
| 1545 | |
| 1546 | =item * |
| 1547 | |
| 1548 | L<Digest::SHA> has been upgraded from version 5.47 to 5.61. |
| 1549 | |
| 1550 | C<shasum> now more closely mimics L<sha1sum(1)>/L<md5sum(1)>. |
| 1551 | |
| 1552 | C<addfile> accepts all POSIX filenames. |
| 1553 | |
| 1554 | New SHA-512/224 and SHA-512/256 transforms (ref. NIST Draft FIPS 180-4 |
| 1555 | [February 2011]) |
| 1556 | |
| 1557 | =item * |
| 1558 | |
| 1559 | L<DirHandle> has been upgraded from version 1.03 to 1.04. |
| 1560 | |
| 1561 | =item * |
| 1562 | |
| 1563 | L<Dumpvalue> has been upgraded from version 1.13 to 1.16. |
| 1564 | |
| 1565 | =item * |
| 1566 | |
| 1567 | L<DynaLoader> has been upgraded from version 1.10 to 1.13. |
| 1568 | |
| 1569 | It fixes a buffer overflow when passed a very long file name. |
| 1570 | |
| 1571 | It no longer inherits from L<AutoLoader>; hence it no longer |
| 1572 | produces weird error messages for unsuccessful method calls on classes that |
| 1573 | inherit from L<DynaLoader> [perl #84358]. |
| 1574 | |
| 1575 | =item * |
| 1576 | |
| 1577 | L<Encode> has been upgraded from version 2.39 to 2.42. |
| 1578 | |
| 1579 | Now, all 66 Unicode non-characters are treated the same way U+FFFF has |
| 1580 | always been treated: in cases when it was disallowed, all 66 are |
| 1581 | disallowed, and in cases where it warned, all 66 warn. |
| 1582 | |
| 1583 | =item * |
| 1584 | |
| 1585 | L<Env> has been upgraded from version 1.01 to 1.02. |
| 1586 | |
| 1587 | =item * |
| 1588 | |
| 1589 | L<Errno> has been upgraded from version 1.11 to 1.13. |
| 1590 | |
| 1591 | The implementation of L<Errno> has been refactored to use about 55% less memory. |
| 1592 | |
| 1593 | On some platforms with unusual header files, like Win32 L<gcc(1)> using C<mingw64> |
| 1594 | headers, some constants that weren't actually error numbers have been exposed |
| 1595 | by L<Errno>. This has been fixed [perl #77416]. |
| 1596 | |
| 1597 | =item * |
| 1598 | |
| 1599 | L<Exporter> has been upgraded from version 5.64_01 to 5.64_03. |
| 1600 | |
| 1601 | Exporter no longer overrides C<$SIG{__WARN__}> [perl #74472] |
| 1602 | |
| 1603 | =item * |
| 1604 | |
| 1605 | L<ExtUtils::CBuilder> has been upgraded from version 0.27 to 0.280203. |
| 1606 | |
| 1607 | =item * |
| 1608 | |
| 1609 | L<ExtUtils::Command> has been upgraded from version 1.16 to 1.17. |
| 1610 | |
| 1611 | =item * |
| 1612 | |
| 1613 | L<ExtUtils::Constant> has been upgraded from 0.22 to 0.23. |
| 1614 | |
| 1615 | The L<AUTOLOAD> helper code generated by C<ExtUtils::Constant::ProxySubs> |
| 1616 | can now croak() for missing constants, or generate a complete C<AUTOLOAD> |
| 1617 | subroutine in XS, allowing simplification of many modules that use it |
| 1618 | (L<Fcntl>, L<File::Glob>, L<GDBM_File>, L<I18N::Langinfo>, L<POSIX>, |
| 1619 | L<Socket>). |
| 1620 | |
| 1621 | L<ExtUtils::Constant::ProxySubs> can now optionally push the names of all |
| 1622 | constants onto the package's C<@EXPORT_OK>. |
| 1623 | |
| 1624 | =item * |
| 1625 | |
| 1626 | L<ExtUtils::Install> has been upgraded from version 1.55 to 1.56. |
| 1627 | |
| 1628 | =item * |
| 1629 | |
| 1630 | L<ExtUtils::MakeMaker> has been upgraded from version 6.56 to 6.57_05. |
| 1631 | |
| 1632 | =item * |
| 1633 | |
| 1634 | L<ExtUtils::Manifest> has been upgraded from version 1.57 to 1.58. |
| 1635 | |
| 1636 | =item * |
| 1637 | |
| 1638 | L<ExtUtils::ParseXS> has been upgraded from version 2.21 to 2.2210. |
| 1639 | |
| 1640 | =item * |
| 1641 | |
| 1642 | L<Fcntl> has been upgraded from version 1.06 to 1.11. |
| 1643 | |
| 1644 | =item * |
| 1645 | |
| 1646 | L<File::Basename> has been upgraded from version 2.78 to 2.82. |
| 1647 | |
| 1648 | =item * |
| 1649 | |
| 1650 | L<File::CheckTree> has been upgraded from version 4.4 to 4.41. |
| 1651 | |
| 1652 | =item * |
| 1653 | |
| 1654 | L<File::Copy> has been upgraded from version 2.17 to 2.21. |
| 1655 | |
| 1656 | =item * |
| 1657 | |
| 1658 | L<File::DosGlob> has been upgraded from version 1.01 to 1.04. |
| 1659 | |
| 1660 | It allows patterns containing literal parentheses: they no longer need to |
| 1661 | be escaped. On Windows, it no longer |
| 1662 | adds an extra F<./> to file names |
| 1663 | returned when the pattern is a relative glob with a drive specification, |
| 1664 | like F<C:*.pl> [perl #71712]. |
| 1665 | |
| 1666 | =item * |
| 1667 | |
| 1668 | L<File::Fetch> has been upgraded from version 0.24 to 0.32. |
| 1669 | |
| 1670 | L<HTTP::Lite> is now supported for the "http" scheme. |
| 1671 | |
| 1672 | The L<fetch(1)> utility is supported on FreeBSD, NetBSD, and |
| 1673 | Dragonfly BSD for the C<http> and C<ftp> schemes. |
| 1674 | |
| 1675 | =item * |
| 1676 | |
| 1677 | L<File::Find> has been upgraded from version 1.15 to 1.19. |
| 1678 | |
| 1679 | It improves handling of backslashes on Windows, so that paths like |
| 1680 | F<C:\dir\/file> are no longer generated [perl #71710]. |
| 1681 | |
| 1682 | =item * |
| 1683 | |
| 1684 | L<File::Glob> has been upgraded from version 1.07 to 1.12. |
| 1685 | |
| 1686 | =item * |
| 1687 | |
| 1688 | L<File::Spec> has been upgraded from version 3.31 to 3.33. |
| 1689 | |
| 1690 | Several portability fixes were made in L<File::Spec::VMS>: a colon is now |
| 1691 | recognized as a delimiter in native filespecs; caret-escaped delimiters are |
| 1692 | recognized for better handling of extended filespecs; catpath() returns |
| 1693 | an empty directory rather than the current directory if the input directory |
| 1694 | name is empty; and abs2rel() properly handles Unix-style input (5.12.2). |
| 1695 | |
| 1696 | =item * |
| 1697 | |
| 1698 | L<File::stat> has been upgraded from 1.02 to 1.05. |
| 1699 | |
| 1700 | The C<-x> and C<-X> file test operators now work correctly when run |
| 1701 | by the superuser. |
| 1702 | |
| 1703 | =item * |
| 1704 | |
| 1705 | L<Filter::Simple> has been upgraded from version 0.84 to 0.86. |
| 1706 | |
| 1707 | =item * |
| 1708 | |
| 1709 | L<GDBM_File> has been upgraded from 1.10 to 1.14. |
| 1710 | |
| 1711 | This fixes a memory leak when DBM filters are used. |
| 1712 | |
| 1713 | =item * |
| 1714 | |
| 1715 | L<Hash::Util> has been upgraded from 0.07 to 0.11. |
| 1716 | |
| 1717 | L<Hash::Util> no longer emits spurious "uninitialized" warnings when |
| 1718 | recursively locking hashes that have undefined values [perl #74280]. |
| 1719 | |
| 1720 | =item * |
| 1721 | |
| 1722 | L<Hash::Util::FieldHash> has been upgraded from version 1.04 to 1.09. |
| 1723 | |
| 1724 | =item * |
| 1725 | |
| 1726 | L<I18N::Collate> has been upgraded from version 1.01 to 1.02. |
| 1727 | |
| 1728 | =item * |
| 1729 | |
| 1730 | L<I18N::Langinfo> has been upgraded from version 0.03 to 0.08. |
| 1731 | |
| 1732 | langinfo() now defaults to using C<$_> if there is no argument given, just |
| 1733 | as the documentation has always claimed. |
| 1734 | |
| 1735 | =item * |
| 1736 | |
| 1737 | L<I18N::LangTags> has been upgraded from version 0.35 to 0.35_01. |
| 1738 | |
| 1739 | =item * |
| 1740 | |
| 1741 | L<if> has been upgraded from version 0.05 to 0.0601. |
| 1742 | |
| 1743 | =item * |
| 1744 | |
| 1745 | L<IO> has been upgraded from version 1.25_02 to 1.25_04. |
| 1746 | |
| 1747 | This version of L<IO> includes a new L<IO::Select>, which now allows L<IO::Handle> |
| 1748 | objects (and objects in derived classes) to be removed from an L<IO::Select> set |
| 1749 | even if the underlying file descriptor is closed or invalid. |
| 1750 | |
| 1751 | =item * |
| 1752 | |
| 1753 | L<IPC::Cmd> has been upgraded from version 0.54 to 0.70. |
| 1754 | |
| 1755 | Resolves an issue with splitting Win32 command lines. An argument |
| 1756 | consisting of the single character "0" used to be omitted (CPAN RT #62961). |
| 1757 | |
| 1758 | =item * |
| 1759 | |
| 1760 | L<IPC::Open3> has been upgraded from 1.05 to 1.09. |
| 1761 | |
| 1762 | open3() now produces an error if the C<exec> call fails, allowing this |
| 1763 | condition to be distinguished from a child process that exited with a |
| 1764 | non-zero status [perl #72016]. |
| 1765 | |
| 1766 | The internal xclose() routine now knows how to handle file descriptors as |
| 1767 | documented, so duplicating C<STDIN> in a child process using its file |
| 1768 | descriptor now works [perl #76474]. |
| 1769 | |
| 1770 | =item * |
| 1771 | |
| 1772 | L<IPC::SysV> has been upgraded from version 2.01 to 2.03. |
| 1773 | |
| 1774 | =item * |
| 1775 | |
| 1776 | L<lib> has been upgraded from version 0.62 to 0.63. |
| 1777 | |
| 1778 | =item * |
| 1779 | |
| 1780 | L<Locale::Maketext> has been upgraded from version 1.14 to 1.19. |
| 1781 | |
| 1782 | L<Locale::Maketext> now supports external caches. |
| 1783 | |
| 1784 | This upgrade also fixes an infinite loop in |
| 1785 | C<Locale::Maketext::Guts::_compile()> when |
| 1786 | working with tainted values (CPAN RT #40727). |
| 1787 | |
| 1788 | C<< ->maketext >> calls now back up and restore C<$@> so error |
| 1789 | messages are not suppressed (CPAN RT #34182). |
| 1790 | |
| 1791 | =item * |
| 1792 | |
| 1793 | L<Log::Message> has been upgraded from version 0.02 to 0.04. |
| 1794 | |
| 1795 | =item * |
| 1796 | |
| 1797 | L<Log::Message::Simple> has been upgraded from version 0.06 to 0.08. |
| 1798 | |
| 1799 | =item * |
| 1800 | |
| 1801 | L<Math::BigInt> has been upgraded from version 1.89_01 to 1.994. |
| 1802 | |
| 1803 | This fixes, among other things, incorrect results when computing binomial |
| 1804 | coefficients [perl #77640]. |
| 1805 | |
| 1806 | It also prevents C<sqrt($int)> from crashing under C<use bigrat>. |
| 1807 | [perl #73534]. |
| 1808 | |
| 1809 | =item * |
| 1810 | |
| 1811 | L<Math::BigInt::FastCalc> has been upgraded from version 0.19 to 0.28. |
| 1812 | |
| 1813 | =item * |
| 1814 | |
| 1815 | L<Math::BigRat> has been upgraded from version 0.24 to 0.26_02. |
| 1816 | |
| 1817 | =item * |
| 1818 | |
| 1819 | L<Memoize> has been upgraded from version 1.01_03 to 1.02. |
| 1820 | |
| 1821 | =item * |
| 1822 | |
| 1823 | L<MIME::Base64> has been upgraded from 3.08 to 3.13. |
| 1824 | |
| 1825 | Includes new functions to calculate the length of encoded and decoded |
| 1826 | base64 strings. |
| 1827 | |
| 1828 | Now provides encode_base64url() and decode_base64url() functions to process |
| 1829 | the base64 scheme for "URL applications". |
| 1830 | |
| 1831 | =item * |
| 1832 | |
| 1833 | L<Module::Build> has been upgraded from version 0.3603 to 0.3800. |
| 1834 | |
| 1835 | A notable change is the deprecation of several modules. |
| 1836 | L<Module::Build::Version> has been deprecated and L<Module::Build> now |
| 1837 | relies on the L<version> pragma directly. L<Module::Build::ModuleInfo> has |
| 1838 | been deprecated in favor of a standalone copy called L<Module::Metadata>. |
| 1839 | L<Module::Build::YAML> has been deprecated in favor of L<CPAN::Meta::YAML>. |
| 1840 | |
| 1841 | L<Module::Build> now also generates F<META.json> and F<MYMETA.json> files |
| 1842 | in accordance with version 2 of the CPAN distribution metadata specification, |
| 1843 | L<CPAN::Meta::Spec>. The older format F<META.yml> and F<MYMETA.yml> files are |
| 1844 | still generated. |
| 1845 | |
| 1846 | =item * |
| 1847 | |
| 1848 | L<Module::CoreList> has been upgraded from version 2.29 to 2.47. |
| 1849 | |
| 1850 | Besides listing the updated core modules of this release, it also stops listing |
| 1851 | the C<Filespec> module. That module never existed in core. The scripts |
| 1852 | generating L<Module::CoreList> confused it with L<VMS::Filespec>, which actually |
| 1853 | is a core module as of Perl 5.8.7. |
| 1854 | |
| 1855 | =item * |
| 1856 | |
| 1857 | L<Module::Load> has been upgraded from version 0.16 to 0.18. |
| 1858 | |
| 1859 | =item * |
| 1860 | |
| 1861 | L<Module::Load::Conditional> has been upgraded from version 0.34 to 0.44. |
| 1862 | |
| 1863 | =item * |
| 1864 | |
| 1865 | The L<mro> pragma has been upgraded from version 1.02 to 1.07. |
| 1866 | |
| 1867 | =item * |
| 1868 | |
| 1869 | L<NDBM_File> has been upgraded from version 1.08 to 1.12. |
| 1870 | |
| 1871 | This fixes a memory leak when DBM filters are used. |
| 1872 | |
| 1873 | =item * |
| 1874 | |
| 1875 | L<Net::Ping> has been upgraded from version 2.36 to 2.38. |
| 1876 | |
| 1877 | =item * |
| 1878 | |
| 1879 | L<NEXT> has been upgraded from version 0.64 to 0.65. |
| 1880 | |
| 1881 | =item * |
| 1882 | |
| 1883 | L<Object::Accessor> has been upgraded from version 0.36 to 0.38. |
| 1884 | |
| 1885 | =item * |
| 1886 | |
| 1887 | L<ODBM_File> has been upgraded from version 1.07 to 1.10. |
| 1888 | |
| 1889 | This fixes a memory leak when DBM filters are used. |
| 1890 | |
| 1891 | =item * |
| 1892 | |
| 1893 | L<Opcode> has been upgraded from version 1.15 to 1.18. |
| 1894 | |
| 1895 | =item * |
| 1896 | |
| 1897 | The L<overload> pragma has been upgraded from 1.10 to 1.13. |
| 1898 | |
| 1899 | C<overload::Method> can now handle subroutines that are themselves blessed |
| 1900 | into overloaded classes [perl #71998]. |
| 1901 | |
| 1902 | The documentation has greatly improved. See L</Documentation> below. |
| 1903 | |
| 1904 | =item * |
| 1905 | |
| 1906 | L<Params::Check> has been upgraded from version 0.26 to 0.28. |
| 1907 | |
| 1908 | =item * |
| 1909 | |
| 1910 | The L<parent> pragma has been upgraded from version 0.223 to 0.225. |
| 1911 | |
| 1912 | =item * |
| 1913 | |
| 1914 | L<Parse::CPAN::Meta> has been upgraded from version 1.40 to 1.4401. |
| 1915 | |
| 1916 | The latest Parse::CPAN::Meta can now read YAML and JSON files using |
| 1917 | L<CPAN::Meta::YAML> and L<JSON::PP>, which are now part of the Perl core. |
| 1918 | |
| 1919 | =item * |
| 1920 | |
| 1921 | L<PerlIO::encoding> has been upgraded from version 0.12 to 0.14. |
| 1922 | |
| 1923 | =item * |
| 1924 | |
| 1925 | L<PerlIO::scalar> has been upgraded from 0.07 to 0.11. |
| 1926 | |
| 1927 | A read() after a seek() beyond the end of the string no longer thinks it |
| 1928 | has data to read [perl #78716]. |
| 1929 | |
| 1930 | =item * |
| 1931 | |
| 1932 | L<PerlIO::via> has been upgraded from version 0.09 to 0.11. |
| 1933 | |
| 1934 | =item * |
| 1935 | |
| 1936 | L<Pod::Html> has been upgraded from version 1.09 to 1.11. |
| 1937 | |
| 1938 | =item * |
| 1939 | |
| 1940 | L<Pod::LaTeX> has been upgraded from version 0.58 to 0.59. |
| 1941 | |
| 1942 | =item * |
| 1943 | |
| 1944 | L<Pod::Perldoc> has been upgraded from version 3.15_02 to 3.15_03. |
| 1945 | |
| 1946 | =item * |
| 1947 | |
| 1948 | L<Pod::Simple> has been upgraded from version 3.13 to 3.16. |
| 1949 | |
| 1950 | =item * |
| 1951 | |
| 1952 | L<POSIX> has been upgraded from 1.19 to 1.24. |
| 1953 | |
| 1954 | It now includes constants for POSIX signal constants. |
| 1955 | |
| 1956 | =item * |
| 1957 | |
| 1958 | The L<re> pragma has been upgraded from version 0.11 to 0.18. |
| 1959 | |
| 1960 | The C<use re '/flags'> subpragma is new. |
| 1961 | |
| 1962 | The regmust() function used to crash when called on a regular expression |
| 1963 | belonging to a pluggable engine. Now it croaks instead. |
| 1964 | |
| 1965 | regmust() no longer leaks memory. |
| 1966 | |
| 1967 | =item * |
| 1968 | |
| 1969 | L<Safe> has been upgraded from version 2.25 to 2.29. |
| 1970 | |
| 1971 | Coderefs returned by reval() and rdo() are now wrapped via |
| 1972 | wrap_code_refs() (5.12.1). |
| 1973 | |
| 1974 | This fixes a possible infinite loop when looking for coderefs. |
| 1975 | |
| 1976 | It adds several C<version::vxs::*> routines to the default share. |
| 1977 | |
| 1978 | =item * |
| 1979 | |
| 1980 | L<SDBM_File> has been upgraded from version 1.06 to 1.09. |
| 1981 | |
| 1982 | =item * |
| 1983 | |
| 1984 | L<SelfLoader> has been upgraded from 1.17 to 1.18. |
| 1985 | |
| 1986 | It now works in taint mode [perl #72062]. |
| 1987 | |
| 1988 | =item * |
| 1989 | |
| 1990 | The L<sigtrap> pragma has been upgraded from version 1.04 to 1.05. |
| 1991 | |
| 1992 | It no longer tries to modify read-only arguments when generating a |
| 1993 | backtrace [perl #72340]. |
| 1994 | |
| 1995 | =item * |
| 1996 | |
| 1997 | L<Socket> has been upgraded from version 1.87 to 1.94. |
| 1998 | |
| 1999 | See L</Improved IPv6 support> above. |
| 2000 | |
| 2001 | =item * |
| 2002 | |
| 2003 | L<Storable> has been upgraded from version 2.22 to 2.27. |
| 2004 | |
| 2005 | Includes performance improvement for overloaded classes. |
| 2006 | |
| 2007 | This adds support for serialising code references that contain UTF-8 strings |
| 2008 | correctly. The L<Storable> minor version |
| 2009 | number changed as a result, meaning that |
| 2010 | L<Storable> users who set C<$Storable::accept_future_minor> to a C<FALSE> value |
| 2011 | will see errors (see L<Storable/FORWARD COMPATIBILITY> for more details). |
| 2012 | |
| 2013 | Freezing no longer gets confused if the Perl stack gets reallocated |
| 2014 | during freezing [perl #80074]. |
| 2015 | |
| 2016 | =item * |
| 2017 | |
| 2018 | L<Sys::Hostname> has been upgraded from version 1.11 to 1.16. |
| 2019 | |
| 2020 | =item * |
| 2021 | |
| 2022 | L<Term::ANSIColor> has been upgraded from version 2.02 to 3.00. |
| 2023 | |
| 2024 | =item * |
| 2025 | |
| 2026 | L<Term::UI> has been upgraded from version 0.20 to 0.26. |
| 2027 | |
| 2028 | =item * |
| 2029 | |
| 2030 | L<Test::Harness> has been upgraded from version 3.17 to 3.23. |
| 2031 | |
| 2032 | =item * |
| 2033 | |
| 2034 | L<Test::Simple> has been upgraded from version 0.94 to 0.98. |
| 2035 | |
| 2036 | Among many other things, subtests without a C<plan> or C<no_plan> now have an |
| 2037 | implicit done_testing() added to them. |
| 2038 | |
| 2039 | =item * |
| 2040 | |
| 2041 | L<Thread::Semaphore> has been upgraded from version 2.09 to 2.12. |
| 2042 | |
| 2043 | It provides two new methods that give more control over the decrementing of |
| 2044 | semaphores: C<down_nb> and C<down_force>. |
| 2045 | |
| 2046 | =item * |
| 2047 | |
| 2048 | L<Thread::Queue> has been upgraded from version 2.11 to 2.12. |
| 2049 | |
| 2050 | =item * |
| 2051 | |
| 2052 | The L<threads> pragma has been upgraded from version 1.75 to 1.83. |
| 2053 | |
| 2054 | =item * |
| 2055 | |
| 2056 | The L<threads::shared> pragma has been upgraded from version 1.32 to 1.37. |
| 2057 | |
| 2058 | =item * |
| 2059 | |
| 2060 | L<Tie::Hash> has been upgraded from version 1.03 to 1.04. |
| 2061 | |
| 2062 | Calling C<< Tie::Hash->TIEHASH() >> used to loop forever. Now it C<croak>s. |
| 2063 | |
| 2064 | =item * |
| 2065 | |
| 2066 | L<Tie::Hash::NamedCapture> has been upgraded from version 0.06 to 0.08. |
| 2067 | |
| 2068 | =item * |
| 2069 | |
| 2070 | L<Tie::RefHash> has been upgraded from version 1.38 to 1.39. |
| 2071 | |
| 2072 | =item * |
| 2073 | |
| 2074 | L<Time::HiRes> has been upgraded from version 1.9719 to 1.9721_01. |
| 2075 | |
| 2076 | =item * |
| 2077 | |
| 2078 | L<Time::Local> has been upgraded from version 1.1901_01 to 1.2000. |
| 2079 | |
| 2080 | =item * |
| 2081 | |
| 2082 | L<Time::Piece> has been upgraded from version 1.15_01 to 1.20_01. |
| 2083 | |
| 2084 | =item * |
| 2085 | |
| 2086 | L<Unicode::Collate> has been upgraded from version 0.52_01 to 0.73. |
| 2087 | |
| 2088 | L<Unicode::Collate> has been updated to use Unicode 6.0.0. |
| 2089 | |
| 2090 | L<Unicode::Collate::Locale> now supports a plethora of new locales: I<ar, be, |
| 2091 | bg, de__phonebook, hu, hy, kk, mk, nso, om, tn, vi, hr, ig, ja, ko, ru, sq, |
| 2092 | se, sr, to, uk, zh, zh__big5han, zh__gb2312han, zh__pinyin>, and I<zh__stroke>. |
| 2093 | |
| 2094 | The following modules have been added: |
| 2095 | |
| 2096 | L<Unicode::Collate::CJK::Big5> for C<zh__big5han> which makes |
| 2097 | tailoring of CJK Unified Ideographs in the order of CLDR's big5han ordering. |
| 2098 | |
| 2099 | L<Unicode::Collate::CJK::GB2312> for C<zh__gb2312han> which makes |
| 2100 | tailoring of CJK Unified Ideographs in the order of CLDR's gb2312han ordering. |
| 2101 | |
| 2102 | L<Unicode::Collate::CJK::JISX0208> which makes tailoring of 6355 kanji |
| 2103 | (CJK Unified Ideographs) in the JIS X 0208 order. |
| 2104 | |
| 2105 | L<Unicode::Collate::CJK::Korean> which makes tailoring of CJK Unified Ideographs |
| 2106 | in the order of CLDR's Korean ordering. |
| 2107 | |
| 2108 | L<Unicode::Collate::CJK::Pinyin> for C<zh__pinyin> which makes |
| 2109 | tailoring of CJK Unified Ideographs in the order of CLDR's pinyin ordering. |
| 2110 | |
| 2111 | L<Unicode::Collate::CJK::Stroke> for C<zh__stroke> which makes |
| 2112 | tailoring of CJK Unified Ideographs in the order of CLDR's stroke ordering. |
| 2113 | |
| 2114 | This also sees the switch from using the pure-Perl version of this |
| 2115 | module to the XS version. |
| 2116 | |
| 2117 | =item * |
| 2118 | |
| 2119 | L<Unicode::Normalize> has been upgraded from version 1.03 to 1.10. |
| 2120 | |
| 2121 | =item * |
| 2122 | |
| 2123 | L<Unicode::UCD> has been upgraded from version 0.27 to 0.32. |
| 2124 | |
| 2125 | A new function, Unicode::UCD::num(), has been added. This function |
| 2126 | returns the numeric value of the string passed it or C<undef> if the string |
| 2127 | in its entirety has no "safe" numeric value. (For more detail, and for the |
| 2128 | definition of "safe", see L<Unicode::UCD/num()>.) |
| 2129 | |
| 2130 | This upgrade also includes several bug fixes: |
| 2131 | |
| 2132 | =over 4 |
| 2133 | |
| 2134 | =item charinfo() |
| 2135 | |
| 2136 | =over 4 |
| 2137 | |
| 2138 | =item * |
| 2139 | |
| 2140 | It is now updated to Unicode Version 6.0.0 with I<Corrigendum #8>, |
| 2141 | excepting that, just as with Perl 5.14, the code point at U+1F514 has no name. |
| 2142 | |
| 2143 | =item * |
| 2144 | |
| 2145 | Hangul syllable code points have the correct names, and their |
| 2146 | decompositions are always output without requiring L<Lingua::KO::Hangul::Util> |
| 2147 | to be installed. |
| 2148 | |
| 2149 | =item * |
| 2150 | |
| 2151 | CJK (Chinese-Japanese-Korean) code points U+2A700 to U+2B734 |
| 2152 | and U+2B740 to U+2B81D are now properly handled. |
| 2153 | |
| 2154 | =item * |
| 2155 | |
| 2156 | Numeric values are now output for those CJK code points that have them. |
| 2157 | |
| 2158 | =item * |
| 2159 | |
| 2160 | Names output for code points with multiple aliases are now the |
| 2161 | corrected ones. |
| 2162 | |
| 2163 | =back |
| 2164 | |
| 2165 | =item charscript() |
| 2166 | |
| 2167 | This now correctly returns "Unknown" instead of C<undef> for the script |
| 2168 | of a code point that hasn't been assigned another one. |
| 2169 | |
| 2170 | =item charblock() |
| 2171 | |
| 2172 | This now correctly returns "No_Block" instead of C<undef> for the block |
| 2173 | of a code point that hasn't been assigned to another one. |
| 2174 | |
| 2175 | =back |
| 2176 | |
| 2177 | =item * |
| 2178 | |
| 2179 | The L<version> pragma has been upgraded from 0.82 to 0.88. |
| 2180 | |
| 2181 | Because of a bug, now fixed, the is_strict() and is_lax() functions did not |
| 2182 | work when exported (5.12.1). |
| 2183 | |
| 2184 | =item * |
| 2185 | |
| 2186 | The L<warnings> pragma has been upgraded from version 1.09 to 1.12. |
| 2187 | |
| 2188 | Calling C<use warnings> without arguments is now significantly more efficient. |
| 2189 | |
| 2190 | =item * |
| 2191 | |
| 2192 | The L<warnings::register> pragma has been upgraded from version 1.01 to 1.02. |
| 2193 | |
| 2194 | It is now possible to register warning categories other than the names of |
| 2195 | packages using L<warnings::register>. See L<perllexwarn(1)> for more information. |
| 2196 | |
| 2197 | =item * |
| 2198 | |
| 2199 | L<XSLoader> has been upgraded from version 0.10 to 0.13. |
| 2200 | |
| 2201 | =item * |
| 2202 | |
| 2203 | L<VMS::DCLsym> has been upgraded from version 1.03 to 1.05. |
| 2204 | |
| 2205 | Two bugs have been fixed [perl #84086]: |
| 2206 | |
| 2207 | The symbol table name was lost when tying a hash, due to a thinko in |
| 2208 | C<TIEHASH>. The result was that all tied hashes interacted with the |
| 2209 | local symbol table. |
| 2210 | |
| 2211 | Unless a symbol table name had been explicitly specified in the call |
| 2212 | to the constructor, querying the special key C<:LOCAL> failed to |
| 2213 | identify objects connected to the local symbol table. |
| 2214 | |
| 2215 | =item * |
| 2216 | |
| 2217 | The L<Win32> module has been upgraded from version 0.39 to 0.44. |
| 2218 | |
| 2219 | This release has several new functions: Win32::GetSystemMetrics(), |
| 2220 | Win32::GetProductInfo(), Win32::GetOSDisplayName(). |
| 2221 | |
| 2222 | The names returned by Win32::GetOSName() and Win32::GetOSDisplayName() |
| 2223 | have been corrected. |
| 2224 | |
| 2225 | =item * |
| 2226 | |
| 2227 | L<XS::Typemap> has been upgraded from version 0.03 to 0.05. |
| 2228 | |
| 2229 | =back |
| 2230 | |
| 2231 | =head2 Removed Modules and Pragmata |
| 2232 | |
| 2233 | As promised in Perl 5.12.0's release notes, the following modules have |
| 2234 | been removed from the core distribution, and if needed should be installed |
| 2235 | from CPAN instead. |
| 2236 | |
| 2237 | =over |
| 2238 | |
| 2239 | =item * |
| 2240 | |
| 2241 | L<Class::ISA> has been removed from the Perl core. Prior version was 0.36. |
| 2242 | |
| 2243 | =item * |
| 2244 | |
| 2245 | L<Pod::Plainer> has been removed from the Perl core. Prior version was 1.02. |
| 2246 | |
| 2247 | =item * |
| 2248 | |
| 2249 | L<Switch> has been removed from the Perl core. Prior version was 2.16. |
| 2250 | |
| 2251 | =back |
| 2252 | |
| 2253 | The removal of L<Shell> has been deferred until after 5.14, as the |
| 2254 | implementation of L<Shell> shipped with 5.12.0 did not correctly issue the |
| 2255 | warning that it was to be removed from core. |
| 2256 | |
| 2257 | =head1 Documentation |
| 2258 | |
| 2259 | =head2 New Documentation |
| 2260 | |
| 2261 | =head3 L<perlgpl> |
| 2262 | |
| 2263 | L<perlgpl> has been updated to contain GPL version 1, as is included in the |
| 2264 | F<README> distributed with Perl (5.12.1). |
| 2265 | |
| 2266 | =head3 Perl 5.12.x delta files |
| 2267 | |
| 2268 | The perldelta files for Perl 5.12.1 to 5.12.3 have been added from the |
| 2269 | maintenance branch: L<perl5121delta>, L<perl5122delta>, L<perl5123delta>. |
| 2270 | |
| 2271 | =head3 L<perlpodstyle> |
| 2272 | |
| 2273 | New style guide for POD documentation, |
| 2274 | split mostly from the NOTES section of the L<pod2man(1)> manpage. |
| 2275 | |
| 2276 | =head3 L<perlsource>, L<perlinterp>, L<perlhacktut>, and L<perlhacktips> |
| 2277 | |
| 2278 | See L</perlhack and perlrepository revamp>, below. |
| 2279 | |
| 2280 | =head2 Changes to Existing Documentation |
| 2281 | |
| 2282 | =head3 L<perlmodlib> is now complete |
| 2283 | |
| 2284 | The L<perlmodlib> manpage that came with Perl 5.12.0 was missing several |
| 2285 | modules due to a bug in the script that generates the list. This has been |
| 2286 | fixed [perl #74332] (5.12.1). |
| 2287 | |
| 2288 | =head3 Replace incorrect tr/// table in L<perlebcdic> |
| 2289 | |
| 2290 | L<perlebcdic> contains a helpful table to use in C<tr///> to convert |
| 2291 | between EBCDIC and Latin1/ASCII. The table was the inverse of the one |
| 2292 | it describes, though the code that used the table worked correctly for |
| 2293 | the specific example given. |
| 2294 | |
| 2295 | The table has been corrected and the sample code changed to correspond. |
| 2296 | |
| 2297 | The table has also been changed to hex from octal, and the recipes in the |
| 2298 | pod have been altered to print out leading zeros to make all values |
| 2299 | the same length. |
| 2300 | |
| 2301 | =head3 Tricks for user-defined casing |
| 2302 | |
| 2303 | L<perlunicode> now contains an explanation of how to override, mangle |
| 2304 | and otherwise tweak the way Perl handles upper-, lower- and other-case |
| 2305 | conversions on Unicode data, and how to provide scoped changes to alter |
| 2306 | one's own code's behaviour without stomping on anybody else's. |
| 2307 | |
| 2308 | =head3 INSTALL explicitly states that Perl requires a C89 compiler |
| 2309 | |
| 2310 | This was already true, but it's now Officially Stated For The Record |
| 2311 | (5.12.2). |
| 2312 | |
| 2313 | =head3 Explanation of C<\xI<HH>> and C<\oI<OOO>> escapes |
| 2314 | |
| 2315 | L<perlop> has been updated with more detailed explanation of these two |
| 2316 | character escapes. |
| 2317 | |
| 2318 | =head3 B<-0I<NNN>> switch |
| 2319 | |
| 2320 | In L<perlrun>, the behaviour of the B<-0NNN> switch for B<-0400> or higher |
| 2321 | has been clarified (5.12.2). |
| 2322 | |
| 2323 | =head3 Maintenance policy |
| 2324 | |
| 2325 | L<perlpolicy> now contains the policy on what patches are acceptable for |
| 2326 | maintenance branches (5.12.1). |
| 2327 | |
| 2328 | =head3 Deprecation policy |
| 2329 | |
| 2330 | L<perlpolicy> now contains the policy on compatibility and deprecation |
| 2331 | along with definitions of terms like "deprecation" (5.12.2). |
| 2332 | |
| 2333 | =head3 New descriptions in L<perldiag> |
| 2334 | |
| 2335 | The following existing diagnostics are now documented: |
| 2336 | |
| 2337 | =over 4 |
| 2338 | |
| 2339 | =item * |
| 2340 | |
| 2341 | L<Ambiguous use of %c resolved as operator %c|perldiag/"Ambiguous use of %c resolved as operator %c"> |
| 2342 | |
| 2343 | =item * |
| 2344 | |
| 2345 | L<Ambiguous use of %c{%s} resolved to %c%s|perldiag/"Ambiguous use of %c{%s} resolved to %c%s"> |
| 2346 | |
| 2347 | =item * |
| 2348 | |
| 2349 | L<Ambiguous use of %c{%s[...]} resolved to %c%s[...]|perldiag/"Ambiguous use of %c{%s[...]} resolved to %c%s[...]"> |
| 2350 | |
| 2351 | =item * |
| 2352 | |
| 2353 | L<Ambiguous use of %c{%s{...}} resolved to %c%s{...}|perldiag/"Ambiguous use of %c{%s{...}} resolved to %c%s{...}"> |
| 2354 | |
| 2355 | =item * |
| 2356 | |
| 2357 | L<Ambiguous use of -%s resolved as -&%s()|perldiag/"Ambiguous use of -%s resolved as -&%s()"> |
| 2358 | |
| 2359 | =item * |
| 2360 | |
| 2361 | L<Invalid strict version format (%s)|perldiag/"Invalid strict version format (%s)"> |
| 2362 | |
| 2363 | =item * |
| 2364 | |
| 2365 | L<Invalid version format (%s)|perldiag/"Invalid version format (%s)"> |
| 2366 | |
| 2367 | =item * |
| 2368 | |
| 2369 | L<Invalid version object|perldiag/"Invalid version object"> |
| 2370 | |
| 2371 | =back |
| 2372 | |
| 2373 | =head3 L<perlbook> |
| 2374 | |
| 2375 | L<perlbook> has been expanded to cover many more popular books. |
| 2376 | |
| 2377 | =head3 C<SvTRUE> macro |
| 2378 | |
| 2379 | The documentation for the C<SvTRUE> macro in |
| 2380 | L<perlapi> was simply wrong in stating that |
| 2381 | get-magic is not processed. It has been corrected. |
| 2382 | |
| 2383 | =head3 op manipulation functions |
| 2384 | |
| 2385 | Several API functions that process optrees have been newly documented. |
| 2386 | |
| 2387 | =head3 L<perlvar> revamp |
| 2388 | |
| 2389 | L<perlvar> reorders the variables and groups them by topic. Each variable |
| 2390 | introduced after Perl 5.000 notes the first version in which it is |
| 2391 | available. L<perlvar> also has a new section for deprecated variables to |
| 2392 | note when they were removed. |
| 2393 | |
| 2394 | =head3 Array and hash slices in scalar context |
| 2395 | |
| 2396 | These are now documented in L<perldata>. |
| 2397 | |
| 2398 | =head3 C<use locale> and formats |
| 2399 | |
| 2400 | L<perlform> and L<perllocale> have been corrected to state that |
| 2401 | C<use locale> affects formats. |
| 2402 | |
| 2403 | =head3 L<overload> |
| 2404 | |
| 2405 | L<overload>'s documentation has practically undergone a rewrite. It |
| 2406 | is now much more straightforward and clear. |
| 2407 | |
| 2408 | =head3 perlhack and perlrepository revamp |
| 2409 | |
| 2410 | The L<perlhack> document is now much shorter, and focuses on the Perl 5 |
| 2411 | development process and submitting patches to Perl. The technical content |
| 2412 | has been moved to several new documents, L<perlsource>, L<perlinterp>, |
| 2413 | L<perlhacktut>, and L<perlhacktips>. This technical content has |
| 2414 | been only lightly edited. |
| 2415 | |
| 2416 | The perlrepository document has been renamed to L<perlgit>. This new |
| 2417 | document is just a how-to on using git with the Perl source code. |
| 2418 | Any other content that used to be in perlrepository has been moved |
| 2419 | to L<perlhack>. |
| 2420 | |
| 2421 | =head3 Time::Piece examples |
| 2422 | |
| 2423 | Examples in L<perlfaq4> have been updated to show the use of |
| 2424 | L<Time::Piece>. |
| 2425 | |
| 2426 | =head1 Diagnostics |
| 2427 | |
| 2428 | The following additions or changes have been made to diagnostic output, |
| 2429 | including warnings and fatal error messages. For the complete list of |
| 2430 | diagnostic messages, see L<perldiag>. |
| 2431 | |
| 2432 | =head2 New Diagnostics |
| 2433 | |
| 2434 | =head3 New Errors |
| 2435 | |
| 2436 | =over |
| 2437 | |
| 2438 | =item Closure prototype called |
| 2439 | |
| 2440 | This error occurs when a subroutine reference passed to an attribute |
| 2441 | handler is called, if the subroutine is a closure [perl #68560]. |
| 2442 | |
| 2443 | =item Insecure user-defined property %s |
| 2444 | |
| 2445 | Perl detected tainted data when trying to compile a regular |
| 2446 | expression that contains a call to a user-defined character property |
| 2447 | function, meaning C<\p{IsFoo}> or C<\p{InFoo}>. |
| 2448 | See L<perlunicode/User-Defined Character Properties> and L<perlsec>. |
| 2449 | |
| 2450 | =item panic: gp_free failed to free glob pointer - something is repeatedly re-creating entries |
| 2451 | |
| 2452 | This new error is triggered if a destructor called on an object in a |
| 2453 | typeglob that is being freed creates a new typeglob entry containing an |
| 2454 | object with a destructor that creates a new entry containing an object etc. |
| 2455 | |
| 2456 | =item Parsing code internal error (%s) |
| 2457 | |
| 2458 | This new fatal error is produced when parsing |
| 2459 | code supplied by an extension violates the |
| 2460 | parser's API in a detectable way. |
| 2461 | |
| 2462 | =item refcnt: fd %d%s |
| 2463 | |
| 2464 | This new error only occurs if an internal consistency check fails when a |
| 2465 | pipe is about to be closed. |
| 2466 | |
| 2467 | =item Regexp modifier "/%c" may not appear twice |
| 2468 | |
| 2469 | The regular expression pattern has one of the |
| 2470 | mutually exclusive modifiers repeated. |
| 2471 | |
| 2472 | =item Regexp modifiers "/%c" and "/%c" are mutually exclusive |
| 2473 | |
| 2474 | The regular expression pattern has more than one of the mutually |
| 2475 | exclusive modifiers. |
| 2476 | |
| 2477 | =item Using !~ with %s doesn't make sense |
| 2478 | |
| 2479 | This error occurs when C<!~> is used with C<s///r> or C<y///r>. |
| 2480 | |
| 2481 | =back |
| 2482 | |
| 2483 | =head3 New Warnings |
| 2484 | |
| 2485 | =over |
| 2486 | |
| 2487 | =item "\b{" is deprecated; use "\b\{" instead |
| 2488 | |
| 2489 | =item "\B{" is deprecated; use "\B\{" instead |
| 2490 | |
| 2491 | Use of an unescaped "{" immediately following a C<\b> or C<\B> is now |
| 2492 | deprecated in order to reserve its use for Perl itself in a future release. |
| 2493 | |
| 2494 | =item Operation "%s" returns its argument for ... |
| 2495 | |
| 2496 | Performing an operation requiring Unicode semantics (such as case-folding) |
| 2497 | on a Unicode surrogate or a non-Unicode character now triggers this |
| 2498 | warning. |
| 2499 | |
| 2500 | =item Use of qw(...) as parentheses is deprecated |
| 2501 | |
| 2502 | See L</"Use of qw(...) as parentheses">, above, for details. |
| 2503 | |
| 2504 | =back |
| 2505 | |
| 2506 | =head2 Changes to Existing Diagnostics |
| 2507 | |
| 2508 | =over 4 |
| 2509 | |
| 2510 | =item * |
| 2511 | |
| 2512 | The "Variable $foo is not imported" warning that precedes a |
| 2513 | C<strict 'vars'> error has now been assigned the "misc" category, so that |
| 2514 | C<no warnings> will suppress it [perl #73712]. |
| 2515 | |
| 2516 | =item * |
| 2517 | |
| 2518 | warn() and die() now produce "Wide character" warnings when fed a |
| 2519 | character outside the byte range if C<STDERR> is a byte-sized handle. |
| 2520 | |
| 2521 | =item * |
| 2522 | |
| 2523 | The "Layer does not match this perl" error message has been replaced with |
| 2524 | these more helpful messages [perl #73754]: |
| 2525 | |
| 2526 | =over 4 |
| 2527 | |
| 2528 | =item * |
| 2529 | |
| 2530 | PerlIO layer function table size (%d) does not match size expected by this |
| 2531 | perl (%d) |
| 2532 | |
| 2533 | =item * |
| 2534 | |
| 2535 | PerlIO layer instance size (%d) does not match size expected by this perl |
| 2536 | (%d) |
| 2537 | |
| 2538 | =back |
| 2539 | |
| 2540 | =item * |
| 2541 | |
| 2542 | The "Found = in conditional" warning that is emitted when a constant is |
| 2543 | assigned to a variable in a condition is now withheld if the constant is |
| 2544 | actually a subroutine or one generated by C<use constant>, since the value |
| 2545 | of the constant may not be known at the time the program is written |
| 2546 | [perl #77762]. |
| 2547 | |
| 2548 | =item * |
| 2549 | |
| 2550 | Previously, if none of the gethostbyaddr(), gethostbyname() and |
| 2551 | gethostent() functions were implemented on a given platform, they would |
| 2552 | all die with the message "Unsupported socket function 'gethostent' called", |
| 2553 | with analogous messages for getnet*() and getserv*(). This has been |
| 2554 | corrected. |
| 2555 | |
| 2556 | =item * |
| 2557 | |
| 2558 | The warning message about unrecognized regular expression escapes passed |
| 2559 | through has been changed to include any literal "{" following the |
| 2560 | two-character escape. For example, "\q{" is now emitted instead of "\q". |
| 2561 | |
| 2562 | =back |
| 2563 | |
| 2564 | =head1 Utility Changes |
| 2565 | |
| 2566 | =head3 L<perlbug(1)> |
| 2567 | |
| 2568 | =over 4 |
| 2569 | |
| 2570 | =item * |
| 2571 | |
| 2572 | L<perlbug> now looks in the EMAIL environment variable for a return address |
| 2573 | if the REPLY-TO and REPLYTO variables are empty. |
| 2574 | |
| 2575 | =item * |
| 2576 | |
| 2577 | L<perlbug> did not previously generate a "From:" header, potentially |
| 2578 | resulting in dropped mail; it now includes that header. |
| 2579 | |
| 2580 | =item * |
| 2581 | |
| 2582 | The user's address is now used as the Return-Path. |
| 2583 | |
| 2584 | Many systems these days don't have a valid Internet domain name, and |
| 2585 | perlbug@perl.org does not accept email with a return-path that does |
| 2586 | not resolve. So the user's address is now passed to sendmail so it's |
| 2587 | less likely to get stuck in a mail queue somewhere [perl #82996]. |
| 2588 | |
| 2589 | =item * |
| 2590 | |
| 2591 | L<perlbug> now always gives the reporter a chance to change the email |
| 2592 | address it guesses for them (5.12.2). |
| 2593 | |
| 2594 | =item * |
| 2595 | |
| 2596 | L<perlbug> should no longer warn about uninitialized values when using the B<-d> |
| 2597 | and B<-v> options (5.12.2). |
| 2598 | |
| 2599 | =back |
| 2600 | |
| 2601 | =head3 L<perl5db.pl> |
| 2602 | |
| 2603 | =over |
| 2604 | |
| 2605 | =item * |
| 2606 | |
| 2607 | The remote terminal works after forking and spawns new sessions, one |
| 2608 | per forked process. |
| 2609 | |
| 2610 | =back |
| 2611 | |
| 2612 | =head3 L<ptargrep> |
| 2613 | |
| 2614 | =over 4 |
| 2615 | |
| 2616 | =item * |
| 2617 | |
| 2618 | L<ptargrep> is a new utility to apply pattern matching to the contents of |
| 2619 | files in a tar archive. It comes with C<Archive::Tar>. |
| 2620 | |
| 2621 | =back |
| 2622 | |
| 2623 | =head1 Configuration and Compilation |
| 2624 | |
| 2625 | See also L</"Naming fixes in Policy_sh.SH may invalidate Policy.sh">, |
| 2626 | above. |
| 2627 | |
| 2628 | =over 4 |
| 2629 | |
| 2630 | =item * |
| 2631 | |
| 2632 | CCINCDIR and CCLIBDIR for the mingw64 cross-compiler are now correctly |
| 2633 | under F<$(CCHOME)\mingw\include> and F<\lib> rather than immediately below |
| 2634 | F<$(CCHOME)>. |
| 2635 | |
| 2636 | This means the "incpath", "libpth", "ldflags", "lddlflags" and |
| 2637 | "ldflags_nolargefiles" values in F<Config.pm> and F<Config_heavy.pl> are now |
| 2638 | set correctly. |
| 2639 | |
| 2640 | =item * |
| 2641 | |
| 2642 | C<make test.valgrind> has been adjusted to account for F<cpan/dist/ext> |
| 2643 | separation. |
| 2644 | |
| 2645 | =item * |
| 2646 | |
| 2647 | On compilers that support it, B<-Wwrite-strings> is now added to cflags by |
| 2648 | default. |
| 2649 | |
| 2650 | =item * |
| 2651 | |
| 2652 | The L<Encode> module can now (once again) be included in a static Perl |
| 2653 | build. The special-case handling for this situation got broken in Perl |
| 2654 | 5.11.0, and has now been repaired. |
| 2655 | |
| 2656 | =item * |
| 2657 | |
| 2658 | The previous default size of a PerlIO buffer (4096 bytes) has been increased |
| 2659 | to the larger of 8192 bytes and your local BUFSIZ. Benchmarks show that doubling |
| 2660 | this decade-old default increases read and write performance by around |
| 2661 | 25% to 50% when using the default layers of perlio on top of unix. To choose |
| 2662 | a non-default size, such as to get back the old value or to obtain an even |
| 2663 | larger value, configure with: |
| 2664 | |
| 2665 | ./Configure -Accflags=-DPERLIOBUF_DEFAULT_BUFSIZ=N |
| 2666 | |
| 2667 | where N is the desired size in bytes; it should probably be a multiple of |
| 2668 | your page size. |
| 2669 | |
| 2670 | =item * |
| 2671 | |
| 2672 | An "incompatible operand types" error in ternary expressions when building |
| 2673 | with C<clang> has been fixed (5.12.2). |
| 2674 | |
| 2675 | =item * |
| 2676 | |
| 2677 | Perl now skips setuid L<File::Copy> tests on partitions it detects mounted |
| 2678 | as C<nosuid> (5.12.2). |
| 2679 | |
| 2680 | =back |
| 2681 | |
| 2682 | =head1 Platform Support |
| 2683 | |
| 2684 | =head2 New Platforms |
| 2685 | |
| 2686 | =over 4 |
| 2687 | |
| 2688 | =item AIX |
| 2689 | |
| 2690 | Perl now builds on AIX 4.2 (5.12.1). |
| 2691 | |
| 2692 | =back |
| 2693 | |
| 2694 | =head2 Discontinued Platforms |
| 2695 | |
| 2696 | =over 4 |
| 2697 | |
| 2698 | =item Apollo DomainOS |
| 2699 | |
| 2700 | The last vestiges of support for this platform have been excised from |
| 2701 | the Perl distribution. It was officially discontinued in version 5.12.0. |
| 2702 | It had not worked for years before that. |
| 2703 | |
| 2704 | =item MacOS Classic |
| 2705 | |
| 2706 | The last vestiges of support for this platform have been excised from the |
| 2707 | Perl distribution. It was officially discontinued in an earlier version. |
| 2708 | |
| 2709 | =back |
| 2710 | |
| 2711 | =head2 Platform-Specific Notes |
| 2712 | |
| 2713 | =head3 AIX |
| 2714 | |
| 2715 | =over |
| 2716 | |
| 2717 | =item * |
| 2718 | |
| 2719 | F<README.aix> has been updated with information about the XL C/C++ V11 compiler |
| 2720 | suite (5.12.2). |
| 2721 | |
| 2722 | =back |
| 2723 | |
| 2724 | =head3 ARM |
| 2725 | |
| 2726 | =over |
| 2727 | |
| 2728 | =item * |
| 2729 | |
| 2730 | The C<d_u32align> configuration probe on ARM has been fixed (5.12.2). |
| 2731 | |
| 2732 | =back |
| 2733 | |
| 2734 | =head3 Cygwin |
| 2735 | |
| 2736 | =over 4 |
| 2737 | |
| 2738 | =item * |
| 2739 | |
| 2740 | L<MakeMaker> has been updated to build manpages on cygwin. |
| 2741 | |
| 2742 | =item * |
| 2743 | |
| 2744 | Improved rebase behaviour |
| 2745 | |
| 2746 | If a DLL is updated on cygwin the old imagebase address is reused. |
| 2747 | This solves most rebase errors, especially when updating on core DLL's. |
| 2748 | See L<http://www.tishler.net/jason/software/rebase/rebase-2.4.2.README> |
| 2749 | for more information. |
| 2750 | |
| 2751 | =item * |
| 2752 | |
| 2753 | Support for the standard cygwin dll prefix (needed for FFIs) |
| 2754 | |
| 2755 | =item * |
| 2756 | |
| 2757 | Updated build hints file |
| 2758 | |
| 2759 | =back |
| 2760 | |
| 2761 | =head3 FreeBSD 7 |
| 2762 | |
| 2763 | =over |
| 2764 | |
| 2765 | =item * |
| 2766 | |
| 2767 | FreeBSD 7 no longer contains F</usr/bin/objformat>. At build time, |
| 2768 | Perl now skips the F<objformat> check for versions 7 and higher and |
| 2769 | assumes ELF (5.12.1). |
| 2770 | |
| 2771 | =back |
| 2772 | |
| 2773 | =head3 HP-UX |
| 2774 | |
| 2775 | =over |
| 2776 | |
| 2777 | =item * |
| 2778 | |
| 2779 | Perl now allows B<-Duse64bitint> without promoting to C<use64bitall> on HP-UX |
| 2780 | (5.12.1). |
| 2781 | |
| 2782 | =back |
| 2783 | |
| 2784 | =head3 IRIX |
| 2785 | |
| 2786 | =over |
| 2787 | |
| 2788 | =item * |
| 2789 | |
| 2790 | Conversion of strings to floating-point numbers is now more accurate on |
| 2791 | IRIX systems [perl #32380]. |
| 2792 | |
| 2793 | =back |
| 2794 | |
| 2795 | =head3 Mac OS X |
| 2796 | |
| 2797 | =over |
| 2798 | |
| 2799 | =item * |
| 2800 | |
| 2801 | Early versions of Mac OS X (Darwin) had buggy implementations of the |
| 2802 | setregid(), setreuid(), setrgid(,) and setruid() functions, so Perl |
| 2803 | would pretend they did not exist. |
| 2804 | |
| 2805 | These functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and |
| 2806 | higher, as they have been fixed [perl #72990]. |
| 2807 | |
| 2808 | =back |
| 2809 | |
| 2810 | =head3 MirBSD |
| 2811 | |
| 2812 | =over |
| 2813 | |
| 2814 | =item * |
| 2815 | |
| 2816 | Previously if you built Perl with a shared F<libperl.so> on MirBSD (the |
| 2817 | default config), it would work up to the installation; however, once |
| 2818 | installed, it would be unable to find F<libperl>. Path handling is now |
| 2819 | treated as in the other BSD dialects. |
| 2820 | |
| 2821 | =back |
| 2822 | |
| 2823 | =head3 NetBSD |
| 2824 | |
| 2825 | =over |
| 2826 | |
| 2827 | =item * |
| 2828 | |
| 2829 | The NetBSD hints file has been changed to make the system malloc the |
| 2830 | default. |
| 2831 | |
| 2832 | =back |
| 2833 | |
| 2834 | =head3 OpenBSD |
| 2835 | |
| 2836 | =over |
| 2837 | |
| 2838 | =item * |
| 2839 | |
| 2840 | OpenBSD E<gt> 3.7 has a new malloc implementation which is I<mmap>-based, |
| 2841 | and as such can release memory back to the OS; however, Perl's use of |
| 2842 | this malloc causes a substantial slowdown, so we now default to using |
| 2843 | Perl's malloc instead [perl #75742]. |
| 2844 | |
| 2845 | =back |
| 2846 | |
| 2847 | =head3 OpenVOS |
| 2848 | |
| 2849 | =over |
| 2850 | |
| 2851 | =item * |
| 2852 | |
| 2853 | Perl now builds again with OpenVOS (formerly known as Stratus VOS) |
| 2854 | [perl #78132] (5.12.3). |
| 2855 | |
| 2856 | =back |
| 2857 | |
| 2858 | =head3 Solaris |
| 2859 | |
| 2860 | =over |
| 2861 | |
| 2862 | =item * |
| 2863 | |
| 2864 | DTrace is now supported on Solaris. There used to be build failures, but |
| 2865 | these have been fixed [perl #73630] (5.12.3). |
| 2866 | |
| 2867 | =back |
| 2868 | |
| 2869 | =head3 VMS |
| 2870 | |
| 2871 | =over |
| 2872 | |
| 2873 | =item * |
| 2874 | |
| 2875 | Extension building on older (pre 7.3-2) VMS systems was broken because |
| 2876 | configure.com hit the DCL symbol length limit of 1K. We now work within |
| 2877 | this limit when assembling the list of extensions in the core build (5.12.1). |
| 2878 | |
| 2879 | =item * |
| 2880 | |
| 2881 | We fixed configuring and building Perl with B<-Uuseperlio> (5.12.1). |
| 2882 | |
| 2883 | =item * |
| 2884 | |
| 2885 | C<PerlIOUnix_open> now honours the default permissions on VMS. |
| 2886 | |
| 2887 | When C<perlio> became the default and C<unix> became the default bottom layer, |
| 2888 | the most common path for creating files from Perl became C<PerlIOUnix_open>, |
| 2889 | which has always explicitly used C<0666> as the permission mask. This prevents |
| 2890 | inheriting permissions from RMS defaults and ACLs, so to avoid that problem, |
| 2891 | we now pass C<0777> to open(). In the VMS CRTL, C<0777> has a special |
| 2892 | meaning over and above intersecting with the current umask; specifically, it |
| 2893 | allows Unix syscalls to preserve native default permissions (5.12.3). |
| 2894 | |
| 2895 | =item * |
| 2896 | |
| 2897 | The shortening of symbols longer than 31 characters in the core C sources |
| 2898 | and in extensions is now by default done by the C compiler rather than by |
| 2899 | xsubpp (which could only do so for generated symbols in XS code). You can |
| 2900 | reenable xsubpp's symbol shortening by configuring with -Uuseshortenedsymbols, |
| 2901 | but you'll have some work to do to get the core sources to compile. |
| 2902 | |
| 2903 | =item * |
| 2904 | |
| 2905 | Record-oriented files (record format variable or variable with fixed control) |
| 2906 | opened for write by the C<perlio> layer will now be line-buffered to prevent the |
| 2907 | introduction of spurious line breaks whenever the perlio buffer fills up. |
| 2908 | |
| 2909 | =item * |
| 2910 | |
| 2911 | F<git_version.h> is now installed on VMS. This was an oversight in v5.12.0 which |
| 2912 | caused some extensions to fail to build (5.12.2). |
| 2913 | |
| 2914 | =item * |
| 2915 | |
| 2916 | Several memory leaks in L<stat()|perlfunc/"stat FILEHANDLE"> have been fixed (5.12.2). |
| 2917 | |
| 2918 | =item * |
| 2919 | |
| 2920 | A memory leak in Perl_rename() due to a double allocation has been |
| 2921 | fixed (5.12.2). |
| 2922 | |
| 2923 | =item * |
| 2924 | |
| 2925 | A memory leak in vms_fid_to_name() (used by realpath() and |
| 2926 | realname()> has been fixed (5.12.2). |
| 2927 | |
| 2928 | =back |
| 2929 | |
| 2930 | =head3 Windows |
| 2931 | |
| 2932 | See also L</"fork() emulation will not wait for signalled children"> and |
| 2933 | L</"Perl source code is read in text mode on Windows">, above. |
| 2934 | |
| 2935 | =over 4 |
| 2936 | |
| 2937 | =item * |
| 2938 | |
| 2939 | Fixed build process for SDK2003SP1 compilers. |
| 2940 | |
| 2941 | =item * |
| 2942 | |
| 2943 | Compilation with Visual Studio 2010 is now supported. |
| 2944 | |
| 2945 | =item * |
| 2946 | |
| 2947 | When using old 32-bit compilers, the define C<_USE_32BIT_TIME_T> is now |
| 2948 | set in C<$Config{ccflags}>. This improves portability when compiling |
| 2949 | XS extensions using new compilers, but for a Perl compiled with old 32-bit |
| 2950 | compilers. |
| 2951 | |
| 2952 | =item * |
| 2953 | |
| 2954 | C<$Config{gccversion}> is now set correctly when Perl is built using the |
| 2955 | mingw64 compiler from L<http://mingw64.org> [perl #73754]. |
| 2956 | |
| 2957 | =item * |
| 2958 | |
| 2959 | When building Perl with the mingw64 x64 cross-compiler C<incpath>, |
| 2960 | C<libpth>, C<ldflags>, C<lddlflags> and C<ldflags_nolargefiles> values |
| 2961 | in F<Config.pm> and F<Config_heavy.pl> were not previously being set |
| 2962 | correctly because, with that compiler, the include and lib directories |
| 2963 | are not immediately below C<$(CCHOME)> (5.12.2). |
| 2964 | |
| 2965 | =item * |
| 2966 | |
| 2967 | The build process proceeds more smoothly with mingw and dmake when |
| 2968 | F<C:\MSYS\bin> is in the PATH, due to a C<Cwd> fix. |
| 2969 | |
| 2970 | =item * |
| 2971 | |
| 2972 | Support for building with Visual C++ 2010 is now underway, but is not yet |
| 2973 | complete. See F<README.win32> or L<perlwin32> for more details. |
| 2974 | |
| 2975 | =item * |
| 2976 | |
| 2977 | The option to use an externally-supplied crypt(), or to build with no |
| 2978 | crypt() at all, has been removed. Perl supplies its own crypt() |
| 2979 | implementation for Windows, and the political situation that required |
| 2980 | this part of the distribution to sometimes be omitted is long gone. |
| 2981 | |
| 2982 | =back |
| 2983 | |
| 2984 | =head1 Internal Changes |
| 2985 | |
| 2986 | =head2 New APIs |
| 2987 | |
| 2988 | =head3 CLONE_PARAMS structure added to ease correct thread creation |
| 2989 | |
| 2990 | Modules that create threads should now create C<CLONE_PARAMS> structures |
| 2991 | by calling the new function Perl_clone_params_new(), and free them with |
| 2992 | Perl_clone_params_del(). This will ensure compatibility with any future |
| 2993 | changes to the internals of the C<CLONE_PARAMS> structure layout, and that |
| 2994 | it is correctly allocated and initialised. |
| 2995 | |
| 2996 | =head3 New parsing functions |
| 2997 | |
| 2998 | Several functions have been added for parsing Perl statements and |
| 2999 | expressions. These functions are meant to be used by XS code invoked |
| 3000 | during Perl parsing, in a recursive-descent manner, to allow modules to |
| 3001 | augment the standard Perl syntax. |
| 3002 | |
| 3003 | =over |
| 3004 | |
| 3005 | =item * |
| 3006 | |
| 3007 | L<parse_stmtseq()|perlapi/parse_stmtseq> |
| 3008 | parses a sequence of statements, up to closing brace or EOF. |
| 3009 | |
| 3010 | =item * |
| 3011 | |
| 3012 | L<parse_fullstmt()|perlapi/parse_fullstmt> |
| 3013 | parses a complete Perl statement, including optional label. |
| 3014 | |
| 3015 | =item * |
| 3016 | |
| 3017 | L<parse_barestmt()|perlapi/parse_barestmt> |
| 3018 | parses a statement without a label. |
| 3019 | |
| 3020 | =item * |
| 3021 | |
| 3022 | L<parse_block()|perlapi/parse_block> |
| 3023 | parses a code block. |
| 3024 | |
| 3025 | =item * |
| 3026 | |
| 3027 | L<parse_label()|perlapi/parse_label> |
| 3028 | parses a statement label, separate from statements. |
| 3029 | |
| 3030 | =item * |
| 3031 | |
| 3032 | L<C<parse_fullexpr()>|perlapi/parse_fullexpr>, |
| 3033 | L<C<parse_listexpr()>|perlapi/parse_listexpr>, |
| 3034 | L<C<parse_termexpr()>|perlapi/parse_termexpr>, and |
| 3035 | L<C<parse_arithexpr()>|perlapi/parse_arithexpr> |
| 3036 | parse expressions at various precedence levels. |
| 3037 | |
| 3038 | =back |
| 3039 | |
| 3040 | =head3 Hints hash API |
| 3041 | |
| 3042 | A new C API for introspecting the hinthash C<%^H> at runtime has been |
| 3043 | added. See C<cop_hints_2hv>, C<cop_hints_fetchpvn>, C<cop_hints_fetchpvs>, |
| 3044 | C<cop_hints_fetchsv>, and C<hv_copy_hints_hv> in L<perlapi> for details. |
| 3045 | |
| 3046 | A new, experimental API has been added for accessing the internal |
| 3047 | structure that Perl uses for C<%^H>. See the functions beginning with |
| 3048 | C<cophh_> in L<perlapi>. |
| 3049 | |
| 3050 | =head3 C interface to caller() |
| 3051 | |
| 3052 | The C<caller_cx> function has been added as an XSUB-writer's equivalent of |
| 3053 | caller(). See L<perlapi> for details. |
| 3054 | |
| 3055 | =head3 Custom per-subroutine check hooks |
| 3056 | |
| 3057 | XS code in an extension module can now annotate a subroutine (whether |
| 3058 | implemented in XS or in Perl) so that nominated XS code will be called |
| 3059 | at compile time (specifically as part of op checking) to change the op |
| 3060 | tree of that subroutine. The compile-time check function (supplied by |
| 3061 | the extension module) can implement argument processing that can't be |
| 3062 | expressed as a prototype, generate customised compile-time warnings, |
| 3063 | perform constant folding for a pure function, inline a subroutine |
| 3064 | consisting of sufficiently simple ops, replace the whole call with a |
| 3065 | custom op, and so on. This was previously all possible by hooking the |
| 3066 | C<entersub> op checker, but the new mechanism makes it easy to tie the |
| 3067 | hook to a specific subroutine. See L<perlapi/cv_set_call_checker>. |
| 3068 | |
| 3069 | To help in writing custom check hooks, several subtasks within standard |
| 3070 | C<entersub> op checking have been separated out and exposed in the API. |
| 3071 | |
| 3072 | =head3 Improved support for custom OPs |
| 3073 | |
| 3074 | Custom ops can now be registered with the new C<custom_op_register> C |
| 3075 | function and the C<XOP> structure. This will make it easier to add new |
| 3076 | properties of custom ops in the future. Two new properties have been added |
| 3077 | already, C<xop_class> and C<xop_peep>. |
| 3078 | |
| 3079 | C<xop_class> is one of the OA_*OP constants. It allows L<B> and other |
| 3080 | introspection mechanisms to work with custom ops |
| 3081 | that aren't BASEOPs. C<xop_peep> is a pointer to |
| 3082 | a function that will be called for ops of this |
| 3083 | type from C<Perl_rpeep>. |
| 3084 | |
| 3085 | See L<perlguts/Custom Operators> and L<perlapi/Custom Operators> for more |
| 3086 | detail. |
| 3087 | |
| 3088 | The old C<PL_custom_op_names>/C<PL_custom_op_descs> interface is still |
| 3089 | supported but discouraged. |
| 3090 | |
| 3091 | =head3 Scope hooks |
| 3092 | |
| 3093 | It is now possible for XS code to hook into Perl's lexical scope |
| 3094 | mechanism at compile time, using the new C<Perl_blockhook_register> |
| 3095 | function. See L<perlguts/"Compile-time scope hooks">. |
| 3096 | |
| 3097 | =head3 The recursive part of the peephole optimizer is now hookable |
| 3098 | |
| 3099 | In addition to C<PL_peepp>, for hooking into the toplevel peephole optimizer, a |
| 3100 | C<PL_rpeepp> is now available to hook into the optimizer recursing into |
| 3101 | side-chains of the optree. |
| 3102 | |
| 3103 | =head3 New non-magical variants of existing functions |
| 3104 | |
| 3105 | The following functions/macros have been added to the API. The C<*_nomg> |
| 3106 | macros are equivalent to their non-C<_nomg> variants, except that they ignore |
| 3107 | get-magic. Those ending in C<_flags> allow one to specify whether |
| 3108 | get-magic is processed. |
| 3109 | |
| 3110 | sv_2bool_flags |
| 3111 | SvTRUE_nomg |
| 3112 | sv_2nv_flags |
| 3113 | SvNV_nomg |
| 3114 | sv_cmp_flags |
| 3115 | sv_cmp_locale_flags |
| 3116 | sv_eq_flags |
| 3117 | sv_collxfrm_flags |
| 3118 | |
| 3119 | In some of these cases, the non-C<_flags> functions have |
| 3120 | been replaced with wrappers around the new functions. |
| 3121 | |
| 3122 | =head3 pv/pvs/sv versions of existing functions |
| 3123 | |
| 3124 | Many functions ending with pvn now have equivalent C<pv/pvs/sv> versions. |
| 3125 | |
| 3126 | =head3 List op-building functions |
| 3127 | |
| 3128 | List op-building functions have been added to the |
| 3129 | API. See L<op_append_elem|perlapi/op_append_elem>, |
| 3130 | L<op_append_list|perlapi/op_append_list>, and |
| 3131 | L<op_prepend_elem|perlapi/op_prepend_elem> in L<perlapi>. |
| 3132 | |
| 3133 | =head3 C<LINKLIST> |
| 3134 | |
| 3135 | The L<LINKLIST|perlapi/LINKLIST> macro, part of op building that |
| 3136 | constructs the execution-order op chain, has been added to the API. |
| 3137 | |
| 3138 | =head3 Localisation functions |
| 3139 | |
| 3140 | The C<save_freeop>, C<save_op>, C<save_pushi32ptr> and C<save_pushptrptr> |
| 3141 | functions have been added to the API. |
| 3142 | |
| 3143 | =head3 Stash names |
| 3144 | |
| 3145 | A stash can now have a list of effective names in addition to its usual |
| 3146 | name. The first effective name can be accessed via the C<HvENAME> macro, |
| 3147 | which is now the recommended name to use in MRO linearisations (C<HvNAME> |
| 3148 | being a fallback if there is no C<HvENAME>). |
| 3149 | |
| 3150 | These names are added and deleted via C<hv_ename_add> and |
| 3151 | C<hv_ename_delete>. These two functions are I<not> part of the API. |
| 3152 | |
| 3153 | =head3 New functions for finding and removing magic |
| 3154 | |
| 3155 | The L<C<mg_findext()>|perlapi/mg_findext> and |
| 3156 | L<C<sv_unmagicext()>|perlapi/sv_unmagicext> |
| 3157 | functions have been added to the API. |
| 3158 | They allow extension authors to find and remove magic attached to |
| 3159 | scalars based on both the magic type and the magic virtual table, similar to how |
| 3160 | sv_magicext() attaches magic of a certain type and with a given virtual table |
| 3161 | to a scalar. This eliminates the need for extensions to walk the list of |
| 3162 | C<MAGIC> pointers of an C<SV> to find the magic that belongs to them. |
| 3163 | |
| 3164 | =head3 C<find_rundefsv> |
| 3165 | |
| 3166 | This function returns the SV representing C<$_>, whether it's lexical |
| 3167 | or dynamic. |
| 3168 | |
| 3169 | =head3 C<Perl_croak_no_modify> |
| 3170 | |
| 3171 | Perl_croak_no_modify() is short-hand for |
| 3172 | C<Perl_croak("%s", PL_no_modify)>. |
| 3173 | |
| 3174 | =head3 C<PERL_STATIC_INLINE> define |
| 3175 | |
| 3176 | The C<PERL_STATIC_INLINE> define has been added to provide the best-guess |
| 3177 | incantation to use for static inline functions, if the C compiler supports |
| 3178 | C99-style static inline. If it doesn't, it'll give a plain C<static>. |
| 3179 | |
| 3180 | C<HAS_STATIC_INLINE> can be used to check if the compiler actually supports |
| 3181 | inline functions. |
| 3182 | |
| 3183 | =head3 New C<pv_escape> option for hexadecimal escapes |
| 3184 | |
| 3185 | A new option, C<PERL_PV_ESCAPE_NONASCII>, has been added to C<pv_escape> to |
| 3186 | dump all characters above ASCII in hexadecimal. Before, one could get all |
| 3187 | characters as hexadecimal or the Latin1 non-ASCII as octal. |
| 3188 | |
| 3189 | =head3 C<lex_start> |
| 3190 | |
| 3191 | C<lex_start> has been added to the API, but is considered experimental. |
| 3192 | |
| 3193 | =head3 op_scope() and op_lvalue() |
| 3194 | |
| 3195 | The op_scope() and op_lvalue() functions have been added to the API, |
| 3196 | but are considered experimental. |
| 3197 | |
| 3198 | =head2 C API Changes |
| 3199 | |
| 3200 | =head3 C<PERL_POLLUTE> has been removed |
| 3201 | |
| 3202 | The option to define C<PERL_POLLUTE> to expose older 5.005 symbols for |
| 3203 | backwards compatibility has been removed. Its use was always discouraged, |
| 3204 | and MakeMaker contains a more specific escape hatch: |
| 3205 | |
| 3206 | perl Makefile.PL POLLUTE=1 |
| 3207 | |
| 3208 | This can be used for modules that have not been upgraded to 5.6 naming |
| 3209 | conventions (and really should be completely obsolete by now). |
| 3210 | |
| 3211 | =head3 Check API compatibility when loading XS modules |
| 3212 | |
| 3213 | When Perl's API changes in incompatible ways (which usually happens between |
| 3214 | major releases), XS modules compiled for previous versions of Perl will no |
| 3215 | longer work. They need to be recompiled against the new Perl. |
| 3216 | |
| 3217 | The C<XS_APIVERSION_BOOTCHECK> macro has been added to ensure that modules |
| 3218 | are recompiled and to prevent users from accidentally loading modules |
| 3219 | compiled for old perls into newer perls. That macro, which is called when |
| 3220 | loading every newly compiled extension, compares the API version of the |
| 3221 | running perl with the version a module has been compiled for and raises an |
| 3222 | exception if they don't match. |
| 3223 | |
| 3224 | =head3 Perl_fetch_cop_label |
| 3225 | |
| 3226 | The first argument of the C API function C<Perl_fetch_cop_label> has changed |
| 3227 | from C<struct refcounted_he *> to C<COP *>, to insulate the user from |
| 3228 | implementation details. |
| 3229 | |
| 3230 | This API function was marked as "may change", and likely isn't in use outside |
| 3231 | the core. (Neither an unpacked CPAN nor Google's codesearch finds any other |
| 3232 | references to it.) |
| 3233 | |
| 3234 | =head3 GvCV() and GvGP() are no longer lvalues |
| 3235 | |
| 3236 | The new GvCV_set() and GvGP_set() macros are now provided to replace |
| 3237 | assignment to those two macros. |
| 3238 | |
| 3239 | This allows a future commit to eliminate some backref magic between GV |
| 3240 | and CVs, which will require complete control over assignment to the |
| 3241 | C<gp_cv> slot. |
| 3242 | |
| 3243 | =head3 CvGV() is no longer an lvalue |
| 3244 | |
| 3245 | Under some circumstances, the CvGV() field of a CV is now |
| 3246 | reference-counted. To ensure consistent behaviour, direct assignment to |
| 3247 | it, for example C<CvGV(cv) = gv> is now a compile-time error. A new macro, |
| 3248 | C<CvGV_set(cv,gv)> has been introduced to run this operation |
| 3249 | safely. Note that modification of this field is not part of the public |
| 3250 | API, regardless of this new macro (and despite its being listed in this section). |
| 3251 | |
| 3252 | =head3 CvSTASH() is no longer an lvalue |
| 3253 | |
| 3254 | The CvSTASH() macro can now only be used as an rvalue. CvSTASH_set() |
| 3255 | has been added to replace assignment to CvSTASH(). This is to ensure |
| 3256 | that backreferences are handled properly. These macros are not part of the |
| 3257 | API. |
| 3258 | |
| 3259 | =head3 Calling conventions for C<newFOROP> and C<newWHILEOP> |
| 3260 | |
| 3261 | The way the parser handles labels has been cleaned up and refactored. As a |
| 3262 | result, the newFOROP() constructor function no longer takes a parameter |
| 3263 | stating what label is to go in the state op. |
| 3264 | |
| 3265 | The newWHILEOP() and newFOROP() functions no longer accept a line |
| 3266 | number as a parameter. |
| 3267 | |
| 3268 | =head3 Flags passed to C<uvuni_to_utf8_flags> and C<utf8n_to_uvuni> |
| 3269 | |
| 3270 | Some of the flags parameters to uvuni_to_utf8_flags() and |
| 3271 | utf8n_to_uvuni() have changed. This is a result of Perl's now allowing |
| 3272 | internal storage and manipulation of code points that are problematic |
| 3273 | in some situations. Hence, the default actions for these functions has |
| 3274 | been complemented to allow these code points. The new flags are |
| 3275 | documented in L<perlapi>. Code that requires the problematic code |
| 3276 | points to be rejected needs to change to use the new flags. Some flag |
| 3277 | names are retained for backward source compatibility, though they do |
| 3278 | nothing, as they are now the default. However the flags |
| 3279 | C<UNICODE_ALLOW_FDD0>, C<UNICODE_ALLOW_FFFF>, C<UNICODE_ILLEGAL>, and |
| 3280 | C<UNICODE_IS_ILLEGAL> have been removed, as they stem from a |
| 3281 | fundamentally broken model of how the Unicode non-character code points |
| 3282 | should be handled, which is now described in |
| 3283 | L<perlunicode/Non-character code points>. See also the Unicode section |
| 3284 | under L</Selected Bug Fixes>. |
| 3285 | |
| 3286 | =head2 Deprecated C APIs |
| 3287 | |
| 3288 | =over |
| 3289 | |
| 3290 | =item C<Perl_ptr_table_clear> |
| 3291 | |
| 3292 | C<Perl_ptr_table_clear> is no longer part of Perl's public API. Calling it |
| 3293 | now generates a deprecation warning, and it will be removed in a future |
| 3294 | release. |
| 3295 | |
| 3296 | =item C<sv_compile_2op> |
| 3297 | |
| 3298 | The sv_compile_2op() API function is now deprecated. Searches suggest |
| 3299 | that nothing on CPAN is using it, so this should have zero impact. |
| 3300 | |
| 3301 | It attempted to provide an API to compile code down to an optree, but failed |
| 3302 | to bind correctly to lexicals in the enclosing scope. It's not possible to |
| 3303 | fix this problem within the constraints of its parameters and return value. |
| 3304 | |
| 3305 | =item C<find_rundefsvoffset> |
| 3306 | |
| 3307 | The C<find_rundefsvoffset> function has been deprecated. It appeared that |
| 3308 | its design was insufficient for reliably getting the lexical C<$_> at |
| 3309 | run-time. |
| 3310 | |
| 3311 | Use the new C<find_rundefsv> function or the C<UNDERBAR> macro |
| 3312 | instead. They directly return the right SV |
| 3313 | representing C<$_>, whether it's |
| 3314 | lexical or dynamic. |
| 3315 | |
| 3316 | =item C<CALL_FPTR> and C<CPERLscope> |
| 3317 | |
| 3318 | Those are left from an old implementation of C<MULTIPLICITY> using C++ objects, |
| 3319 | which was removed in Perl 5.8. Nowadays these macros do exactly nothing, so |
| 3320 | they shouldn't be used anymore. |
| 3321 | |
| 3322 | For compatibility, they are still defined for external C<XS> code. Only |
| 3323 | extensions defining C<PERL_CORE> must be updated now. |
| 3324 | |
| 3325 | =back |
| 3326 | |
| 3327 | =head2 Other Internal Changes |
| 3328 | |
| 3329 | =head3 Stack unwinding |
| 3330 | |
| 3331 | The protocol for unwinding the C stack at the last stage of a C<die> |
| 3332 | has changed how it identifies the target stack frame. This now uses |
| 3333 | a separate variable C<PL_restartjmpenv>, where previously it relied on |
| 3334 | the C<blk_eval.cur_top_env> pointer in the C<eval> context frame that |
| 3335 | has nominally just been discarded. This change means that code running |
| 3336 | during various stages of Perl-level unwinding no longer needs to take |
| 3337 | care to avoid destroying the ghost frame. |
| 3338 | |
| 3339 | =head3 Scope stack entries |
| 3340 | |
| 3341 | The format of entries on the scope stack has been changed, resulting in a |
| 3342 | reduction of memory usage of about 10%. In particular, the memory used by |
| 3343 | the scope stack to record each active lexical variable has been halved. |
| 3344 | |
| 3345 | =head3 Memory allocation for pointer tables |
| 3346 | |
| 3347 | Memory allocation for pointer tables has been changed. Previously |
| 3348 | C<Perl_ptr_table_store> allocated memory from the same arena system as |
| 3349 | C<SV> bodies and C<HE>s, with freed memory remaining bound to those arenas |
| 3350 | until interpreter exit. Now it allocates memory from arenas private to the |
| 3351 | specific pointer table, and that memory is returned to the system when |
| 3352 | C<Perl_ptr_table_free> is called. Additionally, allocation and release are |
| 3353 | both less CPU intensive. |
| 3354 | |
| 3355 | =head3 C<UNDERBAR> |
| 3356 | |
| 3357 | The C<UNDERBAR> macro now calls C<find_rundefsv>. C<dUNDERBAR> is now a |
| 3358 | noop but should still be used to ensure past and future compatibility. |
| 3359 | |
| 3360 | =head3 String comparison routines renamed |
| 3361 | |
| 3362 | The C<ibcmp_*> functions have been renamed and are now called C<foldEQ>, |
| 3363 | C<foldEQ_locale>, and C<foldEQ_utf8>. The old names are still available as |
| 3364 | macros. |
| 3365 | |
| 3366 | =head3 C<chop> and C<chomp> implementations merged |
| 3367 | |
| 3368 | The opcode bodies for C<chop> and C<chomp> and for C<schop> and C<schomp> |
| 3369 | have been merged. The implementation functions Perl_do_chop() and |
| 3370 | Perl_do_chomp(), never part of the public API, have been merged and |
| 3371 | moved to a static function in F<pp.c>. This shrinks the Perl binary |
| 3372 | slightly, and should not affect any code outside the core (unless it is |
| 3373 | relying on the order of side-effects when C<chomp> is passed a I<list> of |
| 3374 | values). |
| 3375 | |
| 3376 | =head1 Selected Bug Fixes |
| 3377 | |
| 3378 | =head2 I/O |
| 3379 | |
| 3380 | =over 4 |
| 3381 | |
| 3382 | =item * |
| 3383 | |
| 3384 | Perl no longer produces this warning: |
| 3385 | |
| 3386 | $ perl -we 'open(my $f, ">", \my $x); binmode($f, "scalar")' |
| 3387 | Use of uninitialized value in binmode at -e line 1. |
| 3388 | |
| 3389 | =item * |
| 3390 | |
| 3391 | Opening a glob reference via C<< open($fh, ">", \*glob) >> no longer |
| 3392 | causes the glob to be corrupted when the filehandle is printed to. This would |
| 3393 | cause Perl to crash whenever the glob's contents were accessed |
| 3394 | [perl #77492]. |
| 3395 | |
| 3396 | =item * |
| 3397 | |
| 3398 | PerlIO no longer crashes when called recursively, such as from a signal |
| 3399 | handler. Now it just leaks memory [perl #75556]. |
| 3400 | |
| 3401 | =item * |
| 3402 | |
| 3403 | Most I/O functions were not warning for unopened handles unless the |
| 3404 | "closed" and "unopened" warnings categories were both enabled. Now only |
| 3405 | C<use warnings 'unopened'> is necessary to trigger these warnings, as |
| 3406 | had always been the intention. |
| 3407 | |
| 3408 | =item * |
| 3409 | |
| 3410 | There have been several fixes to PerlIO layers: |
| 3411 | |
| 3412 | When C<binmode(FH, ":crlf")> pushes the C<:crlf> layer on top of the stack, |
| 3413 | it no longer enables crlf layers lower in the stack so as to avoid |
| 3414 | unexpected results [perl #38456]. |
| 3415 | |
| 3416 | Opening a file in C<:raw> mode now does what it advertises to do (first |
| 3417 | open the file, then C<binmode> it), instead of simply leaving off the top |
| 3418 | layer [perl #80764]. |
| 3419 | |
| 3420 | The three layers C<:pop>, C<:utf8>, and C<:bytes> didn't allow stacking when |
| 3421 | opening a file. For example |
| 3422 | this: |
| 3423 | |
| 3424 | open(FH, ">:pop:perlio", "some.file") or die $!; |
| 3425 | |
| 3426 | would throw an "Invalid argument" error. This has been fixed in this |
| 3427 | release [perl #82484]. |
| 3428 | |
| 3429 | =back |
| 3430 | |
| 3431 | =head2 Regular Expression Bug Fixes |
| 3432 | |
| 3433 | =over |
| 3434 | |
| 3435 | =item * |
| 3436 | |
| 3437 | The regular expression engine no longer loops when matching |
| 3438 | C<"\N{LATIN SMALL LIGATURE FF}" =~ /f+/i> and similar expressions |
| 3439 | [perl #72998] (5.12.1). |
| 3440 | |
| 3441 | =item * |
| 3442 | |
| 3443 | The trie runtime code should no longer allocate massive amounts of memory, |
| 3444 | fixing #74484. |
| 3445 | |
| 3446 | =item * |
| 3447 | |
| 3448 | Syntax errors in C<< (?{...}) >> blocks no longer cause panic messages |
| 3449 | [perl #2353]. |
| 3450 | |
| 3451 | =item * |
| 3452 | |
| 3453 | A pattern like C<(?:(o){2})?> no longer causes a "panic" error |
| 3454 | [perl #39233]. |
| 3455 | |
| 3456 | =item * |
| 3457 | |
| 3458 | A fatal error in regular expressions containing C<(.*?)> when processing |
| 3459 | UTF-8 data has been fixed [perl #75680] (5.12.2). |
| 3460 | |
| 3461 | =item * |
| 3462 | |
| 3463 | An erroneous regular expression engine optimisation that caused regex verbs like |
| 3464 | C<*COMMIT> sometimes to be ignored has been removed. |
| 3465 | |
| 3466 | =item * |
| 3467 | |
| 3468 | The regular expression bracketed character class C<[\8\9]> was effectively the |
| 3469 | same as C<[89\000]>, incorrectly matching a NULL character. It also gave |
| 3470 | incorrect warnings that the C<8> and C<9> were ignored. Now C<[\8\9]> is the |
| 3471 | same as C<[89]> and gives legitimate warnings that C<\8> and C<\9> are |
| 3472 | unrecognized escape sequences, passed-through. |
| 3473 | |
| 3474 | =item * |
| 3475 | |
| 3476 | A regular expression match in the right-hand side of a global substitution |
| 3477 | (C<s///g>) that is in the same scope will no longer cause match variables |
| 3478 | to have the wrong values on subsequent iterations. This can happen when an |
| 3479 | array or hash subscript is interpolated in the right-hand side, as in |
| 3480 | C<s|(.)|@a{ print($1), /./ }|g> [perl #19078]. |
| 3481 | |
| 3482 | =item * |
| 3483 | |
| 3484 | Several cases in which characters in the Latin-1 non-ASCII range (0x80 to |
| 3485 | 0xFF) used not to match themselves, or used to match both a character class |
| 3486 | and its complement, have been fixed. For instance, U+00E2 could match both |
| 3487 | C<\w> and C<\W> [perl #78464] [perl #18281] [perl #60156]. |
| 3488 | |
| 3489 | =item * |
| 3490 | |
| 3491 | Matching a Unicode character against an alternation containing characters |
| 3492 | that happened to match continuation bytes in the former's UTF8 |
| 3493 | representation (like C<qq{\x{30ab}} =~ /\xab|\xa9/>) would cause erroneous |
| 3494 | warnings [perl #70998]. |
| 3495 | |
| 3496 | =item * |
| 3497 | |
| 3498 | The trie optimisation was not taking empty groups into account, preventing |
| 3499 | "foo" from matching C</\A(?:(?:)foo|bar|zot)\z/> [perl #78356]. |
| 3500 | |
| 3501 | =item * |
| 3502 | |
| 3503 | A pattern containing a C<+> inside a lookahead would sometimes cause an |
| 3504 | incorrect match failure in a global match (for example, C</(?=(\S+))/g>) |
| 3505 | [perl #68564]. |
| 3506 | |
| 3507 | =item * |
| 3508 | |
| 3509 | A regular expression optimisation would sometimes cause a match with a |
| 3510 | C<{n,m}> quantifier to fail when it should have matched [perl #79152]. |
| 3511 | |
| 3512 | =item * |
| 3513 | |
| 3514 | Case-insensitive matching in regular expressions compiled under |
| 3515 | C<use locale> now works much more sanely when the pattern or target |
| 3516 | string is internally encoded in UTF8. Previously, under these |
| 3517 | conditions the localeness was completely lost. Now, code points |
| 3518 | above 255 are treated as Unicode, but code points between 0 and 255 |
| 3519 | are treated using the current locale rules, regardless of whether |
| 3520 | the pattern or the string is encoded in UTF8. The few case-insensitive |
| 3521 | matches that cross the 255/256 boundary are not allowed. For |
| 3522 | example, 0xFF does not caselessly match the character at 0x178, |
| 3523 | LATIN CAPITAL LETTER Y WITH DIAERESIS, because 0xFF may not be LATIN |
| 3524 | SMALL LETTER Y in the current locale, and Perl has no way of knowing |
| 3525 | if that character even exists in the locale, much less what code |
| 3526 | point it is. |
| 3527 | |
| 3528 | =item * |
| 3529 | |
| 3530 | The C<(?|...)> regular expression construct no longer crashes if the final |
| 3531 | branch has more sets of capturing parentheses than any other branch. This |
| 3532 | was fixed in Perl 5.10.1 for the case of a single branch, but that fix did |
| 3533 | not take multiple branches into account [perl #84746]. |
| 3534 | |
| 3535 | =item * |
| 3536 | |
| 3537 | A bug has been fixed in the implementation of C<{...}> quantifiers in |
| 3538 | regular expressions that prevented the code block in |
| 3539 | C</((\w+)(?{ print $2 })){2}/> from seeing the C<$2> sometimes |
| 3540 | [perl #84294]. |
| 3541 | |
| 3542 | =back |
| 3543 | |
| 3544 | =head2 Syntax/Parsing Bugs |
| 3545 | |
| 3546 | =over |
| 3547 | |
| 3548 | =item * |
| 3549 | |
| 3550 | C<when (scalar) {...}> no longer crashes, but produces a syntax error |
| 3551 | [perl #74114] (5.12.1). |
| 3552 | |
| 3553 | =item * |
| 3554 | |
| 3555 | A label right before a string eval (C<foo: eval $string>) no longer causes |
| 3556 | the label to be associated also with the first statement inside the eval |
| 3557 | [perl #74290] (5.12.1). |
| 3558 | |
| 3559 | =item * |
| 3560 | |
| 3561 | The C<no 5.13.2> form of C<no> no longer tries to turn on features or |
| 3562 | pragmata (like L<strict>) [perl #70075] (5.12.2). |
| 3563 | |
| 3564 | =item * |
| 3565 | |
| 3566 | C<BEGIN {require 5.12.0}> now behaves as documented, rather than behaving |
| 3567 | identically to C<use 5.12.0>. Previously, C<require> in a C<BEGIN> block |
| 3568 | was erroneously executing the C<use feature ':5.12.0'> and |
| 3569 | C<use strict> behaviour, which only C<use> was documented to |
| 3570 | provide [perl #69050]. |
| 3571 | |
| 3572 | =item * |
| 3573 | |
| 3574 | A regression introduced in Perl 5.12.0, making |
| 3575 | C<< my $x = 3; $x = length(undef) >> result in C<$x> set to C<3> has been |
| 3576 | fixed. C<$x> will now be C<undef> [perl #85508] (5.12.2). |
| 3577 | |
| 3578 | =item * |
| 3579 | |
| 3580 | When strict "refs" mode is off, C<%{...}> in rvalue context returns |
| 3581 | C<undef> if its argument is undefined. An optimisation introduced in Perl |
| 3582 | 5.12.0 to make C<keys %{...}> faster when used as a boolean did not take |
| 3583 | this into account, causing C<keys %{+undef}> (and C<keys %$foo> when |
| 3584 | C<$foo> is undefined) to be an error, which it should be so in strict |
| 3585 | mode only [perl #81750]. |
| 3586 | |
| 3587 | =item * |
| 3588 | |
| 3589 | Constant-folding used to cause |
| 3590 | |
| 3591 | $text =~ ( 1 ? /phoo/ : /bear/) |
| 3592 | |
| 3593 | to turn into |
| 3594 | |
| 3595 | $text =~ /phoo/ |
| 3596 | |
| 3597 | at compile time. Now it correctly matches against C<$_> [perl #20444]. |
| 3598 | |
| 3599 | =item * |
| 3600 | |
| 3601 | Parsing Perl code (either with string C<eval> or by loading modules) from |
| 3602 | within a C<UNITCHECK> block no longer causes the interpreter to crash |
| 3603 | [perl #70614]. |
| 3604 | |
| 3605 | =item * |
| 3606 | |
| 3607 | String C<eval>s no longer fail after 2 billion scopes have been |
| 3608 | compiled [perl #83364]. |
| 3609 | |
| 3610 | =item * |
| 3611 | |
| 3612 | The parser no longer hangs when encountering certain Unicode characters, |
| 3613 | such as U+387 [perl #74022]. |
| 3614 | |
| 3615 | =item * |
| 3616 | |
| 3617 | Defining a constant with the same name as one of Perl's special blocks |
| 3618 | (like C<INIT>) stopped working in 5.12.0, but has now been fixed |
| 3619 | [perl #78634]. |
| 3620 | |
| 3621 | =item * |
| 3622 | |
| 3623 | A reference to a literal value used as a hash key (C<$hash{\"foo"}>) used |
| 3624 | to be stringified, even if the hash was tied [perl #79178]. |
| 3625 | |
| 3626 | =item * |
| 3627 | |
| 3628 | A closure containing an C<if> statement followed by a constant or variable |
| 3629 | is no longer treated as a constant [perl #63540]. |
| 3630 | |
| 3631 | =item * |
| 3632 | |
| 3633 | C<state> can now be used with attributes. It |
| 3634 | used to mean the same thing as |
| 3635 | C<my> if any attributes were present [perl #68658]. |
| 3636 | |
| 3637 | =item * |
| 3638 | |
| 3639 | Expressions like C<< @$a > 3 >> no longer cause C<$a> to be mentioned in |
| 3640 | the "Use of uninitialized value in numeric gt" warning when C<$a> is |
| 3641 | undefined (since it is not part of the C<< > >> expression, but the operand |
| 3642 | of the C<@>) [perl #72090]. |
| 3643 | |
| 3644 | =item * |
| 3645 | |
| 3646 | Accessing an element of a package array with a hard-coded number (as |
| 3647 | opposed to an arbitrary expression) would crash if the array did not exist. |
| 3648 | Usually the array would be autovivified during compilation, but typeglob |
| 3649 | manipulation could remove it, as in these two cases which used to crash: |
| 3650 | |
| 3651 | *d = *a; print $d[0]; |
| 3652 | undef *d; print $d[0]; |
| 3653 | |
| 3654 | =item * |
| 3655 | |
| 3656 | The B<-C> command-line option, when used on the shebang line, can now be |
| 3657 | followed by other options [perl #72434]. |
| 3658 | |
| 3659 | =item * |
| 3660 | |
| 3661 | The C<B> module was returning C<B::OP>s instead of C<B::LOGOP>s for |
| 3662 | C<entertry> [perl #80622]. This was due to a bug in the Perl core, |
| 3663 | not in C<B> itself. |
| 3664 | |
| 3665 | =back |
| 3666 | |
| 3667 | =head2 Stashes, Globs and Method Lookup |
| 3668 | |
| 3669 | Perl 5.10.0 introduced a new internal mechanism for caching MROs (method |
| 3670 | resolution orders, or lists of parent classes; aka "isa" caches) to make |
| 3671 | method lookup faster (so C<@ISA> arrays would not have to be searched |
| 3672 | repeatedly). Unfortunately, this brought with it quite a few bugs. Almost |
| 3673 | all of these have been fixed now, along with a few MRO-related bugs that |
| 3674 | existed before 5.10.0: |
| 3675 | |
| 3676 | =over |
| 3677 | |
| 3678 | =item * |
| 3679 | |
| 3680 | The following used to have erratic effects on method resolution, because |
| 3681 | the "isa" caches were not reset or otherwise ended up listing the wrong |
| 3682 | classes. These have been fixed. |
| 3683 | |
| 3684 | =over |
| 3685 | |
| 3686 | =item Aliasing packages by assigning to globs [perl #77358] |
| 3687 | |
| 3688 | =item Deleting packages by deleting their containing stash elements |
| 3689 | |
| 3690 | =item Undefining the glob containing a package (C<undef *Foo::>) |
| 3691 | |
| 3692 | =item Undefining an ISA glob (C<undef *Foo::ISA>) |
| 3693 | |
| 3694 | =item Deleting an ISA stash element (C<delete $Foo::{ISA}>) |
| 3695 | |
| 3696 | =item Sharing @ISA arrays between classes (via C<*Foo::ISA = \@Bar::ISA> or |
| 3697 | C<*Foo::ISA = *Bar::ISA>) [perl #77238] |
| 3698 | |
| 3699 | =back |
| 3700 | |
| 3701 | C<undef *Foo::ISA> would even stop a new C<@Foo::ISA> array from updating |
| 3702 | caches. |
| 3703 | |
| 3704 | =item * |
| 3705 | |
| 3706 | Typeglob assignments would crash if the glob's stash no longer existed, so |
| 3707 | long as the glob assigned to were named C<ISA> or the glob on either side of |
| 3708 | the assignment contained a subroutine. |
| 3709 | |
| 3710 | =item * |
| 3711 | |
| 3712 | C<PL_isarev>, which is accessible to Perl via C<mro::get_isarev> is now |
| 3713 | updated properly when packages are deleted or removed from the C<@ISA> of |
| 3714 | other classes. This allows many packages to be created and deleted without |
| 3715 | causing a memory leak [perl #75176]. |
| 3716 | |
| 3717 | =back |
| 3718 | |
| 3719 | In addition, various other bugs related to typeglobs and stashes have been |
| 3720 | fixed: |
| 3721 | |
| 3722 | =over |
| 3723 | |
| 3724 | =item * |
| 3725 | |
| 3726 | Some work has been done on the internal pointers that link between symbol |
| 3727 | tables (stashes), typeglobs, and subroutines. This has the effect that |
| 3728 | various edge cases related to deleting stashes or stash entries (for example, |
| 3729 | <%FOO:: = ()>), and complex typeglob or code-reference aliasing, will no |
| 3730 | longer crash the interpreter. |
| 3731 | |
| 3732 | =item * |
| 3733 | |
| 3734 | Assigning a reference to a glob copy now assigns to a glob slot instead of |
| 3735 | overwriting the glob with a scalar [perl #1804] [perl #77508]. |
| 3736 | |
| 3737 | =item * |
| 3738 | |
| 3739 | A bug when replacing the glob of a loop variable within the loop has been fixed |
| 3740 | [perl #21469]. This |
| 3741 | means the following code will no longer crash: |
| 3742 | |
| 3743 | for $x (...) { |
| 3744 | *x = *y; |
| 3745 | } |
| 3746 | |
| 3747 | =item * |
| 3748 | |
| 3749 | Assigning a glob to a PVLV used to convert it to a plain string. Now it |
| 3750 | works correctly, and a PVLV can hold a glob. This would happen when a |
| 3751 | nonexistent hash or array element was passed to a subroutine: |
| 3752 | |
| 3753 | sub { $_[0] = *foo }->($hash{key}); |
| 3754 | # $_[0] would have been the string "*main::foo" |
| 3755 | |
| 3756 | It also happened when a glob was assigned to, or returned from, an element |
| 3757 | of a tied array or hash [perl #36051]. |
| 3758 | |
| 3759 | =item * |
| 3760 | |
| 3761 | When trying to report C<Use of uninitialized value $Foo::BAR>, crashes could |
| 3762 | occur if the glob holding the global variable in question had been detached |
| 3763 | from its original stash by, for example, C<delete $::{"Foo::"}>. This has |
| 3764 | been fixed by disabling the reporting of variable names in those |
| 3765 | cases. |
| 3766 | |
| 3767 | =item * |
| 3768 | |
| 3769 | During the restoration of a localised typeglob on scope exit, any |
| 3770 | destructors called as a result would be able to see the typeglob in an |
| 3771 | inconsistent state, containing freed entries, which could result in a |
| 3772 | crash. This would affect code like this: |
| 3773 | |
| 3774 | local *@; |
| 3775 | eval { die bless [] }; # puts an object in $@ |
| 3776 | sub DESTROY { |
| 3777 | local $@; # boom |
| 3778 | } |
| 3779 | |
| 3780 | Now the glob entries are cleared before any destructors are called. This |
| 3781 | also means that destructors can vivify entries in the glob. So Perl tries |
| 3782 | again and, if the entries are re-created too many times, dies with a |
| 3783 | "panic: gp_free ..." error message. |
| 3784 | |
| 3785 | =item * |
| 3786 | |
| 3787 | If a typeglob is freed while a subroutine attached to it is still |
| 3788 | referenced elsewhere, the subroutine is renamed to C<__ANON__> in the same |
| 3789 | package, unless the package has been undefined, in which case the C<__ANON__> |
| 3790 | package is used. This could cause packages to be sometimes autovivified, |
| 3791 | such as if the package had been deleted. Now this no longer occurs. |
| 3792 | The C<__ANON__> package is also now used when the original package is |
| 3793 | no longer attached to the symbol table. This avoids memory leaks in some |
| 3794 | cases [perl #87664]. |
| 3795 | |
| 3796 | =item * |
| 3797 | |
| 3798 | Subroutines and package variables inside a package whose name ends with |
| 3799 | C<::> can now be accessed with a fully qualified name. |
| 3800 | |
| 3801 | =back |
| 3802 | |
| 3803 | =head2 Unicode |
| 3804 | |
| 3805 | =over |
| 3806 | |
| 3807 | =item * |
| 3808 | |
| 3809 | What has become known as "the Unicode Bug" is almost completely resolved in |
| 3810 | this release. Under C<use feature 'unicode_strings'> (which is |
| 3811 | automatically selected by C<use 5.012> and above), the internal |
| 3812 | storage format of a string no longer affects the external semantics. |
| 3813 | [perl #58182]. |
| 3814 | |
| 3815 | There are two known exceptions: |
| 3816 | |
| 3817 | =over |
| 3818 | |
| 3819 | =item 1 |
| 3820 | |
| 3821 | The now-deprecated, user-defined case-changing |
| 3822 | functions require utf8-encoded strings to operate. The CPAN module |
| 3823 | L<Unicode::Casing> has been written to replace this feature without its |
| 3824 | drawbacks, and the feature is scheduled to be removed in 5.16. |
| 3825 | |
| 3826 | =item 2 |
| 3827 | |
| 3828 | quotemeta() (and its in-line equivalent C<\Q>) can also give different |
| 3829 | results depending on whether a string is encoded in UTF-8. See |
| 3830 | L<perlunicode/The "Unicode Bug">. |
| 3831 | |
| 3832 | =back |
| 3833 | |
| 3834 | =item * |
| 3835 | |
| 3836 | Handling of Unicode non-character code points has changed. |
| 3837 | Previously they were mostly considered illegal, except that in some |
| 3838 | place only one of the 66 of them was known. The Unicode Standard |
| 3839 | considers them all legal, but forbids their "open interchange". |
| 3840 | This is part of the change to allow internal use of any code |
| 3841 | point (see L</Core Enhancements>). Together, these changes resolve |
| 3842 | [perl #38722], [perl #51918], [perl #51936], and [perl #63446]. |
| 3843 | |
| 3844 | =item * |
| 3845 | |
| 3846 | Case-insensitive C<"/i"> regular expression matching of Unicode |
| 3847 | characters that match multiple characters now works much more as |
| 3848 | intended. For example |
| 3849 | |
| 3850 | "\N{LATIN SMALL LIGATURE FFI}" =~ /ffi/ui |
| 3851 | |
| 3852 | and |
| 3853 | |
| 3854 | "ffi" =~ /\N{LATIN SMALL LIGATURE FFI}/ui |
| 3855 | |
| 3856 | are both true. Previously, there were many bugs with this feature. |
| 3857 | What hasn't been fixed are the places where the pattern contains the |
| 3858 | multiple characters, but the characters are split up by other things, |
| 3859 | such as in |
| 3860 | |
| 3861 | "\N{LATIN SMALL LIGATURE FFI}" =~ /(f)(f)i/ui |
| 3862 | |
| 3863 | or |
| 3864 | |
| 3865 | "\N{LATIN SMALL LIGATURE FFI}" =~ /ffi*/ui |
| 3866 | |
| 3867 | or |
| 3868 | |
| 3869 | "\N{LATIN SMALL LIGATURE FFI}" =~ /[a-f][f-m][g-z]/ui |
| 3870 | |
| 3871 | None of these match. |
| 3872 | |
| 3873 | Also, this matching doesn't fully conform to the current Unicode |
| 3874 | Standard, which asks that the matching be made upon the NFD |
| 3875 | (Normalization Form Decomposed) of the text. However, as of this |
| 3876 | writing (April 2010), the Unicode Standard is currently in flux about |
| 3877 | what they will recommend doing with regard in such scenarios. It may be |
| 3878 | that they will throw out the whole concept of multi-character matches. |
| 3879 | [perl #71736]. |
| 3880 | |
| 3881 | =item * |
| 3882 | |
| 3883 | Naming a deprecated character in C<\N{I<NAME>}> no longer leaks memory. |
| 3884 | |
| 3885 | =item * |
| 3886 | |
| 3887 | We fixed a bug that could cause C<\N{I<NAME>}> constructs followed by |
| 3888 | a single C<"."> to be parsed incorrectly [perl #74978] (5.12.1). |
| 3889 | |
| 3890 | =item * |
| 3891 | |
| 3892 | C<chop> now correctly handles characters above C<"\x{7fffffff}"> |
| 3893 | [perl #73246]. |
| 3894 | |
| 3895 | =item * |
| 3896 | |
| 3897 | Passing to C<index> an offset beyond the end of the string when the string |
| 3898 | is encoded internally in UTF8 no longer causes panics [perl #75898]. |
| 3899 | |
| 3900 | =item * |
| 3901 | |
| 3902 | warn() and die() now respect utf8-encoded scalars [perl #45549]. |
| 3903 | |
| 3904 | =item * |
| 3905 | |
| 3906 | Sometimes the UTF8 length cache would not be reset on a value |
| 3907 | returned by substr, causing C<length(substr($uni_string, ...))> to give |
| 3908 | wrong answers. With C<${^UTF8CACHE}> set to -1, it would also produce |
| 3909 | a "panic" error message [perl #77692]. |
| 3910 | |
| 3911 | =back |
| 3912 | |
| 3913 | =head2 Ties, Overloading and Other Magic |
| 3914 | |
| 3915 | =over |
| 3916 | |
| 3917 | =item * |
| 3918 | |
| 3919 | Overloading now works properly in conjunction with tied |
| 3920 | variables. What formerly happened was that most ops checked their |
| 3921 | arguments for overloading I<before> checking for magic, so for example |
| 3922 | an overloaded object returned by a tied array access would usually be |
| 3923 | treated as not overloaded [RT #57012]. |
| 3924 | |
| 3925 | =item * |
| 3926 | |
| 3927 | Various instances of magic (like tie methods) being called on tied variables |
| 3928 | too many or too few times have been fixed: |
| 3929 | |
| 3930 | =over |
| 3931 | |
| 3932 | =item * |
| 3933 | |
| 3934 | C<< $tied->() >> did not always call FETCH [perl #8438]. |
| 3935 | |
| 3936 | =item * |
| 3937 | |
| 3938 | Filetest operators and C<y///> and C<tr///> were calling FETCH too |
| 3939 | many times. |
| 3940 | |
| 3941 | =item * |
| 3942 | |
| 3943 | The C<=> operator used to ignore magic on its right-hand side if the |
| 3944 | scalar happened to hold a typeglob (if a typeglob was the last thing |
| 3945 | returned from or assigned to a tied scalar) [perl #77498]. |
| 3946 | |
| 3947 | =item * |
| 3948 | |
| 3949 | Dereference operators used to ignore magic if the argument was a |
| 3950 | reference already (such as from a previous FETCH) [perl #72144]. |
| 3951 | |
| 3952 | =item * |
| 3953 | |
| 3954 | C<splice> now calls set-magic (so changes made |
| 3955 | by C<splice @ISA> are respected by method calls) [perl #78400]. |
| 3956 | |
| 3957 | =item * |
| 3958 | |
| 3959 | In-memory files created by C<< open($fh, ">", \$buffer) >> were not calling |
| 3960 | FETCH/STORE at all [perl #43789] (5.12.2). |
| 3961 | |
| 3962 | =item * |
| 3963 | |
| 3964 | utf8::is_utf8() now respects get-magic (like C<$1>) (5.12.1). |
| 3965 | |
| 3966 | =back |
| 3967 | |
| 3968 | =item * |
| 3969 | |
| 3970 | Non-commutative binary operators used to swap their operands if the same |
| 3971 | tied scalar was used for both operands and returned a different value for |
| 3972 | each FETCH. For instance, if C<$t> returned 2 the first time and 3 the |
| 3973 | second, then C<$t/$t> would evaluate to 1.5. This has been fixed |
| 3974 | [perl #87708]. |
| 3975 | |
| 3976 | =item * |
| 3977 | |
| 3978 | String C<eval> now detects taintedness of overloaded or tied |
| 3979 | arguments [perl #75716]. |
| 3980 | |
| 3981 | =item * |
| 3982 | |
| 3983 | String C<eval> and regular expression matches against objects with string |
| 3984 | overloading no longer cause memory corruption or crashes [perl #77084]. |
| 3985 | |
| 3986 | =item * |
| 3987 | |
| 3988 | L<readline|perlfunc/"readline EXPR"> now honors C<< <> >> overloading on tied |
| 3989 | arguments. |
| 3990 | |
| 3991 | =item * |
| 3992 | |
| 3993 | C<< <expr> >> always respects overloading now if the expression is |
| 3994 | overloaded. |
| 3995 | |
| 3996 | Because "S<< <> as >> glob" was parsed differently from |
| 3997 | "S<< <> as >> filehandle" from 5.6 onwards, something like C<< <$foo[0]> >> did |
| 3998 | not handle overloading, even if C<$foo[0]> was an overloaded object. This |
| 3999 | was contrary to the documentation for L<overload>, and meant that C<< <> >> |
| 4000 | could not be used as a general overloaded iterator operator. |
| 4001 | |
| 4002 | =item * |
| 4003 | |
| 4004 | The fallback behaviour of overloading on binary operators was asymmetric |
| 4005 | [perl #71286]. |
| 4006 | |
| 4007 | =item * |
| 4008 | |
| 4009 | Magic applied to variables in the main package no longer affects other packages. |
| 4010 | See L</Magic variables outside the main package> above [perl #76138]. |
| 4011 | |
| 4012 | =item * |
| 4013 | |
| 4014 | Sometimes magic (ties, taintedness, etc.) attached to variables could cause |
| 4015 | an object to last longer than it should, or cause a crash if a tied |
| 4016 | variable were freed from within a tie method. These have been fixed |
| 4017 | [perl #81230]. |
| 4018 | |
| 4019 | =item * |
| 4020 | |
| 4021 | DESTROY methods of objects implementing ties are no longer able to crash by |
| 4022 | accessing the tied variable through a weak reference [perl #86328]. |
| 4023 | |
| 4024 | =item * |
| 4025 | |
| 4026 | Fixed a regression of kill() when a match variable is used for the |
| 4027 | process ID to kill [perl #75812]. |
| 4028 | |
| 4029 | =item * |
| 4030 | |
| 4031 | C<$AUTOLOAD> used to remain tainted forever if it ever became tainted. Now |
| 4032 | it is correctly untainted if an autoloaded method is called and the method |
| 4033 | name was not tainted. |
| 4034 | |
| 4035 | =item * |
| 4036 | |
| 4037 | C<sprintf> now dies when passed a tainted scalar for the format. It did |
| 4038 | already die for arbitrary expressions, but not for simple scalars |
| 4039 | [perl #82250]. |
| 4040 | |
| 4041 | =item * |
| 4042 | |
| 4043 | C<lc>, C<uc>, C<lcfirst>, and C<ucfirst> no longer return untainted strings |
| 4044 | when the argument is tainted. This has been broken since perl 5.8.9 |
| 4045 | [perl #87336]. |
| 4046 | |
| 4047 | =back |
| 4048 | |
| 4049 | =head2 The Debugger |
| 4050 | |
| 4051 | =over |
| 4052 | |
| 4053 | =item * |
| 4054 | |
| 4055 | The Perl debugger now also works in taint mode [perl #76872]. |
| 4056 | |
| 4057 | =item * |
| 4058 | |
| 4059 | Subroutine redefinition works once more in the debugger [perl #48332]. |
| 4060 | |
| 4061 | =item * |
| 4062 | |
| 4063 | When B<-d> is used on the shebang (C<#!>) line, the debugger now has access |
| 4064 | to the lines of the main program. In the past, this sometimes worked and |
| 4065 | sometimes did not, depending on the order in which things happened to be |
| 4066 | arranged in memory [perl #71806]. |
| 4067 | |
| 4068 | =item * |
| 4069 | |
| 4070 | A possible memory leak when using L<caller()|perlfunc/"caller EXPR"> to set |
| 4071 | C<@DB::args> has been fixed (5.12.2). |
| 4072 | |
| 4073 | =item * |
| 4074 | |
| 4075 | Perl no longer stomps on C<$DB::single>, C<$DB::trace>, and C<$DB::signal> |
| 4076 | if these variables already have values when C<$^P> is assigned to [perl #72422]. |
| 4077 | |
| 4078 | =item * |
| 4079 | |
| 4080 | C<#line> directives in string evals were not properly updating the arrays |
| 4081 | of lines of code (C<< @{"_< ..."} >>) that the debugger (or any debugging or |
| 4082 | profiling module) uses. In threaded builds, they were not being updated at |
| 4083 | all. In non-threaded builds, the line number was ignored, so any change to |
| 4084 | the existing line number would cause the lines to be misnumbered |
| 4085 | [perl #79442]. |
| 4086 | |
| 4087 | =back |
| 4088 | |
| 4089 | =head2 Threads |
| 4090 | |
| 4091 | =over |
| 4092 | |
| 4093 | =item * |
| 4094 | |
| 4095 | Perl no longer accidentally clones lexicals in scope within active stack |
| 4096 | frames in the parent when creating a child thread [perl #73086]. |
| 4097 | |
| 4098 | =item * |
| 4099 | |
| 4100 | Several memory leaks in cloning and freeing threaded Perl interpreters have been |
| 4101 | fixed [perl #77352]. |
| 4102 | |
| 4103 | =item * |
| 4104 | |
| 4105 | Creating a new thread when directory handles were open used to cause a |
| 4106 | crash, because the handles were not cloned, but simply passed to the new |
| 4107 | thread, resulting in a double free. |
| 4108 | |
| 4109 | Now directory handles are cloned properly on Windows |
| 4110 | and on systems that have a C<fchdir> function. On other |
| 4111 | systems, new threads simply do not inherit directory |
| 4112 | handles from their parent threads [perl #75154]. |
| 4113 | |
| 4114 | =item * |
| 4115 | |
| 4116 | The typeglob C<*,>, which holds the scalar variable C<$,> (output field |
| 4117 | separator), had the wrong reference count in child threads. |
| 4118 | |
| 4119 | =item * |
| 4120 | |
| 4121 | [perl #78494] When pipes are shared between threads, the C<close> function |
| 4122 | (and any implicit close, such as on thread exit) no longer blocks. |
| 4123 | |
| 4124 | =item * |
| 4125 | |
| 4126 | Perl now does a timely cleanup of SVs that are cloned into a new |
| 4127 | thread but then discovered to be orphaned (that is, their owners |
| 4128 | are I<not> cloned). This eliminates several "scalars leaked" |
| 4129 | warnings when joining threads. |
| 4130 | |
| 4131 | =back |
| 4132 | |
| 4133 | =head2 Scoping and Subroutines |
| 4134 | |
| 4135 | =over |
| 4136 | |
| 4137 | =item * |
| 4138 | |
| 4139 | Lvalue subroutines are again able to return copy-on-write scalars. This |
| 4140 | had been broken since version 5.10.0 [perl #75656] (5.12.3). |
| 4141 | |
| 4142 | =item * |
| 4143 | |
| 4144 | C<require> no longer causes C<caller> to return the wrong file name for |
| 4145 | the scope that called C<require> and other scopes higher up that had the |
| 4146 | same file name [perl #68712]. |
| 4147 | |
| 4148 | =item * |
| 4149 | |
| 4150 | C<sort> with a C<($$)>-prototyped comparison routine used to cause the value |
| 4151 | of C<@_> to leak out of the sort. Taking a reference to C<@_> within the |
| 4152 | sorting routine could cause a crash [perl #72334]. |
| 4153 | |
| 4154 | =item * |
| 4155 | |
| 4156 | Match variables (like C<$1>) no longer persist between calls to a sort |
| 4157 | subroutine [perl #76026]. |
| 4158 | |
| 4159 | =item * |
| 4160 | |
| 4161 | Iterating with C<foreach> over an array returned by an lvalue sub now works |
| 4162 | [perl #23790]. |
| 4163 | |
| 4164 | =item * |
| 4165 | |
| 4166 | C<$@> is now localised during calls to C<binmode> to prevent action at a |
| 4167 | distance [perl #78844]. |
| 4168 | |
| 4169 | =item * |
| 4170 | |
| 4171 | Calling a closure prototype (what is passed to an attribute handler for a |
| 4172 | closure) now results in a "Closure prototype called" error message instead |
| 4173 | of a crash [perl #68560]. |
| 4174 | |
| 4175 | =item * |
| 4176 | |
| 4177 | Mentioning a read-only lexical variable from the enclosing scope in a |
| 4178 | string C<eval> no longer causes the variable to become writable |
| 4179 | [perl #19135]. |
| 4180 | |
| 4181 | =back |
| 4182 | |
| 4183 | =head2 Signals |
| 4184 | |
| 4185 | =over |
| 4186 | |
| 4187 | =item * |
| 4188 | |
| 4189 | Within signal handlers, C<$!> is now implicitly localized. |
| 4190 | |
| 4191 | =item * |
| 4192 | |
| 4193 | CHLD signals are no longer unblocked after a signal handler is called if |
| 4194 | they were blocked before by C<POSIX::sigprocmask> [perl #82040]. |
| 4195 | |
| 4196 | =item * |
| 4197 | |
| 4198 | A signal handler called within a signal handler could cause leaks or |
| 4199 | double-frees. Now fixed [perl #76248]. |
| 4200 | |
| 4201 | =back |
| 4202 | |
| 4203 | =head2 Miscellaneous Memory Leaks |
| 4204 | |
| 4205 | =over |
| 4206 | |
| 4207 | =item * |
| 4208 | |
| 4209 | Several memory leaks when loading XS modules were fixed (5.12.2). |
| 4210 | |
| 4211 | =item * |
| 4212 | |
| 4213 | L<substr()|perlfunc/"substr EXPR,OFFSET,LENGTH,REPLACEMENT">, |
| 4214 | L<pos()|perlfunc/"index STR,SUBSTR,POSITION">, L<keys()|perlfunc/"keys HASH">, |
| 4215 | and L<vec()|perlfunc/"vec EXPR,OFFSET,BITS"> could, when used in combination |
| 4216 | with lvalues, result in leaking the scalar value they operate on, and cause its |
| 4217 | destruction to happen too late. This has now been fixed. |
| 4218 | |
| 4219 | =item * |
| 4220 | |
| 4221 | The postincrement and postdecrement operators, C<++> and C<-->, used to cause |
| 4222 | leaks when used on references. This has now been fixed. |
| 4223 | |
| 4224 | =item * |
| 4225 | |
| 4226 | Nested C<map> and C<grep> blocks no longer leak memory when processing |
| 4227 | large lists [perl #48004]. |
| 4228 | |
| 4229 | =item * |
| 4230 | |
| 4231 | C<use I<VERSION>> and C<no I<VERSION>> no longer leak memory [perl #78436] |
| 4232 | [perl #69050]. |
| 4233 | |
| 4234 | =item * |
| 4235 | |
| 4236 | C<.=> followed by C<< <> >> or C<readline> would leak memory if C<$/> |
| 4237 | contained characters beyond the octet range and the scalar assigned to |
| 4238 | happened to be encoded as UTF8 internally [perl #72246]. |
| 4239 | |
| 4240 | =item * |
| 4241 | |
| 4242 | C<eval 'BEGIN{die}'> no longer leaks memory on non-threaded builds. |
| 4243 | |
| 4244 | =back |
| 4245 | |
| 4246 | =head2 Memory Corruption and Crashes |
| 4247 | |
| 4248 | =over |
| 4249 | |
| 4250 | =item * |
| 4251 | |
| 4252 | glob() no longer crashes when C<%File::Glob::> is empty and |
| 4253 | C<CORE::GLOBAL::glob> isn't present [perl #75464] (5.12.2). |
| 4254 | |
| 4255 | =item * |
| 4256 | |
| 4257 | readline() has been fixed when interrupted by signals so it no longer |
| 4258 | returns the "same thing" as before or random memory. |
| 4259 | |
| 4260 | =item * |
| 4261 | |
| 4262 | When assigning a list with duplicated keys to a hash, the assignment used to |
| 4263 | return garbage and/or freed values: |
| 4264 | |
| 4265 | @a = %h = (list with some duplicate keys); |
| 4266 | |
| 4267 | This has now been fixed [perl #31865]. |
| 4268 | |
| 4269 | =item * |
| 4270 | |
| 4271 | The mechanism for freeing objects in globs used to leave dangling |
| 4272 | pointers to freed SVs, meaning Perl users could see corrupted state |
| 4273 | during destruction. |
| 4274 | |
| 4275 | Perl now frees only the affected slots of the GV, rather than freeing |
| 4276 | the GV itself. This makes sure that there are no dangling refs or |
| 4277 | corrupted state during destruction. |
| 4278 | |
| 4279 | =item * |
| 4280 | |
| 4281 | The interpreter no longer crashes when freeing deeply-nested arrays of |
| 4282 | arrays. Hashes have not been fixed yet [perl #44225]. |
| 4283 | |
| 4284 | =item * |
| 4285 | |
| 4286 | Concatenating long strings under C<use encoding> no longer causes Perl to |
| 4287 | crash [perl #78674]. |
| 4288 | |
| 4289 | =item * |
| 4290 | |
| 4291 | Calling C<< ->import >> on a class lacking an import method could corrupt |
| 4292 | the stack, resulting in strange behaviour. For instance, |
| 4293 | |
| 4294 | push @a, "foo", $b = bar->import; |
| 4295 | |
| 4296 | would assign "foo" to C<$b> [perl #63790]. |
| 4297 | |
| 4298 | =item * |
| 4299 | |
| 4300 | The C<recv> function could crash when called with the MSG_TRUNC flag |
| 4301 | [perl #75082]. |
| 4302 | |
| 4303 | =item * |
| 4304 | |
| 4305 | C<formline> no longer crashes when passed a tainted format picture. It also |
| 4306 | taints C<$^A> now if its arguments are tainted [perl #79138]. |
| 4307 | |
| 4308 | =item * |
| 4309 | |
| 4310 | A bug in how we process filetest operations could cause a segfault. |
| 4311 | Filetests don't always expect an op on the stack, so we now use |
| 4312 | TOPs only if we're sure that we're not C<stat>ing the C<_> filehandle. |
| 4313 | This is indicated by C<OPf_KIDS> (as checked in ck_ftst) [perl #74542] |
| 4314 | (5.12.1). |
| 4315 | |
| 4316 | =item * |
| 4317 | |
| 4318 | unpack() now handles scalar context correctly for C<%32H> and C<%32u>, |
| 4319 | fixing a potential crash. split() would crash because the third item |
| 4320 | on the stack wasn't the regular expression it expected. C<unpack("%2H", |
| 4321 | ...)> would return both the unpacked result and the checksum on the stack, |
| 4322 | as would C<unpack("%2u", ...)> [perl #73814] (5.12.2). |
| 4323 | |
| 4324 | =back |
| 4325 | |
| 4326 | =head2 Fixes to Various Perl Operators |
| 4327 | |
| 4328 | =over |
| 4329 | |
| 4330 | =item * |
| 4331 | |
| 4332 | The C<&>, C<|>, and C<^> bitwise operators no longer coerce read-only arguments |
| 4333 | [perl #20661]. |
| 4334 | |
| 4335 | =item * |
| 4336 | |
| 4337 | Stringifying a scalar containing "-0.0" no longer has the effect of turning |
| 4338 | false into true [perl #45133]. |
| 4339 | |
| 4340 | =item * |
| 4341 | |
| 4342 | Some numeric operators were converting integers to floating point, |
| 4343 | resulting in loss of precision on 64-bit platforms [perl #77456]. |
| 4344 | |
| 4345 | =item * |
| 4346 | |
| 4347 | sprintf() was ignoring locales when called with constant arguments |
| 4348 | [perl #78632]. |
| 4349 | |
| 4350 | =item * |
| 4351 | |
| 4352 | Combining the vector (C<%v>) flag and dynamic precision would |
| 4353 | cause C<sprintf> to confuse the order of its arguments, making it |
| 4354 | treat the string as the precision and vice-versa [perl #83194]. |
| 4355 | |
| 4356 | =back |
| 4357 | |
| 4358 | =head2 Bugs Relating to the C API |
| 4359 | |
| 4360 | =over |
| 4361 | |
| 4362 | =item * |
| 4363 | |
| 4364 | The C-level C<lex_stuff_pvn> function would sometimes cause a spurious |
| 4365 | syntax error on the last line of the file if it lacked a final semicolon |
| 4366 | [perl #74006] (5.12.1). |
| 4367 | |
| 4368 | =item * |
| 4369 | |
| 4370 | The C<eval_sv> and C<eval_pv> C functions now set C<$@> correctly when |
| 4371 | there is a syntax error and no C<G_KEEPERR> flag, and never set it if the |
| 4372 | C<G_KEEPERR> flag is present [perl #3719]. |
| 4373 | |
| 4374 | =item * |
| 4375 | |
| 4376 | The XS multicall API no longer causes subroutines to lose reference counts |
| 4377 | if called via the multicall interface from within those very subroutines. |
| 4378 | This affects modules like L<List::Util>. Calling one of its functions with an |
| 4379 | active subroutine as the first argument could cause a crash [perl #78070]. |
| 4380 | |
| 4381 | =item * |
| 4382 | |
| 4383 | The C<SvPVbyte> function available to XS modules now calls magic before |
| 4384 | downgrading the SV, to avoid warnings about wide characters [perl #72398]. |
| 4385 | |
| 4386 | =item * |
| 4387 | |
| 4388 | The ref types in the typemap for XS bindings now support magical variables |
| 4389 | [perl #72684]. |
| 4390 | |
| 4391 | =item * |
| 4392 | |
| 4393 | C<sv_catsv_flags> no longer calls C<mg_get> on its second argument (the |
| 4394 | source string) if the flags passed to it do not include SV_GMAGIC. So it |
| 4395 | now matches the documentation. |
| 4396 | |
| 4397 | =item * |
| 4398 | |
| 4399 | C<my_strftime> no longer leaks memory. This fixes a memory leak in |
| 4400 | C<POSIX::strftime> [perl #73520]. |
| 4401 | |
| 4402 | =item * |
| 4403 | |
| 4404 | F<XSUB.h> now correctly redefines fgets under PERL_IMPLICIT_SYS [perl #55049] |
| 4405 | (5.12.1). |
| 4406 | |
| 4407 | =item * |
| 4408 | |
| 4409 | XS code using fputc() or fputs() on Windows could cause an error |
| 4410 | due to their arguments being swapped [perl #72704] (5.12.1). |
| 4411 | |
| 4412 | =item * |
| 4413 | |
| 4414 | A possible segfault in the C<T_PTROBJ> default typemap has been fixed |
| 4415 | (5.12.2). |
| 4416 | |
| 4417 | =item * |
| 4418 | |
| 4419 | A bug that could cause "Unknown error" messages when |
| 4420 | C<call_sv(code, G_EVAL)> is called from an XS destructor has been fixed |
| 4421 | (5.12.2). |
| 4422 | |
| 4423 | =back |
| 4424 | |
| 4425 | =head1 Known Problems |
| 4426 | |
| 4427 | This is a list of significant unresolved issues which are regressions |
| 4428 | from earlier versions of Perl or which affect widely-used CPAN modules. |
| 4429 | |
| 4430 | =over 4 |
| 4431 | |
| 4432 | =item * |
| 4433 | |
| 4434 | C<List::Util::first> misbehaves in the presence of a lexical C<$_> |
| 4435 | (typically introduced by C<my $_> or implicitly by C<given>). The variable |
| 4436 | that gets set for each iteration is the package variable C<$_>, not the |
| 4437 | lexical C<$_>. |
| 4438 | |
| 4439 | A similar issue may occur in other modules that provide functions which |
| 4440 | take a block as their first argument, like |
| 4441 | |
| 4442 | foo { ... $_ ...} list |
| 4443 | |
| 4444 | See also: L<http://rt.perl.org/rt3/Public/Bug/Display.html?id=67694> |
| 4445 | |
| 4446 | =item * |
| 4447 | |
| 4448 | readline() returns an empty string instead of a cached previous value |
| 4449 | when it is interrupted by a signal |
| 4450 | |
| 4451 | =item * |
| 4452 | |
| 4453 | The changes in prototype handling break L<Switch>. A patch has been sent |
| 4454 | upstream and will hopefully appear on CPAN soon. |
| 4455 | |
| 4456 | =item * |
| 4457 | |
| 4458 | The upgrade to F<ExtUtils-MakeMaker-6.57_05> has caused |
| 4459 | some tests in the F<Module-Install> distribution on CPAN to |
| 4460 | fail. (Specifically, F<02_mymeta.t> tests 5 and 21; F<18_all_from.t> |
| 4461 | tests 6 and 15; F<19_authors.t> tests 5, 13, 21, and 29; and |
| 4462 | F<20_authors_with_special_characters.t> tests 6, 15, and 23 in version |
| 4463 | 1.00 of that distribution now fail.) |
| 4464 | |
| 4465 | =item * |
| 4466 | |
| 4467 | On VMS, C<Time::HiRes> tests will fail due to a bug in the CRTL's |
| 4468 | implementation of C<setitimer>: previous timer values would be cleared |
| 4469 | if a timer expired but not if the timer was reset before expiring. HP |
| 4470 | OpenVMS Engineering have corrected the problem and will release a patch |
| 4471 | in due course (Quix case # QXCM1001115136). |
| 4472 | |
| 4473 | =item * |
| 4474 | |
| 4475 | On VMS, there were a handful of C<Module::Build> test failures we didn't |
| 4476 | get to before the release; please watch CPAN for updates. |
| 4477 | |
| 4478 | =back |
| 4479 | |
| 4480 | =head1 Errata |
| 4481 | |
| 4482 | =head2 keys(), values(), and each() work on arrays |
| 4483 | |
| 4484 | You can now use the keys(), values(), and each() builtins on arrays; |
| 4485 | previously you could use them only on hashes. See L<perlfunc> for details. |
| 4486 | This is actually a change introduced in perl 5.12.0, but it was missed from |
| 4487 | that release's L<perl5120delta>. |
| 4488 | |
| 4489 | =head2 split() and C<@_> |
| 4490 | |
| 4491 | split() no longer modifies C<@_> when called in scalar or void context. |
| 4492 | In void context it now produces a "Useless use of split" warning. |
| 4493 | This was also a perl 5.12.0 change that missed the perldelta. |
| 4494 | |
| 4495 | =head1 Obituary |
| 4496 | |
| 4497 | Randy Kobes, creator of http://kobesearch.cpan.org/ and |
| 4498 | contributor/maintainer to several core Perl toolchain modules, passed |
| 4499 | away on September 18, 2010 after a battle with lung cancer. The community |
| 4500 | was richer for his involvement. He will be missed. |
| 4501 | |
| 4502 | =head1 Acknowledgements |
| 4503 | |
| 4504 | Perl 5.14.0 represents one year of development since |
| 4505 | Perl 5.12.0 and contains nearly 550,000 lines of changes across nearly |
| 4506 | 3,000 files from 150 authors and committers. |
| 4507 | |
| 4508 | Perl continues to flourish into its third decade thanks to a vibrant |
| 4509 | community of users and developers. The following people are known to |
| 4510 | have contributed the improvements that became Perl 5.14.0: |
| 4511 | |
| 4512 | Aaron Crane, Abhijit Menon-Sen, Abigail, Ævar Arnfjörð Bjarmason, |
| 4513 | Alastair Douglas, Alexander Alekseev, Alexander Hartmaier, Alexandr |
| 4514 | Ciornii, Alex Davies, Alex Vandiver, Ali Polatel, Allen Smith, Andreas |
| 4515 | König, Andrew Rodland, Andy Armstrong, Andy Dougherty, Aristotle |
| 4516 | Pagaltzis, Arkturuz, Arvan, A. Sinan Unur, Ben Morrow, Bo Lindbergh, |
| 4517 | Boris Ratner, Brad Gilbert, Bram, brian d foy, Brian Phillips, Casey |
| 4518 | West, Charles Bailey, Chas. Owens, Chip Salzenberg, Chris 'BinGOs' |
| 4519 | Williams, chromatic, Craig A. Berry, Curtis Jewell, Dagfinn Ilmari |
| 4520 | Mannsåker, Dan Dascalescu, Dave Rolsky, David Caldwell, David Cantrell, |
| 4521 | David Golden, David Leadbeater, David Mitchell, David Wheeler, Eric |
| 4522 | Brine, Father Chrysostomos, Fingle Nark, Florian Ragwitz, Frank Wiegand, |
| 4523 | Franz Fasching, Gene Sullivan, George Greer, Gerard Goossen, Gisle Aas, |
| 4524 | Goro Fuji, Grant McLean, gregor herrmann, H.Merijn Brand, Hongwen Qiu, |
| 4525 | Hugo van der Sanden, Ian Goodacre, James E Keenan, James Mastros, Jan |
| 4526 | Dubois, Jay Hannah, Jerry D. Hedden, Jesse Vincent, Jim Cromie, Jirka |
| 4527 | Hruška, John Peacock, Joshua ben Jore, Joshua Pritikin, Karl Williamson, |
| 4528 | Kevin Ryde, kmx, Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯, Larwan Berke, Leon Brocard, Leon |
| 4529 | Timmermans, Lubomir Rintel, Lukas Mai, Maik Hentsche, Marty Pauley, |
| 4530 | Marvin Humphrey, Matt Johnson, Matt S Trout, Max Maischein, Michael |
| 4531 | Breen, Michael Fig, Michael G Schwern, Michael Parker, Michael Stevens, |
| 4532 | Michael Witten, Mike Kelly, Moritz Lenz, Nicholas Clark, Nick Cleaton, |
| 4533 | Nick Johnston, Nicolas Kaiser, Niko Tyni, Noirin Shirley, Nuno Carvalho, |
| 4534 | Paul Evans, Paul Green, Paul Johnson, Paul Marquess, Peter J. Holzer, |
| 4535 | Peter John Acklam, Peter Martini, Philippe Bruhat (BooK), Piotr Fusik, |
| 4536 | Rafael Garcia-Suarez, Rainer Tammer, Reini Urban, Renee Baecker, Ricardo |
| 4537 | Signes, Richard Möhn, Richard Soderberg, Rob Hoelz, Robin Barker, Ruslan |
| 4538 | Zakirov, Salvador Fandiño, Salvador Ortiz Garcia, Shlomi Fish, Sinan |
| 4539 | Unur, Sisyphus, Slaven Rezic, Steffen Müller, Steve Hay, Steven |
| 4540 | Schubiger, Steve Peters, Sullivan Beck, Tatsuhiko Miyagawa, Tim Bunce, |
| 4541 | Todd Rinaldo, Tom Christiansen, Tom Hukins, Tony Cook, Tye McQueen, |
| 4542 | Vadim Konovalov, Vernon Lyon, Vincent Pit, Walt Mankowski, Wolfram |
| 4543 | Humann, Yves Orton, Zefram, and Zsbán Ambrus. |
| 4544 | |
| 4545 | This is woefully incomplete as it's automatically generated from version |
| 4546 | control history. In particular, it doesn't include the names of the |
| 4547 | (very much appreciated) contributors who reported issues in previous |
| 4548 | versions of Perl that helped make Perl 5.14.0 better. For a more complete |
| 4549 | list of all of Perl's historical contributors, please see the C<AUTHORS> |
| 4550 | file in the Perl 5.14.0 distribution. |
| 4551 | |
| 4552 | Many of the changes included in this version originated in the CPAN |
| 4553 | modules included in Perl's core. We're grateful to the entire CPAN |
| 4554 | community for helping Perl to flourish. |
| 4555 | |
| 4556 | =head1 Reporting Bugs |
| 4557 | |
| 4558 | If you find what you think is a bug, you might check the articles |
| 4559 | recently posted to the comp.lang.perl.misc newsgroup and the Perl |
| 4560 | bug database at http://rt.perl.org/perlbug/ . There may also be |
| 4561 | information at http://www.perl.org/ , the Perl Home Page. |
| 4562 | |
| 4563 | If you believe you have an unreported bug, please run the L<perlbug> |
| 4564 | program included with your release. Be sure to trim your bug down |
| 4565 | to a tiny but sufficient test case. Your bug report, along with the |
| 4566 | output of C<perl -V>, will be sent off to perlbug@perl.org to be |
| 4567 | analysed by the Perl porting team. |
| 4568 | |
| 4569 | If the bug you are reporting has security implications, which make it |
| 4570 | inappropriate to send to a publicly archived mailing list, then please send |
| 4571 | it to perl5-security-report@perl.org. This points to a closed subscription |
| 4572 | unarchived mailing list, which includes all the core committers, who are able |
| 4573 | to help assess the impact of issues, figure out a resolution, and help |
| 4574 | co-ordinate the release of patches to mitigate or fix the problem across all |
| 4575 | platforms on which Perl is supported. Please use this address for |
| 4576 | security issues in the Perl core I<only>, not for modules independently |
| 4577 | distributed on CPAN. |
| 4578 | |
| 4579 | =head1 SEE ALSO |
| 4580 | |
| 4581 | The F<Changes> file for an explanation of how to view exhaustive details |
| 4582 | on what changed. |
| 4583 | |
| 4584 | The F<INSTALL> file for how to build Perl. |
| 4585 | |
| 4586 | The F<README> file for general stuff. |
| 4587 | |
| 4588 | The F<Artistic> and F<Copying> files for copyright information. |
| 4589 | |
| 4590 | =cut |