1=encoding utf8 2 3=head1 NAME 4 5perl5160delta - what is new for perl v5.16.0 6 7=head1 DESCRIPTION 8 9This document describes differences between the 5.14.0 release and 10the 5.16.0 release. 11 12If you are upgrading from an earlier release such as 5.12.0, first read 13L<perl5140delta>, which describes differences between 5.12.0 and 145.14.0. 15 16Some bug fixes in this release have been backported to later 17releases of 5.14.x. Those are indicated with the 5.14.x version in 18parentheses. 19 20=head1 Notice 21 22With the release of Perl 5.16.0, the 5.12.x series of releases is now out of 23its support period. There may be future 5.12.x releases, but only in the 24event of a critical security issue. Users of Perl 5.12 or earlier should 25consider upgrading to a more recent release of Perl. 26 27This policy is described in greater detail in 28L<perlpolicy|perlpolicy/MAINTENANCE AND SUPPORT>. 29 30=head1 Core Enhancements 31 32=head2 C<use I<VERSION>> 33 34As of this release, version declarations like C<use v5.16> now disable 35all features before enabling the new feature bundle. This means that 36the following holds true: 37 38 use 5.016; 39 # only 5.16 features enabled here 40 use 5.014; 41 # only 5.14 features enabled here (not 5.16) 42 43C<use v5.12> and higher continue to enable strict, but explicit C<use 44strict> and C<no strict> now override the version declaration, even 45when they come first: 46 47 no strict; 48 use 5.012; 49 # no strict here 50 51There is a new ":default" feature bundle that represents the set of 52features enabled before any version declaration or C<use feature> has 53been seen. Version declarations below 5.10 now enable the ":default" 54feature set. This does not actually change the behavior of C<use 55v5.8>, because features added to the ":default" set are those that were 56traditionally enabled by default, before they could be turned off. 57 58C<< no feature >> now resets to the default feature set. To disable all 59features (which is likely to be a pretty special-purpose request, since 60it presumably won't match any named set of semantics) you can now 61write C<< no feature ':all' >>. 62 63C<$[> is now disabled under C<use v5.16>. It is part of the default 64feature set and can be turned on or off explicitly with C<use feature 65'array_base'>. 66 67=head2 C<__SUB__> 68 69The new C<__SUB__> token, available under the C<current_sub> feature 70(see L<feature>) or C<use v5.16>, returns a reference to the current 71subroutine, making it easier to write recursive closures. 72 73=head2 New and Improved Built-ins 74 75=head3 More consistent C<eval> 76 77The C<eval> operator sometimes treats a string argument as a sequence of 78characters and sometimes as a sequence of bytes, depending on the 79internal encoding. The internal encoding is not supposed to make any 80difference, but there is code that relies on this inconsistency. 81 82The new C<unicode_eval> and C<evalbytes> features (enabled under C<use 835.16.0>) resolve this. The C<unicode_eval> feature causes C<eval 84$string> to treat the string always as Unicode. The C<evalbytes> 85features provides a function, itself called C<evalbytes>, which 86evaluates its argument always as a string of bytes. 87 88These features also fix oddities with source filters leaking to outer 89dynamic scopes. 90 91See L<feature> for more detail. 92 93=head3 C<substr> lvalue revamp 94 95=for comment Does this belong here, or under Incompatible Changes? 96 97When C<substr> is called in lvalue or potential lvalue context with two 98or three arguments, a special lvalue scalar is returned that modifies 99the original string (the first argument) when assigned to. 100 101Previously, the offsets (the second and third arguments) passed to 102C<substr> would be converted immediately to match the string, negative 103offsets being translated to positive and offsets beyond the end of the 104string being truncated. 105 106Now, the offsets are recorded without modification in the special 107lvalue scalar that is returned, and the original string is not even 108looked at by C<substr> itself, but only when the returned lvalue is 109read or modified. 110 111These changes result in an incompatible change: 112 113If the original string changes length after the call to C<substr> but 114before assignment to its return value, negative offsets will remember 115their position from the end of the string, affecting code like this: 116 117 my $string = "string"; 118 my $lvalue = \substr $string, -4, 2; 119 print $$lvalue, "\n"; # prints "ri" 120 $string = "bailing twine"; 121 print $$lvalue, "\n"; # prints "wi"; used to print "il" 122 123The same thing happens with an omitted third argument. The returned 124lvalue will always extend to the end of the string, even if the string 125becomes longer. 126 127Since this change also allowed many bugs to be fixed (see 128L</The C<substr> operator>), and since the behavior 129of negative offsets has never been specified, the 130change was deemed acceptable. 131 132=head3 Return value of C<tied> 133 134The value returned by C<tied> on a tied variable is now the actual 135scalar that holds the object to which the variable is tied. This 136lets ties be weakened with C<Scalar::Util::weaken(tied 137$tied_variable)>. 138 139=head2 Unicode Support 140 141=head3 Supports (I<almost>) Unicode 6.1 142 143Besides the addition of whole new scripts, and new characters in 144existing scripts, this new version of Unicode, as always, makes some 145changes to existing characters. One change that may trip up some 146applications is that the General Category of two characters in the 147Latin-1 range, PILCROW SIGN and SECTION SIGN, has been changed from 148Other_Symbol to Other_Punctuation. The same change has been made for 149a character in each of Tibetan, Ethiopic, and Aegean. 150The code points U+3248..U+324F (CIRCLED NUMBER TEN ON BLACK SQUARE 151through CIRCLED NUMBER EIGHTY ON BLACK SQUARE) have had their General 152Category changed from Other_Symbol to Other_Numeric. The Line Break 153property has changes for Hebrew and Japanese; and because of 154other changes in 6.1, the Perl regular expression construct C<\X> now 155works differently for some characters in Thai and Lao. 156 157New aliases (synonyms) have been defined for many property values; 158these, along with the previously existing ones, are all cross-indexed in 159L<perluniprops>. 160 161The return value of C<charnames::viacode()> is affected by other 162changes: 163 164 Code point Old Name New Name 165 U+000A LINE FEED (LF) LINE FEED 166 U+000C FORM FEED (FF) FORM FEED 167 U+000D CARRIAGE RETURN (CR) CARRIAGE RETURN 168 U+0085 NEXT LINE (NEL) NEXT LINE 169 U+008E SINGLE-SHIFT 2 SINGLE-SHIFT-2 170 U+008F SINGLE-SHIFT 3 SINGLE-SHIFT-3 171 U+0091 PRIVATE USE 1 PRIVATE USE-1 172 U+0092 PRIVATE USE 2 PRIVATE USE-2 173 U+2118 SCRIPT CAPITAL P WEIERSTRASS ELLIPTIC FUNCTION 174 175Perl will accept any of these names as input, but 176C<charnames::viacode()> now returns the new name of each pair. The 177change for U+2118 is considered by Unicode to be a correction, that is 178the original name was a mistake (but again, it will remain forever valid 179to use it to refer to U+2118). But most of these changes are the 180fallout of the mistake Unicode 6.0 made in naming a character used in 181Japanese cell phones to be "BELL", which conflicts with the longstanding 182industry use of (and Unicode's recommendation to use) that name 183to mean the ASCII control character at U+0007. Therefore, that name 184has been deprecated in Perl since v5.14, and any use of it will raise a 185warning message (unless turned off). The name "ALERT" is now the 186preferred name for this code point, with "BEL" an acceptable short 187form. The name for the new cell phone character, at code point U+1F514, 188remains undefined in this version of Perl (hence we don't 189implement quite all of Unicode 6.1), but starting in v5.18, BELL will mean 190this character, and not U+0007. 191 192Unicode has taken steps to make sure that this sort of mistake does not 193happen again. The Standard now includes all generally accepted 194names and abbreviations for control characters, whereas previously it 195didn't (though there were recommended names for most of them, which Perl 196used). This means that most of those recommended names are now 197officially in the Standard. Unicode did not recommend names for the 198four code points listed above between U+008E and U+008F, and in 199standardizing them Unicode subtly changed the names that Perl had 200previously given them, by replacing the final blank in each name by a 201hyphen. Unicode also officially accepts names that Perl had deprecated, 202such as FILE SEPARATOR. Now the only deprecated name is BELL. 203Finally, Perl now uses the new official names instead of the old 204(now considered obsolete) names for the first four code points in the 205list above (the ones which have the parentheses in them). 206 207Now that the names have been placed in the Unicode standard, these kinds 208of changes should not happen again, though corrections, such as to 209U+2118, are still possible. 210 211Unicode also added some name abbreviations, which Perl now accepts: 212SP for SPACE; 213TAB for CHARACTER TABULATION; 214NEW LINE, END OF LINE, NL, and EOL for LINE FEED; 215LOCKING-SHIFT ONE for SHIFT OUT; 216LOCKING-SHIFT ZERO for SHIFT IN; 217and ZWNBSP for ZERO WIDTH NO-BREAK SPACE. 218 219More details on this version of Unicode are provided in 220L<http://www.unicode.org/versions/Unicode6.1.0/>. 221 222=head3 C<use charnames> is no longer needed for C<\N{I<name>}> 223 224When C<\N{I<name>}> is encountered, the C<charnames> module is now 225automatically loaded when needed as if the C<:full> and C<:short> 226options had been specified. See L<charnames> for more information. 227 228=head3 C<\N{...}> can now have Unicode loose name matching 229 230This is described in the C<charnames> item in 231L</Updated Modules and Pragmata> below. 232 233=head3 Unicode Symbol Names 234 235Perl now has proper support for Unicode in symbol names. It used to be 236that C<*{$foo}> would ignore the internal UTF8 flag and use the bytes of 237the underlying representation to look up the symbol. That meant that 238C<*{"\x{100}"}> and C<*{"\xc4\x80"}> would return the same thing. All 239these parts of Perl have been fixed to account for Unicode: 240 241=over 242 243=item * 244 245Method names (including those passed to C<use overload>) 246 247=item * 248 249Typeglob names (including names of variables, subroutines, and filehandles) 250 251=item * 252 253Package names 254 255=item * 256 257C<goto> 258 259=item * 260 261Symbolic dereferencing 262 263=item * 264 265Second argument to C<bless()> and C<tie()> 266 267=item * 268 269Return value of C<ref()> 270 271=item * 272 273Subroutine prototypes 274 275=item * 276 277Attributes 278 279=item * 280 281Various warnings and error messages that mention variable names or values, 282methods, etc. 283 284=back 285 286In addition, a parsing bug has been fixed that prevented C<*{é}> from 287implicitly quoting the name, but instead interpreted it as C<*{+é}>, which 288would cause a strict violation. 289 290C<*{"*a::b"}> automatically strips off the * if it is followed by an ASCII 291letter. That has been extended to all Unicode identifier characters. 292 293One-character non-ASCII non-punctuation variables (like C<$é>) are now 294subject to "Used only once" warnings. They used to be exempt, as they 295were treated as punctuation variables. 296 297Also, single-character Unicode punctuation variables (like C<$‰>) are now 298supported [perl #69032]. 299 300=head3 Improved ability to mix locales and Unicode, including UTF-8 locales 301 302An optional parameter has been added to C<use locale> 303 304 use locale ':not_characters'; 305 306which tells Perl to use all but the C<LC_CTYPE> and C<LC_COLLATE> 307portions of the current locale. Instead, the character set is assumed 308to be Unicode. This lets locales and Unicode be seamlessly mixed, 309including the increasingly frequent UTF-8 locales. When using this 310hybrid form of locales, the C<:locale> layer to the L<open> pragma can 311be used to interface with the file system, and there are CPAN modules 312available for ARGV and environment variable conversions. 313 314Full details are in L<perllocale>. 315 316=head3 New function C<fc> and corresponding escape sequence C<\F> for Unicode foldcase 317 318Unicode foldcase is an extension to lowercase that gives better results 319when comparing two strings case-insensitively. It has long been used 320internally in regular expression C</i> matching. Now it is available 321explicitly through the new C<fc> function call (enabled by 322S<C<"use feature 'fc'">>, or C<use v5.16>, or explicitly callable via 323C<CORE::fc>) or through the new C<\F> sequence in double-quotish 324strings. 325 326Full details are in L<perlfunc/fc>. 327 328=head3 The Unicode C<Script_Extensions> property is now supported. 329 330New in Unicode 6.0, this is an improved C<Script> property. Details 331are in L<perlunicode/Scripts>. 332 333=head2 XS Changes 334 335=head3 Improved typemaps for Some Builtin Types 336 337Most XS authors will know there is a longstanding bug in the 338OUTPUT typemap for T_AVREF (C<AV*>), T_HVREF (C<HV*>), T_CVREF (C<CV*>), 339and T_SVREF (C<SVREF> or C<\$foo>) that requires manually decrementing 340the reference count of the return value instead of the typemap taking 341care of this. For backwards-compatibility, this cannot be changed in the 342default typemaps. But we now provide additional typemaps 343C<T_AVREF_REFCOUNT_FIXED>, etc. that do not exhibit this bug. Using 344them in your extension is as simple as having one line in your 345C<TYPEMAP> section: 346 347 HV* T_HVREF_REFCOUNT_FIXED 348 349=head3 C<is_utf8_char()> 350 351The XS-callable function C<is_utf8_char()>, when presented with 352malformed UTF-8 input, can read up to 12 bytes beyond the end of the 353string. This cannot be fixed without changing its API, and so its 354use is now deprecated. Use C<is_utf8_char_buf()> (described just below) 355instead. 356 357=head3 Added C<is_utf8_char_buf()> 358 359This function is designed to replace the deprecated L</is_utf8_char()> 360function. It includes an extra parameter to make sure it doesn't read 361past the end of the input buffer. 362 363=head3 Other C<is_utf8_foo()> functions, as well as C<utf8_to_foo()>, etc. 364 365Most other XS-callable functions that take UTF-8 encoded input 366implicitly assume that the UTF-8 is valid (not malformed) with respect to 367buffer length. Do not do things such as change a character's case or 368see if it is alphanumeric without first being sure that it is valid 369UTF-8. This can be safely done for a whole string by using one of the 370functions C<is_utf8_string()>, C<is_utf8_string_loc()>, and 371C<is_utf8_string_loclen()>. 372 373=head3 New Pad API 374 375Many new functions have been added to the API for manipulating lexical 376pads. See L<perlapi/Pad Data Structures> for more information. 377 378=head2 Changes to Special Variables 379 380=head3 C<$$> can be assigned to 381 382C<$$> was made read-only in Perl 5.8.0. But only sometimes: C<local $$> 383would make it writable again. Some CPAN modules were using C<local $$> or 384XS code to bypass the read-only check, so there is no reason to keep C<$$> 385read-only. (This change also allowed a bug to be fixed while maintaining 386backward compatibility.) 387 388=head3 C<$^X> converted to an absolute path on FreeBSD, OS X and Solaris 389 390C<$^X> is now converted to an absolute path on OS X, FreeBSD (without 391needing F</proc> mounted) and Solaris 10 and 11. This augments the 392previous approach of using F</proc> on Linux, FreeBSD, and NetBSD 393(in all cases, where mounted). 394 395This makes relocatable perl installations more useful on these platforms. 396(See "Relocatable @INC" in F<INSTALL>) 397 398=head2 Debugger Changes 399 400=head3 Features inside the debugger 401 402The current Perl's L<feature> bundle is now enabled for commands entered 403in the interactive debugger. 404 405=head3 New option for the debugger's B<t> command 406 407The B<t> command in the debugger, which toggles tracing mode, now 408accepts a numeric argument that determines how many levels of subroutine 409calls to trace. 410 411=head3 C<enable> and C<disable> 412 413The debugger now has C<disable> and C<enable> commands for disabling 414existing breakpoints and re-enabling them. See L<perldebug>. 415 416=head3 Breakpoints with file names 417 418The debugger's "b" command for setting breakpoints now lets a line 419number be prefixed with a file name. See 420L<perldebug/"b [file]:[line] [condition]">. 421 422=head2 The C<CORE> Namespace 423 424=head3 The C<CORE::> prefix 425 426The C<CORE::> prefix can now be used on keywords enabled by 427L<feature.pm|feature>, even outside the scope of C<use feature>. 428 429=head3 Subroutines in the C<CORE> namespace 430 431Many Perl keywords are now available as subroutines in the CORE namespace. 432This lets them be aliased: 433 434 BEGIN { *entangle = \&CORE::tie } 435 entangle $variable, $package, @args; 436 437And for prototypes to be bypassed: 438 439 sub mytie(\[%$*@]$@) { 440 my ($ref, $pack, @args) = @_; 441 ... do something ... 442 goto &CORE::tie; 443 } 444 445Some of these cannot be called through references or via C<&foo> syntax, 446but must be called as barewords. 447 448See L<CORE> for details. 449 450=head2 Other Changes 451 452=head3 Anonymous handles 453 454Automatically generated file handles are now named __ANONIO__ when the 455variable name cannot be determined, rather than $__ANONIO__. 456 457=head3 Autoloaded sort Subroutines 458 459Custom sort subroutines can now be autoloaded [perl #30661]: 460 461 sub AUTOLOAD { ... } 462 @sorted = sort foo @list; # uses AUTOLOAD 463 464=head3 C<continue> no longer requires the "switch" feature 465 466The C<continue> keyword has two meanings. It can introduce a C<continue> 467block after a loop, or it can exit the current C<when> block. Up to now, 468the latter meaning was valid only with the "switch" feature enabled, and 469was a syntax error otherwise. Since the main purpose of feature.pm is to 470avoid conflicts with user-defined subroutines, there is no reason for 471C<continue> to depend on it. 472 473=head3 DTrace probes for interpreter phase change 474 475The C<phase-change> probes will fire when the interpreter's phase 476changes, which tracks the C<${^GLOBAL_PHASE}> variable. C<arg0> is 477the new phase name; C<arg1> is the old one. This is useful 478for limiting your instrumentation to one or more of: compile time, 479run time, or destruct time. 480 481=head3 C<__FILE__()> Syntax 482 483The C<__FILE__>, C<__LINE__> and C<__PACKAGE__> tokens can now be written 484with an empty pair of parentheses after them. This makes them parse the 485same way as C<time>, C<fork> and other built-in functions. 486 487=head3 The C<\$> prototype accepts any scalar lvalue 488 489The C<\$> and C<\[$]> subroutine prototypes now accept any scalar lvalue 490argument. Previously they accepted only scalars beginning with C<$> and 491hash and array elements. This change makes them consistent with the way 492the built-in C<read> and C<recv> functions (among others) parse their 493arguments. This means that one can override the built-in functions with 494custom subroutines that parse their arguments the same way. 495 496=head3 C<_> in subroutine prototypes 497 498The C<_> character in subroutine prototypes is now allowed before C<@> or 499C<%>. 500 501=head1 Security 502 503=head2 Use C<is_utf8_char_buf()> and not C<is_utf8_char()> 504 505The latter function is now deprecated because its API is insufficient to 506guarantee that it doesn't read (up to 12 bytes in the worst case) beyond 507the end of its input string. See 508L<is_utf8_char_buf()|/Added is_utf8_char_buf()>. 509 510=head2 Malformed UTF-8 input could cause attempts to read beyond the end of the buffer 511 512Two new XS-accessible functions, C<utf8_to_uvchr_buf()> and 513C<utf8_to_uvuni_buf()> are now available to prevent this, and the Perl 514core has been converted to use them. 515See L</Internal Changes>. 516 517=head2 C<File::Glob::bsd_glob()> memory error with GLOB_ALTDIRFUNC (CVE-2011-2728). 518 519Calling C<File::Glob::bsd_glob> with the unsupported flag 520GLOB_ALTDIRFUNC would cause an access violation / segfault. A Perl 521program that accepts a flags value from an external source could expose 522itself to denial of service or arbitrary code execution attacks. There 523are no known exploits in the wild. The problem has been corrected by 524explicitly disabling all unsupported flags and setting unused function 525pointers to null. Bug reported by Clément Lecigne. (5.14.2) 526 527=head2 Privileges are now set correctly when assigning to C<$(> 528 529A hypothetical bug (probably unexploitable in practice) because the 530incorrect setting of the effective group ID while setting C<$(> has been 531fixed. The bug would have affected only systems that have C<setresgid()> 532but not C<setregid()>, but no such systems are known to exist. 533 534=head1 Deprecations 535 536=head2 Don't read the Unicode data base files in F<lib/unicore> 537 538It is now deprecated to directly read the Unicode data base files. 539These are stored in the F<lib/unicore> directory. Instead, you should 540use the new functions in L<Unicode::UCD>. These provide a stable API, 541and give complete information. 542 543Perl may at some point in the future change or remove these files. The 544file which applications were most likely to have used is 545F<lib/unicore/ToDigit.pl>. L<Unicode::UCD/prop_invmap()> can be used to 546get at its data instead. 547 548=head2 XS functions C<is_utf8_char()>, C<utf8_to_uvchr()> and 549C<utf8_to_uvuni()> 550 551This function is deprecated because it could read beyond the end of the 552input string. Use the new L<is_utf8_char_buf()|/Added is_utf8_char_buf()>, 553C<utf8_to_uvchr_buf()> and C<utf8_to_uvuni_buf()> instead. 554 555=head1 Future Deprecations 556 557This section serves as a notice of features that are I<likely> to be 558removed or L<deprecated|perlpolicy/deprecated> in the next release of 559perl (5.18.0). If your code depends on these features, you should 560contact the Perl 5 Porters via the L<mailing 561list|http://lists.perl.org/list/perl5-porters.html> or L<perlbug> to 562explain your use case and inform the deprecation process. 563 564=head2 Core Modules 565 566These modules may be marked as deprecated I<from the core>. This only 567means that they will no longer be installed by default with the core 568distribution, but will remain available on the CPAN. 569 570=over 571 572=item * 573 574CPANPLUS 575 576=item * 577 578Filter::Simple 579 580=item * 581 582PerlIO::mmap 583 584=item * 585 586Pod::LaTeX 587 588=item * 589 590Pod::Parser 591 592=item * 593 594SelfLoader 595 596=item * 597 598Text::Soundex 599 600=item * 601 602Thread.pm 603 604=back 605 606=head2 Platforms with no supporting programmers 607 608These platforms will probably have their 609special build support removed during the 6105.17.0 development series. 611 612=over 613 614=item * 615 616BeOS 617 618=item * 619 620djgpp 621 622=item * 623 624dgux 625 626=item * 627 628EPOC 629 630=item * 631 632MPE/iX 633 634=item * 635 636Rhapsody 637 638=item * 639 640UTS 641 642=item * 643 644VM/ESA 645 646=back 647 648=head2 Other Future Deprecations 649 650=over 651 652=item * 653 654Swapping of $< and $> 655 656For more information about this future deprecation, see L<the relevant RT 657ticket|https://github.com/Perl/perl5/issues/11547>. 658 659=item * 660 661sfio, stdio 662 663Perl supports being built without PerlIO proper, using a stdio or sfio 664wrapper instead. A perl build like this will not support IO layers and 665thus Unicode IO, making it rather handicapped. 666 667PerlIO supports a C<stdio> layer if stdio use is desired, and similarly a 668sfio layer could be produced. 669 670=item * 671 672Unescaped literal C<< "{" >> in regular expressions. 673 674Starting with v5.20, it is planned to require a literal C<"{"> to be 675escaped, for example by preceding it with a backslash. In v5.18, a 676deprecated warning message will be emitted for all such uses. 677This affects only patterns that are to match a literal C<"{">. Other 678uses of this character, such as part of a quantifier or sequence as in 679those below, are completely unaffected: 680 681 /foo{3,5}/ 682 /\p{Alphabetic}/ 683 /\N{DIGIT ZERO} 684 685Removing this will permit extensions to Perl's pattern syntax and better 686error checking for existing syntax. See L<perlre/Quantifiers> for an 687example. 688 689=item * 690 691Revamping C<< "\Q" >> semantics in double-quotish strings when combined with other escapes. 692 693There are several bugs and inconsistencies involving combinations 694of C<\Q> and escapes like C<\x>, C<\L>, etc., within a C<\Q...\E> pair. 695These need to be fixed, and doing so will necessarily change current 696behavior. The changes have not yet been settled. 697 698=back 699 700=head1 Incompatible Changes 701 702=head2 Special blocks called in void context 703 704Special blocks (C<BEGIN>, C<CHECK>, C<INIT>, C<UNITCHECK>, C<END>) are now 705called in void context. This avoids wasteful copying of the result of the 706last statement [perl #108794]. 707 708=head2 The C<overloading> pragma and regexp objects 709 710With C<no overloading>, regular expression objects returned by C<qr//> are 711now stringified as "Regexp=REGEXP(0xbe600d)" instead of the regular 712expression itself [perl #108780]. 713 714=head2 Two XS typemap Entries removed 715 716Two presumably unused XS typemap entries have been removed from the 717core typemap: T_DATAUNIT and T_CALLBACK. If you are, against all odds, 718a user of these, please see the instructions on how to restore them 719in L<perlxstypemap>. 720 721=head2 Unicode 6.1 has incompatibilities with Unicode 6.0 722 723These are detailed in L</Supports (almost) Unicode 6.1> above. 724You can compile this version of Perl to use Unicode 6.0. See 725L<perlunicode/Hacking Perl to work on earlier Unicode versions (for very serious hackers only)>. 726 727=head2 Borland compiler 728 729All support for the Borland compiler has been dropped. The code had not 730worked for a long time anyway. 731 732=head2 Certain deprecated Unicode properties are no longer supported by default 733 734Perl should never have exposed certain Unicode properties that are used 735by Unicode internally and not meant to be publicly available. Use of 736these has generated deprecated warning messages since Perl 5.12. The 737removed properties are Other_Alphabetic, 738Other_Default_Ignorable_Code_Point, Other_Grapheme_Extend, 739Other_ID_Continue, Other_ID_Start, Other_Lowercase, Other_Math, and 740Other_Uppercase. 741 742Perl may be recompiled to include any or all of them; instructions are 743given in 744L<perluniprops/Unicode character properties that are NOT accepted by Perl>. 745 746=head2 Dereferencing IO thingies as typeglobs 747 748The C<*{...}> operator, when passed a reference to an IO thingy (as in 749C<*{*STDIN{IO}}>), creates a new typeglob containing just that IO object. 750Previously, it would stringify as an empty string, but some operators would 751treat it as undefined, producing an "uninitialized" warning. 752Now it stringifies as __ANONIO__ [perl #96326]. 753 754=head2 User-defined case-changing operations 755 756This feature was deprecated in Perl 5.14, and has now been removed. 757The CPAN module L<Unicode::Casing> provides better functionality without 758the drawbacks that this feature had, as are detailed in the 5.14 759documentation: 760L<http://perldoc.perl.org/5.14.0/perlunicode.html#User-Defined-Case-Mappings-%28for-serious-hackers-only%29> 761 762=head2 XSUBs are now 'static' 763 764XSUB C functions are now 'static', that is, they are not visible from 765outside the compilation unit. Users can use the new C<XS_EXTERNAL(name)> 766and C<XS_INTERNAL(name)> macros to pick the desired linking behavior. 767The ordinary C<XS(name)> declaration for XSUBs will continue to declare 768non-'static' XSUBs for compatibility, but the XS compiler, 769L<ExtUtils::ParseXS> (C<xsubpp>) will emit 'static' XSUBs by default. 770L<ExtUtils::ParseXS>'s behavior can be reconfigured from XS using the 771C<EXPORT_XSUB_SYMBOLS> keyword. See L<perlxs> for details. 772 773=head2 Weakening read-only references 774 775Weakening read-only references is no longer permitted. It should never 776have worked anyway, and could sometimes result in crashes. 777 778=head2 Tying scalars that hold typeglobs 779 780Attempting to tie a scalar after a typeglob was assigned to it would 781instead tie the handle in the typeglob's IO slot. This meant that it was 782impossible to tie the scalar itself. Similar problems affected C<tied> and 783C<untie>: C<tied $scalar> would return false on a tied scalar if the last 784thing returned was a typeglob, and C<untie $scalar> on such a tied scalar 785would do nothing. 786 787We fixed this problem before Perl 5.14.0, but it caused problems with some 788CPAN modules, so we put in a deprecation cycle instead. 789 790Now the deprecation has been removed and this bug has been fixed. So 791C<tie $scalar> will always tie the scalar, not the handle it holds. To tie 792the handle, use C<tie *$scalar> (with an explicit asterisk). The same 793applies to C<tied *$scalar> and C<untie *$scalar>. 794 795=head2 IPC::Open3 no longer provides C<xfork()>, C<xclose_on_exec()> 796and C<xpipe_anon()> 797 798All three functions were private, undocumented, and unexported. They do 799not appear to be used by any code on CPAN. Two have been inlined and one 800deleted entirely. 801 802=head2 C<$$> no longer caches PID 803 804Previously, if one called fork(3) from C, Perl's 805notion of C<$$> could go out of sync with what getpid() returns. By always 806fetching the value of C<$$> via getpid(), this potential bug is eliminated. 807Code that depends on the caching behavior will break. As described in 808L<Core Enhancements|/C<$$> can be assigned to>, 809C<$$> is now writable, but it will be reset during a 810fork. 811 812=head2 C<$$> and C<getppid()> no longer emulate POSIX semantics under LinuxThreads 813 814The POSIX emulation of C<$$> and C<getppid()> under the obsolete 815LinuxThreads implementation has been removed. 816This only impacts users of Linux 2.4 and 817users of Debian GNU/kFreeBSD up to and including 6.0, not the vast 818majority of Linux installations that use NPTL threads. 819 820This means that C<getppid()>, like C<$$>, is now always guaranteed to 821return the OS's idea of the current state of the process, not perl's 822cached version of it. 823 824See the documentation for L<$$|perlvar/$$> for details. 825 826=head2 C<< $< >>, C<< $> >>, C<$(> and C<$)> are no longer cached 827 828Similarly to the changes to C<$$> and C<getppid()>, the internal 829caching of C<< $< >>, C<< $> >>, C<$(> and C<$)> has been removed. 830 831When we cached these values our idea of what they were would drift out 832of sync with reality if someone (e.g., someone embedding perl) called 833C<sete?[ug]id()> without updating C<PL_e?[ug]id>. Having to deal with 834this complexity wasn't worth it given how cheap the C<gete?[ug]id()> 835system call is. 836 837This change will break a handful of CPAN modules that use the XS-level 838C<PL_uid>, C<PL_gid>, C<PL_euid> or C<PL_egid> variables. 839 840The fix for those breakages is to use C<PerlProc_gete?[ug]id()> to 841retrieve them (e.g., C<PerlProc_getuid()>), and not to assign to 842C<PL_e?[ug]id> if you change the UID/GID/EUID/EGID. There is no longer 843any need to do so since perl will always retrieve the up-to-date 844version of those values from the OS. 845 846=head2 Which Non-ASCII characters get quoted by C<quotemeta> and C<\Q> has changed 847 848This is unlikely to result in a real problem, as Perl does not attach 849special meaning to any non-ASCII character, so it is currently 850irrelevant which are quoted or not. This change fixes bug [perl #77654] and 851brings Perl's behavior more into line with Unicode's recommendations. 852See L<perlfunc/quotemeta>. 853 854=head1 Performance Enhancements 855 856=over 857 858=item * 859 860Improved performance for Unicode properties in regular expressions 861 862=for comment Can this be compacted some? -- rjbs, 2012-02-20 863 864Matching a code point against a Unicode property is now done via a 865binary search instead of linear. This means for example that the worst 866case for a 1000 item property is 10 probes instead of 1000. This 867inefficiency has been compensated for in the past by permanently storing 868in a hash the results of a given probe plus the results for the adjacent 86964 code points, under the theory that near-by code points are likely to 870be searched for. A separate hash was used for each mention of a Unicode 871property in each regular expression. Thus, C<qr/\p{foo}abc\p{foo}/> 872would generate two hashes. Any probes in one instance would be unknown 873to the other, and the hashes could expand separately to be quite large 874if the regular expression were used on many different widely-separated 875code points. 876Now, however, there is just one hash shared by all instances of a given 877property. This means that if C<\p{foo}> is matched against "A" in one 878regular expression in a thread, the result will be known immediately to 879all regular expressions, and the relentless march of using up memory is 880slowed considerably. 881 882=item * 883 884Version declarations with the C<use> keyword (e.g., C<use 5.012>) are now 885faster, as they enable features without loading F<feature.pm>. 886 887=item * 888 889C<local $_> is faster now, as it no longer iterates through magic that it 890is not going to copy anyway. 891 892=item * 893 894Perl 5.12.0 sped up the destruction of objects whose classes define 895empty C<DESTROY> methods (to prevent autoloading), by simply not 896calling such empty methods. This release takes this optimization a 897step further, by not calling any C<DESTROY> method that begins with a 898C<return> statement. This can be useful for destructors that are only 899used for debugging: 900 901 use constant DEBUG => 1; 902 sub DESTROY { return unless DEBUG; ... } 903 904Constant-folding will reduce the first statement to C<return;> if DEBUG 905is set to 0, triggering this optimization. 906 907=item * 908 909Assigning to a variable that holds a typeglob or copy-on-write scalar 910is now much faster. Previously the typeglob would be stringified or 911the copy-on-write scalar would be copied before being clobbered. 912 913=item * 914 915Assignment to C<substr> in void context is now more than twice its 916previous speed. Instead of creating and returning a special lvalue 917scalar that is then assigned to, C<substr> modifies the original string 918itself. 919 920=item * 921 922C<substr> no longer calculates a value to return when called in void 923context. 924 925=item * 926 927Due to changes in L<File::Glob>, Perl's C<glob> function and its C<< 928<...> >> equivalent are now much faster. The splitting of the pattern 929into words has been rewritten in C, resulting in speed-ups of 20% for 930some cases. 931 932This does not affect C<glob> on VMS, as it does not use File::Glob. 933 934=item * 935 936The short-circuiting operators C<&&>, C<||>, and C<//>, when chained 937(such as C<$a || $b || $c>), are now considerably faster to short-circuit, 938due to reduced optree traversal. 939 940=item * 941 942The implementation of C<s///r> makes one fewer copy of the scalar's value. 943 944=item * 945 946Recursive calls to lvalue subroutines in lvalue scalar context use less 947memory. 948 949=back 950 951=head1 Modules and Pragmata 952 953=head2 Deprecated Modules 954 955=over 956 957=item L<Version::Requirements> 958 959Version::Requirements is now DEPRECATED, use L<CPAN::Meta::Requirements>, 960which is a drop-in replacement. It will be deleted from perl.git blead 961in v5.17.0. 962 963=back 964 965=head2 New Modules and Pragmata 966 967=over 4 968 969=item * 970 971L<arybase> -- this new module implements the C<$[> variable. 972 973=item * 974 975L<PerlIO::mmap> 0.010 has been added to the Perl core. 976 977The C<mmap> PerlIO layer is no longer implemented by perl itself, but has 978been moved out into the new L<PerlIO::mmap> module. 979 980=back 981 982=head2 Updated Modules and Pragmata 983 984This is only an overview of selected module updates. For a complete list of 985updates, run: 986 987 $ corelist --diff 5.14.0 5.16.0 988 989You can substitute your favorite version in place of 5.14.0, too. 990 991=over 4 992 993=item * 994 995L<Archive::Extract> has been upgraded from version 0.48 to 0.58. 996 997Includes a fix for FreeBSD to only use C<unzip> if it is located in 998C</usr/local/bin>, as FreeBSD 9.0 will ship with a limited C<unzip> in 999C</usr/bin>. 1000 1001=item * 1002 1003L<Archive::Tar> has been upgraded from version 1.76 to 1.82. 1004 1005Adjustments to handle files >8gb (>0777777777777 octal) and a feature 1006to return the MD5SUM of files in the archive. 1007 1008=item * 1009 1010L<base> has been upgraded from version 2.16 to 2.18. 1011 1012C<base> no longer sets a module's C<$VERSION> to "-1" when a module it 1013loads does not define a C<$VERSION>. This change has been made because 1014"-1" is not a valid version number under the new "lax" criteria used 1015internally by C<UNIVERSAL::VERSION>. (See L<version> for more on "lax" 1016version criteria.) 1017 1018C<base> no longer internally skips loading modules it has already loaded 1019and instead relies on C<require> to inspect C<%INC>. This fixes a bug 1020when C<base> is used with code that clear C<%INC> to force a module to 1021be reloaded. 1022 1023=item * 1024 1025L<Carp> has been upgraded from version 1.20 to 1.26. 1026 1027It now includes last read filehandle info and puts a dot after the file 1028and line number, just like errors from C<die> [perl #106538]. 1029 1030=item * 1031 1032L<charnames> has been updated from version 1.18 to 1.30. 1033 1034C<charnames> can now be invoked with a new option, C<:loose>, 1035which is like the existing C<:full> option, but enables Unicode loose 1036name matching. Details are in L<charnames/LOOSE MATCHES>. 1037 1038=item * 1039 1040L<B::Deparse> has been upgraded from version 1.03 to 1.14. This fixes 1041numerous deparsing bugs. 1042 1043=item * 1044 1045L<CGI> has been upgraded from version 3.52 to 3.59. 1046 1047It uses the public and documented FCGI.pm API in CGI::Fast. CGI::Fast was 1048using an FCGI API that was deprecated and removed from documentation 1049more than ten years ago. Usage of this deprecated API with FCGI E<gt>= 10500.70 or FCGI E<lt>= 0.73 introduces a security issue. 1051L<https://rt.cpan.org/Public/Bug/Display.html?id=68380> 1052L<http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-2766> 1053 1054Things that may break your code: 1055 1056C<url()> was fixed to return C<PATH_INFO> when it is explicitly requested 1057with either the C<path=E<gt>1> or C<path_info=E<gt>1> flag. 1058 1059If your code is running under mod_rewrite (or compatible) and you are 1060calling C<self_url()> or you are calling C<url()> and passing 1061C<path_info=E<gt>1>, these methods will actually be returning 1062C<PATH_INFO> now, as you have explicitly requested or C<self_url()> 1063has requested on your behalf. 1064 1065The C<PATH_INFO> has been omitted in such URLs since the issue was 1066introduced in the 3.12 release in December, 2005. 1067 1068This bug is so old your application may have come to depend on it or 1069workaround it. Check for application before upgrading to this release. 1070 1071Examples of affected method calls: 1072 1073 $q->url(-absolute => 1, -query => 1, -path_info => 1); 1074 $q->url(-path=>1); 1075 $q->url(-full=>1,-path=>1); 1076 $q->url(-rewrite=>1,-path=>1); 1077 $q->self_url(); 1078 1079We no longer read from STDIN when the Content-Length is not set, 1080preventing requests with no Content-Length from sometimes freezing. 1081This is consistent with the CGI RFC 3875, and is also consistent with 1082CGI::Simple. However, the old behavior may have been expected by some 1083command-line uses of CGI.pm. 1084 1085In addition, the DELETE HTTP verb is now supported. 1086 1087=item * 1088 1089L<Compress::Zlib> has been upgraded from version 2.035 to 2.048. 1090 1091IO::Compress::Zip and IO::Uncompress::Unzip now have support for LZMA 1092(method 14). There is a fix for a CRC issue in IO::Compress::Unzip and 1093it supports Streamed Stored context now. And fixed a Zip64 issue in 1094IO::Compress::Zip when the content size was exactly 0xFFFFFFFF. 1095 1096=item * 1097 1098L<Digest::SHA> has been upgraded from version 5.61 to 5.71. 1099 1100Added BITS mode to the addfile method and shasum. This makes 1101partial-byte inputs possible via files/STDIN and lets shasum check 1102all 8074 NIST Msg vectors, where previously special programming was 1103required to do this. 1104 1105=item * 1106 1107L<Encode> has been upgraded from version 2.42 to 2.44. 1108 1109Missing aliases added, a deep recursion error fixed and various 1110documentation updates. 1111 1112Addressed 'decode_xs n-byte heap-overflow' security bug in Unicode.xs 1113(CVE-2011-2939). (5.14.2) 1114 1115=item * 1116 1117L<ExtUtils::CBuilder> updated from version 0.280203 to 0.280206. 1118 1119The new version appends CFLAGS and LDFLAGS to their Config.pm 1120counterparts. 1121 1122=item * 1123 1124L<ExtUtils::ParseXS> has been upgraded from version 2.2210 to 3.16. 1125 1126Much of L<ExtUtils::ParseXS>, the module behind the XS compiler C<xsubpp>, 1127was rewritten and cleaned up. It has been made somewhat more extensible 1128and now finally uses strictures. 1129 1130The typemap logic has been moved into a separate module, 1131L<ExtUtils::Typemaps>. See L</New Modules and Pragmata>, above. 1132 1133For a complete set of changes, please see the ExtUtils::ParseXS 1134changelog, available on the CPAN. 1135 1136=item * 1137 1138L<File::Glob> has been upgraded from version 1.12 to 1.17. 1139 1140On Windows, tilde (~) expansion now checks the C<USERPROFILE> environment 1141variable, after checking C<HOME>. 1142 1143It has a new C<:bsd_glob> export tag, intended to replace C<:glob>. Like 1144C<:glob> it overrides C<glob> with a function that does not split the glob 1145pattern into words, but, unlike C<:glob>, it iterates properly in scalar 1146context, instead of returning the last file. 1147 1148There are other changes affecting Perl's own C<glob> operator (which uses 1149File::Glob internally, except on VMS). See L</Performance Enhancements> 1150and L</Selected Bug Fixes>. 1151 1152=item * 1153 1154L<FindBin> updated from version 1.50 to 1.51. 1155 1156It no longer returns a wrong result if a script of the same name as the 1157current one exists in the path and is executable. 1158 1159=item * 1160 1161L<HTTP::Tiny> has been upgraded from version 0.012 to 0.017. 1162 1163Added support for using C<$ENV{http_proxy}> to set the default proxy host. 1164 1165Adds additional shorthand methods for all common HTTP verbs, 1166a C<post_form()> method for POST-ing x-www-form-urlencoded data and 1167a C<www_form_urlencode()> utility method. 1168 1169=item * 1170 1171L<IO> has been upgraded from version 1.25_04 to 1.25_06, and L<IO::Handle> 1172from version 1.31 to 1.33. 1173 1174Together, these upgrades fix a problem with IO::Handle's C<getline> and 1175C<getlines> methods. When these methods are called on the special ARGV 1176handle, the next file is automatically opened, as happens with the built-in 1177C<E<lt>E<gt>> and C<readline> functions. But, unlike the built-ins, these 1178methods were not respecting the caller's use of the L<open> pragma and 1179applying the appropriate I/O layers to the newly-opened file 1180[rt.cpan.org #66474]. 1181 1182=item * 1183 1184L<IPC::Cmd> has been upgraded from version 0.70 to 0.76. 1185 1186Capturing of command output (both C<STDOUT> and C<STDERR>) is now supported 1187using L<IPC::Open3> on MSWin32 without requiring L<IPC::Run>. 1188 1189=item * 1190 1191L<IPC::Open3> has been upgraded from version 1.09 to 1.12. 1192 1193Fixes a bug which prevented use of C<open3> on Windows when C<*STDIN>, 1194C<*STDOUT> or C<*STDERR> had been localized. 1195 1196Fixes a bug which prevented duplicating numeric file descriptors on Windows. 1197 1198C<open3> with "-" for the program name works once more. This was broken in 1199version 1.06 (and hence in Perl 5.14.0) [perl #95748]. 1200 1201=item * 1202 1203L<Locale::Codes> has been upgraded from version 3.16 to 3.21. 1204 1205Added Language Extension codes (langext) and Language Variation codes (langvar) 1206as defined in the IANA language registry. 1207 1208Added language codes from ISO 639-5 1209 1210Added language/script codes from the IANA language subtag registry 1211 1212Fixed an uninitialized value warning [rt.cpan.org #67438]. 1213 1214Fixed the return value for the all_XXX_codes and all_XXX_names functions 1215[rt.cpan.org #69100]. 1216 1217Reorganized modules to move Locale::MODULE to Locale::Codes::MODULE to allow 1218for cleaner future additions. The original four modules (Locale::Language, 1219Locale::Currency, Locale::Country, Locale::Script) will continue to work, but 1220all new sets of codes will be added in the Locale::Codes namespace. 1221 1222The code2XXX, XXX2code, all_XXX_codes, and all_XXX_names functions now 1223support retired codes. All codesets may be specified by a constant or 1224by their name now. Previously, they were specified only by a constant. 1225 1226The alias_code function exists for backward compatibility. It has been 1227replaced by rename_country_code. The alias_code function will be 1228removed some time after September, 2013. 1229 1230All work is now done in the central module (Locale::Codes). Previously, 1231some was still done in the wrapper modules (Locale::Codes::*). Added 1232Language Family codes (langfam) as defined in ISO 639-5. 1233 1234=item * 1235 1236L<Math::BigFloat> has been upgraded from version 1.993 to 1.997. 1237 1238The C<numify> method has been corrected to return a normalized Perl number 1239(the result of C<0 + $thing>), instead of a string [rt.cpan.org #66732]. 1240 1241=item * 1242 1243L<Math::BigInt> has been upgraded from version 1.994 to 1.998. 1244 1245It provides a new C<bsgn> method that complements the C<babs> method. 1246 1247It fixes the internal C<objectify> function's handling of "foreign objects" 1248so they are converted to the appropriate class (Math::BigInt or 1249Math::BigFloat). 1250 1251=item * 1252 1253L<Math::BigRat> has been upgraded from version 0.2602 to 0.2603. 1254 1255C<int()> on a Math::BigRat object containing -1/2 now creates a 1256Math::BigInt containing 0, rather than -0. L<Math::BigInt> does not even 1257support negative zero, so the resulting object was actually malformed 1258[perl #95530]. 1259 1260=item * 1261 1262L<Math::Complex> has been upgraded from version 1.56 to 1.59 1263and L<Math::Trig> from version 1.2 to 1.22. 1264 1265Fixes include: correct copy constructor usage; fix polarwise formatting with 1266numeric format specifier; and more stable C<great_circle_direction> algorithm. 1267 1268=item * 1269 1270L<Module::CoreList> has been upgraded from version 2.51 to 2.66. 1271 1272The C<corelist> utility now understands the C<-r> option for displaying 1273Perl release dates and the C<--diff> option to print the set of modlib 1274changes between two perl distributions. 1275 1276=item * 1277 1278L<Module::Metadata> has been upgraded from version 1.000004 to 1.000009. 1279 1280Adds C<provides> method to generate a CPAN META provides data structure 1281correctly; use of C<package_versions_from_directory> is discouraged. 1282 1283=item * 1284 1285L<ODBM_File> has been upgraded from version 1.10 to 1.12. 1286 1287The XS code is now compiled with C<PERL_NO_GET_CONTEXT>, which will aid 1288performance under ithreads. 1289 1290=item * 1291 1292L<open> has been upgraded from version 1.08 to 1.10. 1293 1294It no longer turns off layers on standard handles when invoked without the 1295":std" directive. Similarly, when invoked I<with> the ":std" directive, it 1296now clears layers on STDERR before applying the new ones, and not just on 1297STDIN and STDOUT [perl #92728]. 1298 1299=item * 1300 1301L<overload> has been upgraded from version 1.13 to 1.18. 1302 1303C<overload::Overloaded> no longer calls C<can> on the class, but uses 1304another means to determine whether the object has overloading. It was 1305never correct for it to call C<can>, as overloading does not respect 1306AUTOLOAD. So classes that autoload methods and implement C<can> no longer 1307have to account for overloading [perl #40333]. 1308 1309A warning is now produced for invalid arguments. See L</New Diagnostics>. 1310 1311=item * 1312 1313L<PerlIO::scalar> has been upgraded from version 0.11 to 0.14. 1314 1315(This is the module that implements C<< open $fh, '>', \$scalar >>.) 1316 1317It fixes a problem with C<< open my $fh, ">", \$scalar >> not working if 1318C<$scalar> is a copy-on-write scalar. (5.14.2) 1319 1320It also fixes a hang that occurs with C<readline> or C<< <$fh> >> if a 1321typeglob has been assigned to $scalar [perl #92258]. 1322 1323It no longer assumes during C<seek> that $scalar is a string internally. 1324If it didn't crash, it was close to doing so [perl #92706]. Also, the 1325internal print routine no longer assumes that the position set by C<seek> 1326is valid, but extends the string to that position, filling the intervening 1327bytes (between the old length and the seek position) with nulls 1328[perl #78980]. 1329 1330Printing to an in-memory handle now works if the $scalar holds a reference, 1331stringifying the reference before modifying it. References used to be 1332treated as empty strings. 1333 1334Printing to an in-memory handle no longer crashes if the $scalar happens to 1335hold a number internally, but no string buffer. 1336 1337Printing to an in-memory handle no longer creates scalars that confuse 1338the regular expression engine [perl #108398]. 1339 1340=item * 1341 1342L<Pod::Functions> has been upgraded from version 1.04 to 1.05. 1343 1344F<Functions.pm> is now generated at perl build time from annotations in 1345F<perlfunc.pod>. This will ensure that L<Pod::Functions> and L<perlfunc> 1346remain in synchronisation. 1347 1348=item * 1349 1350L<Pod::Html> has been upgraded from version 1.11 to 1.1502. 1351 1352This is an extensive rewrite of Pod::Html to use L<Pod::Simple> under 1353the hood. The output has changed significantly. 1354 1355=item * 1356 1357L<Pod::Perldoc> has been upgraded from version 3.15_03 to 3.17. 1358 1359It corrects the search paths on VMS [perl #90640]. (5.14.1) 1360 1361The B<-v> option now fetches the right section for C<$0>. 1362 1363This upgrade has numerous significant fixes. Consult its changelog on 1364the CPAN for more information. 1365 1366=item * 1367 1368L<POSIX> has been upgraded from version 1.24 to 1.30. 1369 1370L<POSIX> no longer uses L<AutoLoader>. Any code which was relying on this 1371implementation detail was buggy, and may fail because of this change. 1372The module's Perl code has been considerably simplified, roughly halving 1373the number of lines, with no change in functionality. The XS code has 1374been refactored to reduce the size of the shared object by about 12%, 1375with no change in functionality. More POSIX functions now have tests. 1376 1377C<sigsuspend> and C<pause> now run signal handlers before returning, as the 1378whole point of these two functions is to wait until a signal has 1379arrived, and then return I<after> it has been triggered. Delayed, or 1380"safe", signals were preventing that from happening, possibly resulting in 1381race conditions [perl #107216]. 1382 1383C<POSIX::sleep> is now a direct call into the underlying OS C<sleep> 1384function, instead of being a Perl wrapper on C<CORE::sleep>. 1385C<POSIX::dup2> now returns the correct value on Win32 (I<i.e.>, the file 1386descriptor). C<POSIX::SigSet> C<sigsuspend> and C<sigpending> and 1387C<POSIX::pause> now dispatch safe signals immediately before returning to 1388their caller. 1389 1390C<POSIX::Termios::setattr> now defaults the third argument to C<TCSANOW>, 1391instead of 0. On most platforms C<TCSANOW> is defined to be 0, but on some 13920 is not a valid parameter, which caused a call with defaults to fail. 1393 1394=item * 1395 1396L<Socket> has been upgraded from version 1.94 to 2.001. 1397 1398It has new functions and constants for handling IPv6 sockets: 1399 1400 pack_ipv6_mreq 1401 unpack_ipv6_mreq 1402 IPV6_ADD_MEMBERSHIP 1403 IPV6_DROP_MEMBERSHIP 1404 IPV6_MTU 1405 IPV6_MTU_DISCOVER 1406 IPV6_MULTICAST_HOPS 1407 IPV6_MULTICAST_IF 1408 IPV6_MULTICAST_LOOP 1409 IPV6_UNICAST_HOPS 1410 IPV6_V6ONLY 1411 1412=item * 1413 1414L<Storable> has been upgraded from version 2.27 to 2.34. 1415 1416It no longer turns copy-on-write scalars into read-only scalars when 1417freezing and thawing. 1418 1419=item * 1420 1421L<Sys::Syslog> has been upgraded from version 0.27 to 0.29. 1422 1423This upgrade closes many outstanding bugs. 1424 1425=item * 1426 1427L<Term::ANSIColor> has been upgraded from version 3.00 to 3.01. 1428 1429Only interpret an initial array reference as a list of colors, not any initial 1430reference, allowing the colored function to work properly on objects with 1431stringification defined. 1432 1433=item * 1434 1435L<Term::ReadLine> has been upgraded from version 1.07 to 1.09. 1436 1437Term::ReadLine now supports any event loop, including unpublished ones and 1438simple L<IO::Select>, loops without the need to rewrite existing code for 1439any particular framework [perl #108470]. 1440 1441=item * 1442 1443L<threads::shared> has been upgraded from version 1.37 to 1.40. 1444 1445Destructors on shared objects used to be ignored sometimes if the objects 1446were referenced only by shared data structures. This has been mostly 1447fixed, but destructors may still be ignored if the objects still exist at 1448global destruction time [perl #98204]. 1449 1450=item * 1451 1452L<Unicode::Collate> has been upgraded from version 0.73 to 0.89. 1453 1454Updated to CLDR 1.9.1 1455 1456Locales updated to CLDR 2.0: mk, mt, nb, nn, ro, ru, sk, sr, sv, uk, 1457zh__pinyin, zh__stroke 1458 1459Newly supported locales: bn, fa, ml, mr, or, pa, sa, si, si__dictionary, 1460sr_Latn, sv__reformed, ta, te, th, ur, wae. 1461 1462Tailored compatibility ideographs as well as unified ideographs for the 1463locales: ja, ko, zh__big5han, zh__gb2312han, zh__pinyin, zh__stroke. 1464 1465Locale/*.pl files are now searched for in @INC. 1466 1467=item * 1468 1469L<Unicode::Normalize> has been upgraded from version 1.10 to 1.14. 1470 1471Fixes for the removal of F<unicore/CompositionExclusions.txt> from core. 1472 1473=item * 1474 1475L<Unicode::UCD> has been upgraded from version 0.32 to 0.43. 1476 1477This adds four new functions: C<prop_aliases()> and 1478C<prop_value_aliases()>, which are used to find all Unicode-approved 1479synonyms for property names, or to convert from one name to another; 1480C<prop_invlist> which returns all code points matching a given 1481Unicode binary property; and C<prop_invmap> which returns the complete 1482specification of a given Unicode property. 1483 1484=item * 1485 1486L<Win32API::File> has been upgraded from version 0.1101 to 0.1200. 1487 1488Added SetStdHandle and GetStdHandle functions 1489 1490=back 1491 1492=head2 Removed Modules and Pragmata 1493 1494As promised in Perl 5.14.0's release notes, the following modules have 1495been removed from the core distribution, and if needed should be installed 1496from CPAN instead. 1497 1498=over 1499 1500=item * 1501 1502L<Devel::DProf> has been removed from the Perl core. Prior version was 150320110228.00. 1504 1505=item * 1506 1507L<Shell> has been removed from the Perl core. Prior version was 0.72_01. 1508 1509=item * 1510 1511Several old perl4-style libraries which have been deprecated with 5.14 1512are now removed: 1513 1514 abbrev.pl assert.pl bigfloat.pl bigint.pl bigrat.pl cacheout.pl 1515 complete.pl ctime.pl dotsh.pl exceptions.pl fastcwd.pl flush.pl 1516 getcwd.pl getopt.pl getopts.pl hostname.pl importenv.pl 1517 lib/find{,depth}.pl look.pl newgetopt.pl open2.pl open3.pl 1518 pwd.pl shellwords.pl stat.pl tainted.pl termcap.pl timelocal.pl 1519 1520They can be found on CPAN as L<Perl4::CoreLibs>. 1521 1522=back 1523 1524=head1 Documentation 1525 1526=head2 New Documentation 1527 1528=head3 L<perldtrace> 1529 1530L<perldtrace> describes Perl's DTrace support, listing the provided probes 1531and gives examples of their use. 1532 1533=head3 L<perlexperiment> 1534 1535This document is intended to provide a list of experimental features in 1536Perl. It is still a work in progress. 1537 1538=head3 L<perlootut> 1539 1540This a new OO tutorial. It focuses on basic OO concepts, and then recommends 1541that readers choose an OO framework from CPAN. 1542 1543=head3 L<perlxstypemap> 1544 1545The new manual describes the XS typemapping mechanism in unprecedented 1546detail and combines new documentation with information extracted from 1547L<perlxs> and the previously unofficial list of all core typemaps. 1548 1549=head2 Changes to Existing Documentation 1550 1551=head3 L<perlapi> 1552 1553=over 4 1554 1555=item * 1556 1557The HV API has long accepted negative lengths to show that the key is 1558in UTF8. This is now documented. 1559 1560=item * 1561 1562The C<boolSV()> macro is now documented. 1563 1564=back 1565 1566=head3 L<perlfunc> 1567 1568=over 4 1569 1570=item * 1571 1572C<dbmopen> treats a 0 mode as a special case, that prevents a nonexistent 1573file from being created. This has been the case since Perl 5.000, but was 1574never documented anywhere. Now the perlfunc entry mentions it 1575[perl #90064]. 1576 1577=item * 1578 1579As an accident of history, C<open $fh, '<:', ...> applies the default 1580layers for the platform (C<:raw> on Unix, C<:crlf> on Windows), ignoring 1581whatever is declared by L<open.pm|open>. This seems such a useful feature 1582it has been documented in L<perlfunc|perlfunc/open> and L<open>. 1583 1584=item * 1585 1586The entry for C<split> has been rewritten. It is now far clearer than 1587before. 1588 1589=back 1590 1591=head3 L<perlguts> 1592 1593=over 4 1594 1595=item * 1596 1597A new section, L<Autoloading with XSUBs|perlguts/Autoloading with XSUBs>, 1598has been added, which explains the two APIs for accessing the name of the 1599autoloaded sub. 1600 1601=item * 1602 1603Some function descriptions in L<perlguts> were confusing, as it was 1604not clear whether they referred to the function above or below the 1605description. This has been clarified [perl #91790]. 1606 1607=back 1608 1609=head3 L<perlobj> 1610 1611=over 4 1612 1613=item * 1614 1615This document has been rewritten from scratch, and its coverage of various OO 1616concepts has been expanded. 1617 1618=back 1619 1620=head3 L<perlop> 1621 1622=over 4 1623 1624=item * 1625 1626Documentation of the smartmatch operator has been reworked and moved from 1627perlsyn to perlop where it belongs. 1628 1629It has also been corrected for the case of C<undef> on the left-hand 1630side. The list of different smart match behaviors had an item in the 1631wrong place. 1632 1633=item * 1634 1635Documentation of the ellipsis statement (C<...>) has been reworked and 1636moved from perlop to perlsyn. 1637 1638=item * 1639 1640The explanation of bitwise operators has been expanded to explain how they 1641work on Unicode strings (5.14.1). 1642 1643=item * 1644 1645More examples for C<m//g> have been added (5.14.1). 1646 1647=item * 1648 1649The C<<< <<\FOO >>> here-doc syntax has been documented (5.14.1). 1650 1651=back 1652 1653=head3 L<perlpragma> 1654 1655=over 4 1656 1657=item * 1658 1659There is now a standard convention for naming keys in the C<%^H>, 1660documented under L<Key naming|perlpragma/Key naming>. 1661 1662=back 1663 1664=head3 L<perlsec/Laundering and Detecting Tainted Data> 1665 1666=over 4 1667 1668=item * 1669 1670The example function for checking for taintedness contained a subtle 1671error. C<$@> needs to be localized to prevent its changing this 1672global's value outside the function. The preferred method to check for 1673this remains L<Scalar::Util/tainted>. 1674 1675=back 1676 1677=head3 L<perllol> 1678 1679=over 1680 1681=item * 1682 1683L<perllol> has been expanded with examples using the new C<push $scalar> 1684syntax introduced in Perl 5.14.0 (5.14.1). 1685 1686=back 1687 1688=head3 L<perlmod> 1689 1690=over 1691 1692=item * 1693 1694L<perlmod> now states explicitly that some types of explicit symbol table 1695manipulation are not supported. This codifies what was effectively already 1696the case [perl #78074]. 1697 1698=back 1699 1700=head3 L<perlpodstyle> 1701 1702=over 4 1703 1704=item * 1705 1706The tips on which formatting codes to use have been corrected and greatly 1707expanded. 1708 1709=item * 1710 1711There are now a couple of example one-liners for previewing POD files after 1712they have been edited. 1713 1714=back 1715 1716=head3 L<perlre> 1717 1718=over 1719 1720=item * 1721 1722The C<(*COMMIT)> directive is now listed in the right section 1723(L<Verbs without an argument|perlre/Verbs without an argument>). 1724 1725=back 1726 1727=head3 L<perlrun> 1728 1729=over 1730 1731=item * 1732 1733L<perlrun> has undergone a significant clean-up. Most notably, the 1734B<-0x...> form of the B<-0> flag has been clarified, and the final section 1735on environment variables has been corrected and expanded (5.14.1). 1736 1737=back 1738 1739=head3 L<perlsub> 1740 1741=over 1742 1743=item * 1744 1745The ($;) prototype syntax, which has existed for rather a long time, is now 1746documented in L<perlsub>. It lets a unary function have the same 1747precedence as a list operator. 1748 1749=back 1750 1751=head3 L<perltie> 1752 1753=over 1754 1755=item * 1756 1757The required syntax for tying handles has been documented. 1758 1759=back 1760 1761=head3 L<perlvar> 1762 1763=over 1764 1765=item * 1766 1767The documentation for L<$!|perlvar/$!> has been corrected and clarified. 1768It used to state that $! could be C<undef>, which is not the case. It was 1769also unclear whether system calls set C's C<errno> or Perl's C<$!> 1770[perl #91614]. 1771 1772=item * 1773 1774Documentation for L<$$|perlvar/$$> has been amended with additional 1775cautions regarding changing the process ID. 1776 1777=back 1778 1779=head3 Other Changes 1780 1781=over 4 1782 1783=item * 1784 1785L<perlxs> was extended with documentation on inline typemaps. 1786 1787=item * 1788 1789L<perlref> has a new L<Circular References|perlref/Circular References> 1790section explaining how circularities may not be freed and how to solve that 1791with weak references. 1792 1793=item * 1794 1795Parts of L<perlapi> were clarified, and Perl equivalents of some C 1796functions have been added as an additional mode of exposition. 1797 1798=item * 1799 1800A few parts of L<perlre> and L<perlrecharclass> were clarified. 1801 1802=back 1803 1804=head2 Removed Documentation 1805 1806=head3 Old OO Documentation 1807 1808The old OO tutorials, perltoot, perltooc, and perlboot, have been 1809removed. The perlbot (bag of object tricks) document has been removed 1810as well. 1811 1812=head3 Development Deltas 1813 1814The perldelta files for development releases are no longer packaged with 1815perl. These can still be found in the perl source code repository. 1816 1817=head1 Diagnostics 1818 1819The following additions or changes have been made to diagnostic output, 1820including warnings and fatal error messages. For the complete list of 1821diagnostic messages, see L<perldiag>. 1822 1823=head2 New Diagnostics 1824 1825=head3 New Errors 1826 1827=over 4 1828 1829=item * 1830 1831L<Cannot set tied @DB::args|perldiag/"Cannot set tied @DB::args"> 1832 1833This error occurs when C<caller> tries to set C<@DB::args> but finds it 1834tied. Before this error was added, it used to crash instead. 1835 1836=item * 1837 1838L<Cannot tie unreifiable array|perldiag/"Cannot tie unreifiable array"> 1839 1840This error is part of a safety check that the C<tie> operator does before 1841tying a special array like C<@_>. You should never see this message. 1842 1843=item * 1844 1845L<&CORE::%s cannot be called directly|perldiag/"&CORE::%s cannot be called directly"> 1846 1847This occurs when a subroutine in the C<CORE::> namespace is called 1848with C<&foo> syntax or through a reference. Some subroutines 1849in this package cannot yet be called that way, but must be 1850called as barewords. See L</Subroutines in the C<CORE> namespace>, above. 1851 1852=item * 1853 1854L<Source filters apply only to byte streams|perldiag/"Source filters apply only to byte streams"> 1855 1856This new error occurs when you try to activate a source filter (usually by 1857loading a source filter module) within a string passed to C<eval> under the 1858C<unicode_eval> feature. 1859 1860=back 1861 1862=head3 New Warnings 1863 1864=over 4 1865 1866=item * 1867 1868L<defined(@array) is deprecated|perldiag/"defined(@array) is deprecated"> 1869 1870The long-deprecated C<defined(@array)> now also warns for package variables. 1871Previously it issued a warning for lexical variables only. 1872 1873=item * 1874 1875L<length() used on %s|perldiag/length() used on %s> 1876 1877This new warning occurs when C<length> is used on an array or hash, instead 1878of C<scalar(@array)> or C<scalar(keys %hash)>. 1879 1880=item * 1881 1882L<lvalue attribute %s already-defined subroutine|perldiag/"lvalue attribute %s already-defined subroutine"> 1883 1884L<attributes.pm|attributes> now emits this warning when the :lvalue 1885attribute is applied to a Perl subroutine that has already been defined, as 1886doing so can have unexpected side-effects. 1887 1888=item * 1889 1890L<overload arg '%s' is invalid|perldiag/"overload arg '%s' is invalid"> 1891 1892This warning, in the "overload" category, is produced when the overload 1893pragma is given an argument it doesn't recognize, presumably a mistyped 1894operator. 1895 1896=item * 1897 1898L<$[ used in %s (did you mean $] ?)|perldiag/"$[ used in %s (did you mean $] ?)"> 1899 1900This new warning exists to catch the mistaken use of C<$[> in version 1901checks. C<$]>, not C<$[>, contains the version number. 1902 1903=item * 1904 1905L<Useless assignment to a temporary|perldiag/"Useless assignment to a temporary"> 1906 1907Assigning to a temporary scalar returned 1908from an lvalue subroutine now produces this 1909warning [perl #31946]. 1910 1911=item * 1912 1913L<Useless use of \E|perldiag/"Useless use of \E"> 1914 1915C<\E> does nothing unless preceded by C<\Q>, C<\L> or C<\U>. 1916 1917=back 1918 1919=head2 Removed Errors 1920 1921=over 1922 1923=item * 1924 1925"sort is now a reserved word" 1926 1927This error used to occur when C<sort> was called without arguments, 1928followed by C<;> or C<)>. (E.g., C<sort;> would die, but C<{sort}> was 1929OK.) This error message was added in Perl 3 to catch code like 1930C<close(sort)> which would no longer work. More than two decades later, 1931this message is no longer appropriate. Now C<sort> without arguments is 1932always allowed, and returns an empty list, as it did in those cases 1933where it was already allowed [perl #90030]. 1934 1935=back 1936 1937=head2 Changes to Existing Diagnostics 1938 1939=over 4 1940 1941=item * 1942 1943The "Applying pattern match..." or similar warning produced when an 1944array or hash is on the left-hand side of the C<=~> operator now 1945mentions the name of the variable. 1946 1947=item * 1948 1949The "Attempt to free non-existent shared string" has had the spelling 1950of "non-existent" corrected to "nonexistent". It was already listed 1951with the correct spelling in L<perldiag>. 1952 1953=item * 1954 1955The error messages for using C<default> and C<when> outside a 1956topicalizer have been standardized to match the messages for C<continue> 1957and loop controls. They now read 'Can't "default" outside a 1958topicalizer' and 'Can't "when" outside a topicalizer'. They both used 1959to be 'Can't use when() outside a topicalizer' [perl #91514]. 1960 1961=item * 1962 1963The message, "Code point 0x%X is not Unicode, no properties match it; 1964all inverse properties do" has been changed to "Code point 0x%X is not 1965Unicode, all \p{} matches fail; all \P{} matches succeed". 1966 1967=item * 1968 1969Redefinition warnings for constant subroutines used to be mandatory, 1970even occurring under C<no warnings>. Now they respect the L<warnings> 1971pragma. 1972 1973=item * 1974 1975The "glob failed" warning message is now suppressible via C<no warnings> 1976[perl #111656]. 1977 1978=item * 1979 1980The L<Invalid version format|perldiag/"Invalid version format (%s)"> 1981error message now says "negative version number" within the parentheses, 1982rather than "non-numeric data", for negative numbers. 1983 1984=item * 1985 1986The two warnings 1987L<Possible attempt to put comments in qw() list|perldiag/"Possible attempt to put comments in qw() list"> 1988and 1989L<Possible attempt to separate words with commas|perldiag/"Possible attempt to separate words with commas"> 1990are no longer mutually exclusive: the same C<qw> construct may produce 1991both. 1992 1993=item * 1994 1995The uninitialized warning for C<y///r> when C<$_> is implicit and 1996undefined now mentions the variable name, just like the non-/r variation 1997of the operator. 1998 1999=item * 2000 2001The 'Use of "foo" without parentheses is ambiguous' warning has been 2002extended to apply also to user-defined subroutines with a (;$) 2003prototype, and not just to built-in functions. 2004 2005=item * 2006 2007Warnings that mention the names of lexical (C<my>) variables with 2008Unicode characters in them now respect the presence or absence of the 2009C<:utf8> layer on the output handle, instead of outputting UTF8 2010regardless. Also, the correct names are included in the strings passed 2011to C<$SIG{__WARN__}> handlers, rather than the raw UTF8 bytes. 2012 2013=back 2014 2015=head1 Utility Changes 2016 2017=head3 L<h2ph> 2018 2019=over 4 2020 2021=item * 2022 2023L<h2ph> used to generate code of the form 2024 2025 unless(defined(&FOO)) { 2026 sub FOO () {42;} 2027 } 2028 2029But the subroutine is a compile-time declaration, and is hence unaffected 2030by the condition. It has now been corrected to emit a string C<eval> 2031around the subroutine [perl #99368]. 2032 2033=back 2034 2035=head3 L<splain> 2036 2037=over 4 2038 2039=item * 2040 2041F<splain> no longer emits backtraces with the first line number repeated. 2042 2043This: 2044 2045 Uncaught exception from user code: 2046 Cannot fwiddle the fwuddle at -e line 1. 2047 at -e line 1 2048 main::baz() called at -e line 1 2049 main::bar() called at -e line 1 2050 main::foo() called at -e line 1 2051 2052has become this: 2053 2054 Uncaught exception from user code: 2055 Cannot fwiddle the fwuddle at -e line 1. 2056 main::baz() called at -e line 1 2057 main::bar() called at -e line 1 2058 main::foo() called at -e line 1 2059 2060=item * 2061 2062Some error messages consist of multiple lines that are listed as separate 2063entries in L<perldiag>. splain has been taught to find the separate 2064entries in these cases, instead of simply failing to find the message. 2065 2066=back 2067 2068=head3 L<zipdetails> 2069 2070=over 4 2071 2072=item * 2073 2074This is a new utility, included as part of an 2075L<IO::Compress::Base> upgrade. 2076 2077L<zipdetails> displays information about the internal record structure 2078of the zip file. It is not concerned with displaying any details of 2079the compressed data stored in the zip file. 2080 2081=back 2082 2083=head1 Configuration and Compilation 2084 2085=over 4 2086 2087=item * 2088 2089F<regexp.h> has been modified for compatibility with GCC's B<-Werror> 2090option, as used by some projects that include perl's header files (5.14.1). 2091 2092=item * 2093 2094C<USE_LOCALE{,_COLLATE,_CTYPE,_NUMERIC}> have been added the output of perl -V 2095as they have affect the behavior of the interpreter binary (albeit 2096in only a small area). 2097 2098=item * 2099 2100The code and tests for L<IPC::Open2> have been moved from F<ext/IPC-Open2> 2101into F<ext/IPC-Open3>, as C<IPC::Open2::open2()> is implemented as a thin 2102wrapper around C<IPC::Open3::_open3()>, and hence is very tightly coupled to 2103it. 2104 2105=item * 2106 2107The magic types and magic vtables are now generated from data in a new script 2108F<regen/mg_vtable.pl>, instead of being maintained by hand. As different 2109EBCDIC variants can't agree on the code point for '~', the character to code 2110point conversion is done at build time by F<generate_uudmap> to a new generated 2111header F<mg_data.h>. C<PL_vtbl_bm> and C<PL_vtbl_fm> are now defined by the 2112pre-processor as C<PL_vtbl_regexp>, instead of being distinct C variables. 2113C<PL_vtbl_sig> has been removed. 2114 2115=item * 2116 2117Building with C<-DPERL_GLOBAL_STRUCT> works again. This configuration is not 2118generally used. 2119 2120=item * 2121 2122Perl configured with I<MAD> now correctly frees C<MADPROP> structures when 2123OPs are freed. C<MADPROP>s are now allocated with C<PerlMemShared_malloc()> 2124 2125=item * 2126 2127F<makedef.pl> has been refactored. This should have no noticeable affect on 2128any of the platforms that use it as part of their build (AIX, VMS, Win32). 2129 2130=item * 2131 2132C<useperlio> can no longer be disabled. 2133 2134=item * 2135 2136The file F<global.sym> is no longer needed, and has been removed. It 2137contained a list of all exported functions, one of the files generated by 2138F<regen/embed.pl> from data in F<embed.fnc> and F<regen/opcodes>. The code 2139has been refactored so that the only user of F<global.sym>, F<makedef.pl>, 2140now reads F<embed.fnc> and F<regen/opcodes> directly, removing the need to 2141store the list of exported functions in an intermediate file. 2142 2143As F<global.sym> was never installed, this change should not be visible 2144outside the build process. 2145 2146=item * 2147 2148F<pod/buildtoc>, used by the build process to build L<perltoc>, has been 2149refactored and simplified. It now contains only code to build L<perltoc>; 2150the code to regenerate Makefiles has been moved to F<Porting/pod_rules.pl>. 2151It's a bug if this change has any material effect on the build process. 2152 2153=item * 2154 2155F<pod/roffitall> is now built by F<pod/buildtoc>, instead of being 2156shipped with the distribution. Its list of manpages is now generated 2157(and therefore current). See also RT #103202 for an unresolved related 2158issue. 2159 2160=item * 2161 2162The man page for C<XS::Typemap> is no longer installed. C<XS::Typemap> 2163is a test module which is not installed, hence installing its 2164documentation makes no sense. 2165 2166=item * 2167 2168The -Dusesitecustomize and -Duserelocatableinc options now work 2169together properly. 2170 2171=back 2172 2173=head1 Platform Support 2174 2175=head2 Platform-Specific Notes 2176 2177=head3 Cygwin 2178 2179=over 4 2180 2181=item * 2182 2183Since version 1.7, Cygwin supports native UTF-8 paths. If Perl is built 2184under that environment, directory and filenames will be UTF-8 encoded. 2185 2186=item * 2187 2188Cygwin does not initialize all original Win32 environment variables. See 2189F<README.cygwin> for a discussion of the newly-added 2190C<Cygwin::sync_winenv()> function [perl #110190] and for 2191further links. 2192 2193=back 2194 2195=head3 HP-UX 2196 2197=over 4 2198 2199=item * 2200 2201HP-UX PA-RISC/64 now supports gcc-4.x 2202 2203A fix to correct the socketsize now makes the test suite pass on HP-UX 2204PA-RISC for 64bitall builds. (5.14.2) 2205 2206=back 2207 2208=head3 VMS 2209 2210=over 4 2211 2212=item * 2213 2214Remove unnecessary includes, fix miscellaneous compiler warnings and 2215close some unclosed comments on F<vms/vms.c>. 2216 2217=item * 2218 2219Remove sockadapt layer from the VMS build. 2220 2221=item * 2222 2223Explicit support for VMS versions before v7.0 and DEC C versions 2224before v6.0 has been removed. 2225 2226=item * 2227 2228Since Perl 5.10.1, the home-grown C<stat> wrapper has been unable to 2229distinguish between a directory name containing an underscore and an 2230otherwise-identical filename containing a dot in the same position 2231(e.g., t/test_pl as a directory and t/test.pl as a file). This problem 2232has been corrected. 2233 2234=item * 2235 2236The build on VMS now permits names of the resulting symbols in C code for 2237Perl longer than 31 characters. Symbols like 2238C<Perl__it_was_the_best_of_times_it_was_the_worst_of_times> can now be 2239created freely without causing the VMS linker to seize up. 2240 2241=back 2242 2243=head3 GNU/Hurd 2244 2245=over 4 2246 2247=item * 2248 2249Numerous build and test failures on GNU/Hurd have been resolved with hints 2250for building DBM modules, detection of the library search path, and enabling 2251of large file support. 2252 2253=back 2254 2255=head3 OpenVOS 2256 2257=over 4 2258 2259=item * 2260 2261Perl is now built with dynamic linking on OpenVOS, the minimum supported 2262version of which is now Release 17.1.0. 2263 2264=back 2265 2266=head3 SunOS 2267 2268The CC workshop C++ compiler is now detected and used on systems that ship 2269without cc. 2270 2271=head1 Internal Changes 2272 2273=over 4 2274 2275=item * 2276 2277The compiled representation of formats is now stored via the C<mg_ptr> of 2278their C<PERL_MAGIC_fm>. Previously it was stored in the string buffer, 2279beyond C<SvLEN()>, the regular end of the string. C<SvCOMPILED()> and 2280C<SvCOMPILED_{on,off}()> now exist solely for compatibility for XS code. 2281The first is always 0, the other two now no-ops. (5.14.1) 2282 2283=item * 2284 2285Some global variables have been marked C<const>, members in the interpreter 2286structure have been re-ordered, and the opcodes have been re-ordered. The 2287op C<OP_AELEMFAST> has been split into C<OP_AELEMFAST> and C<OP_AELEMFAST_LEX>. 2288 2289=item * 2290 2291When empting a hash of its elements (e.g., via undef(%h), or %h=()), HvARRAY 2292field is no longer temporarily zeroed. Any destructors called on the freed 2293elements see the remaining elements. Thus, %h=() becomes more like 2294C<delete $h{$_} for keys %h>. 2295 2296=item * 2297 2298Boyer-Moore compiled scalars are now PVMGs, and the Boyer-Moore tables are now 2299stored via the mg_ptr of their C<PERL_MAGIC_bm>. 2300Previously they were PVGVs, with the tables stored in 2301the string buffer, beyond C<SvLEN()>. This eliminates 2302the last place where the core stores data beyond C<SvLEN()>. 2303 2304=item * 2305 2306Simplified logic in C<Perl_sv_magic()> introduces a small change of 2307behavior for error cases involving unknown magic types. Previously, if 2308C<Perl_sv_magic()> was passed a magic type unknown to it, it would 2309 2310=over 2311 2312=item 1. 2313 2314Croak "Modification of a read-only value attempted" if read only 2315 2316=item 2. 2317 2318Return without error if the SV happened to already have this magic 2319 2320=item 3. 2321 2322otherwise croak "Don't know how to handle magic of type \\%o" 2323 2324=back 2325 2326Now it will always croak "Don't know how to handle magic of type \\%o", even 2327on read-only values, or SVs which already have the unknown magic type. 2328 2329=item * 2330 2331The experimental C<fetch_cop_label> function has been renamed to 2332C<cop_fetch_label>. 2333 2334=item * 2335 2336The C<cop_store_label> function has been added to the API, but is 2337experimental. 2338 2339=item * 2340 2341F<embedvar.h> has been simplified, and one level of macro indirection for 2342PL_* variables has been removed for the default (non-multiplicity) 2343configuration. PERLVAR*() macros now directly expand their arguments to 2344tokens such as C<PL_defgv>, instead of expanding to C<PL_Idefgv>, with 2345F<embedvar.h> defining a macro to map C<PL_Idefgv> to C<PL_defgv>. XS code 2346which has unwarranted chumminess with the implementation may need updating. 2347 2348=item * 2349 2350An API has been added to explicitly choose whether to export XSUB 2351symbols. More detail can be found in the comments for commit e64345f8. 2352 2353=item * 2354 2355The C<is_gv_magical_sv> function has been eliminated and merged with 2356C<gv_fetchpvn_flags>. It used to be called to determine whether a GV 2357should be autovivified in rvalue context. Now it has been replaced with a 2358new C<GV_ADDMG> flag (not part of the API). 2359 2360=item * 2361 2362The returned code point from the function C<utf8n_to_uvuni()> 2363when the input is malformed UTF-8, malformations are allowed, and 2364C<utf8> warnings are off is now the Unicode REPLACEMENT CHARACTER 2365whenever the malformation is such that no well-defined code point can be 2366computed. Previously the returned value was essentially garbage. The 2367only malformations that have well-defined values are a zero-length 2368string (0 is the return), and overlong UTF-8 sequences. 2369 2370=item * 2371 2372Padlists are now marked C<AvREAL>; i.e., reference-counted. They have 2373always been reference-counted, but were not marked real, because F<pad.c> 2374did its own clean-up, instead of using the usual clean-up code in F<sv.c>. 2375That caused problems in thread cloning, so now the C<AvREAL> flag is on, 2376but is turned off in F<pad.c> right before the padlist is freed (after 2377F<pad.c> has done its custom freeing of the pads). 2378 2379=item * 2380 2381All C files that make up the Perl core have been converted to UTF-8. 2382 2383=item * 2384 2385These new functions have been added as part of the work on Unicode symbols: 2386 2387 HvNAMELEN 2388 HvNAMEUTF8 2389 HvENAMELEN 2390 HvENAMEUTF8 2391 gv_init_pv 2392 gv_init_pvn 2393 gv_init_pvsv 2394 gv_fetchmeth_pv 2395 gv_fetchmeth_pvn 2396 gv_fetchmeth_sv 2397 gv_fetchmeth_pv_autoload 2398 gv_fetchmeth_pvn_autoload 2399 gv_fetchmeth_sv_autoload 2400 gv_fetchmethod_pv_flags 2401 gv_fetchmethod_pvn_flags 2402 gv_fetchmethod_sv_flags 2403 gv_autoload_pv 2404 gv_autoload_pvn 2405 gv_autoload_sv 2406 newGVgen_flags 2407 sv_derived_from_pv 2408 sv_derived_from_pvn 2409 sv_derived_from_sv 2410 sv_does_pv 2411 sv_does_pvn 2412 sv_does_sv 2413 whichsig_pv 2414 whichsig_pvn 2415 whichsig_sv 2416 newCONSTSUB_flags 2417 2418The gv_fetchmethod_*_flags functions, like gv_fetchmethod_flags, are 2419experimental and may change in a future release. 2420 2421=item * 2422 2423The following functions were added. These are I<not> part of the API: 2424 2425 GvNAMEUTF8 2426 GvENAMELEN 2427 GvENAME_HEK 2428 CopSTASH_flags 2429 CopSTASH_flags_set 2430 PmopSTASH_flags 2431 PmopSTASH_flags_set 2432 sv_sethek 2433 HEKfARG 2434 2435There is also a C<HEKf> macro corresponding to C<SVf>, for 2436interpolating HEKs in formatted strings. 2437 2438=item * 2439 2440C<sv_catpvn_flags> takes a couple of new internal-only flags, 2441C<SV_CATBYTES> and C<SV_CATUTF8>, which tell it whether the char array to 2442be concatenated is UTF8. This allows for more efficient concatenation than 2443creating temporary SVs to pass to C<sv_catsv>. 2444 2445=item * 2446 2447For XS AUTOLOAD subs, $AUTOLOAD is set once more, as it was in 5.6.0. This 2448is in addition to setting C<SvPVX(cv)>, for compatibility with 5.8 to 5.14. 2449See L<perlguts/Autoloading with XSUBs>. 2450 2451=item * 2452 2453Perl now checks whether the array (the linearized isa) returned by a MRO 2454plugin begins with the name of the class itself, for which the array was 2455created, instead of assuming that it does. This prevents the first element 2456from being skipped during method lookup. It also means that 2457C<mro::get_linear_isa> may return an array with one more element than the 2458MRO plugin provided [perl #94306]. 2459 2460=item * 2461 2462C<PL_curstash> is now reference-counted. 2463 2464=item * 2465 2466There are now feature bundle hints in C<PL_hints> (C<$^H>) that version 2467declarations use, to avoid having to load F<feature.pm>. One setting of 2468the hint bits indicates a "custom" feature bundle, which means that the 2469entries in C<%^H> still apply. F<feature.pm> uses that. 2470 2471The C<HINT_FEATURE_MASK> macro is defined in F<perl.h> along with other 2472hints. Other macros for setting and testing features and bundles are in 2473the new F<feature.h>. C<FEATURE_IS_ENABLED> (which has moved to 2474F<feature.h>) is no longer used throughout the codebase, but more specific 2475macros, e.g., C<FEATURE_SAY_IS_ENABLED>, that are defined in F<feature.h>. 2476 2477=item * 2478 2479F<lib/feature.pm> is now a generated file, created by the new 2480F<regen/feature.pl> script, which also generates F<feature.h>. 2481 2482=item * 2483 2484Tied arrays are now always C<AvREAL>. If C<@_> or C<DB::args> is tied, it 2485is reified first, to make sure this is always the case. 2486 2487=item * 2488 2489Two new functions C<utf8_to_uvchr_buf()> and C<utf8_to_uvuni_buf()> have 2490been added. These are the same as C<utf8_to_uvchr> and 2491C<utf8_to_uvuni> (which are now deprecated), but take an extra parameter 2492that is used to guard against reading beyond the end of the input 2493string. 2494See L<perlapi/utf8_to_uvchr_buf> and L<perlapi/utf8_to_uvuni_buf>. 2495 2496=item * 2497 2498The regular expression engine now does TRIE case insensitive matches 2499under Unicode. This may change the output of C<< use re 'debug'; >>, 2500and will speed up various things. 2501 2502=item * 2503 2504There is a new C<wrap_op_checker()> function, which provides a thread-safe 2505alternative to writing to C<PL_check> directly. 2506 2507=back 2508 2509=head1 Selected Bug Fixes 2510 2511=head2 Array and hash 2512 2513=over 2514 2515=item * 2516 2517A bug has been fixed that would cause a "Use of freed value in iteration" 2518error if the next two hash elements that would be iterated over are 2519deleted [perl #85026]. (5.14.1) 2520 2521=item * 2522 2523Deleting the current hash iterator (the hash element that would be returned 2524by the next call to C<each>) in void context used not to free it 2525[perl #85026]. 2526 2527=item * 2528 2529Deletion of methods via C<delete $Class::{method}> syntax used to update 2530method caches if called in void context, but not scalar or list context. 2531 2532=item * 2533 2534When hash elements are deleted in void context, the internal hash entry is 2535now freed before the value is freed, to prevent destructors called by that 2536latter freeing from seeing the hash in an inconsistent state. It was 2537possible to cause double-frees if the destructor freed the hash itself 2538[perl #100340]. 2539 2540=item * 2541 2542A C<keys> optimization in Perl 5.12.0 to make it faster on empty hashes 2543caused C<each> not to reset the iterator if called after the last element 2544was deleted. 2545 2546=item * 2547 2548Freeing deeply nested hashes no longer crashes [perl #44225]. 2549 2550=item * 2551 2552It is possible from XS code to create hashes with elements that have no 2553values. The hash element and slice operators used to crash 2554when handling these in lvalue context. They now 2555produce a "Modification of non-creatable hash value attempted" error 2556message. 2557 2558=item * 2559 2560If list assignment to a hash or array triggered destructors that freed the 2561hash or array itself, a crash would ensue. This is no longer the case 2562[perl #107440]. 2563 2564=item * 2565 2566It used to be possible to free the typeglob of a localized array or hash 2567(e.g., C<local @{"x"}; delete $::{x}>), resulting in a crash on scope exit. 2568 2569=item * 2570 2571Some core bugs affecting L<Hash::Util> have been fixed: locking a hash 2572element that is a glob copy no longer causes the next assignment to it to 2573corrupt the glob (5.14.2), and unlocking a hash element that holds a 2574copy-on-write scalar no longer causes modifications to that scalar to 2575modify other scalars that were sharing the same string buffer. 2576 2577=back 2578 2579=head2 C API fixes 2580 2581=over 2582 2583=item * 2584 2585The C<newHVhv> XS function now works on tied hashes, instead of crashing or 2586returning an empty hash. 2587 2588=item * 2589 2590The C<SvIsCOW> C macro now returns false for read-only copies of typeglobs, 2591such as those created by: 2592 2593 $hash{elem} = *foo; 2594 Hash::Util::lock_value %hash, 'elem'; 2595 2596It used to return true. 2597 2598=item * 2599 2600The C<SvPVutf8> C function no longer tries to modify its argument, 2601resulting in errors [perl #108994]. 2602 2603=item * 2604 2605C<SvPVutf8> now works properly with magical variables. 2606 2607=item * 2608 2609C<SvPVbyte> now works properly non-PVs. 2610 2611=item * 2612 2613When presented with malformed UTF-8 input, the XS-callable functions 2614C<is_utf8_string()>, C<is_utf8_string_loc()>, and 2615C<is_utf8_string_loclen()> could read beyond the end of the input 2616string by up to 12 bytes. This no longer happens. [perl #32080]. 2617However, currently, C<is_utf8_char()> still has this defect, see 2618L</is_utf8_char()> above. 2619 2620=item * 2621 2622The C-level C<pregcomp> function could become confused about whether the 2623pattern was in UTF8 if the pattern was an overloaded, tied, or otherwise 2624magical scalar [perl #101940]. 2625 2626=back 2627 2628=head2 Compile-time hints 2629 2630=over 2631 2632=item * 2633 2634Tying C<%^H> no longer causes perl to crash or ignore the contents of 2635C<%^H> when entering a compilation scope [perl #106282]. 2636 2637=item * 2638 2639C<eval $string> and C<require> used not to 2640localize C<%^H> during compilation if it 2641was empty at the time the C<eval> call itself was compiled. This could 2642lead to scary side effects, like C<use re "/m"> enabling other flags that 2643the surrounding code was trying to enable for its caller [perl #68750]. 2644 2645=item * 2646 2647C<eval $string> and C<require> no longer localize hints (C<$^H> and C<%^H>) 2648at run time, but only during compilation of the $string or required file. 2649This makes C<BEGIN { $^H{foo}=7 }> equivalent to 2650C<BEGIN { eval '$^H{foo}=7' }> [perl #70151]. 2651 2652=item * 2653 2654Creating a BEGIN block from XS code (via C<newXS> or C<newATTRSUB>) would, 2655on completion, make the hints of the current compiling code the current 2656hints. This could cause warnings to occur in a non-warning scope. 2657 2658=back 2659 2660=head2 Copy-on-write scalars 2661 2662Copy-on-write or shared hash key scalars 2663were introduced in 5.8.0, but most Perl code 2664did not encounter them (they were used mostly internally). Perl 26655.10.0 extended them, such that assigning C<__PACKAGE__> or a 2666hash key to a scalar would make it copy-on-write. Several parts 2667of Perl were not updated to account for them, but have now been fixed. 2668 2669=over 2670 2671=item * 2672 2673C<utf8::decode> had a nasty bug that would modify copy-on-write scalars' 2674string buffers in place (i.e., skipping the copy). This could result in 2675hashes having two elements with the same key [perl #91834]. (5.14.2) 2676 2677=item * 2678 2679Lvalue subroutines were not allowing COW scalars to be returned. This was 2680fixed for lvalue scalar context in Perl 5.12.3 and 5.14.0, but list context 2681was not fixed until this release. 2682 2683=item * 2684 2685Elements of restricted hashes (see the L<fields> pragma) containing 2686copy-on-write values couldn't be deleted, nor could such hashes be cleared 2687(C<%hash = ()>). (5.14.2) 2688 2689=item * 2690 2691Localizing a tied variable used to make it read-only if it contained a 2692copy-on-write string. (5.14.2) 2693 2694=item * 2695 2696Assigning a copy-on-write string to a stash 2697element no longer causes a double free. Regardless of this change, the 2698results of such assignments are still undefined. 2699 2700=item * 2701 2702Assigning a copy-on-write string to a tied variable no longer stops that 2703variable from being tied if it happens to be a PVMG or PVLV internally. 2704 2705=item * 2706 2707Doing a substitution on a tied variable returning a copy-on-write 2708scalar used to cause an assertion failure or an "Attempt to free 2709nonexistent shared string" warning. 2710 2711=item * 2712 2713This one is a regression from 5.12: In 5.14.0, the bitwise assignment 2714operators C<|=>, C<^=> and C<&=> started leaving the left-hand side 2715undefined if it happened to be a copy-on-write string [perl #108480]. 2716 2717=item * 2718 2719L<Storable>, L<Devel::Peek> and L<PerlIO::scalar> had similar problems. 2720See L</Updated Modules and Pragmata>, above. 2721 2722=back 2723 2724=head2 The debugger 2725 2726=over 2727 2728=item * 2729 2730F<dumpvar.pl>, and therefore the C<x> command in the debugger, have been 2731fixed to handle objects blessed into classes whose names contain "=". The 2732contents of such objects used not to be dumped [perl #101814]. 2733 2734=item * 2735 2736The "R" command for restarting a debugger session has been fixed to work on 2737Windows, or any other system lacking a C<POSIX::_SC_OPEN_MAX> constant 2738[perl #87740]. 2739 2740=item * 2741 2742The C<#line 42 foo> directive used not to update the arrays of lines used 2743by the debugger if it occurred in a string eval. This was partially fixed 2744in 5.14, but it worked only for a single C<#line 42 foo> in each eval. Now 2745it works for multiple. 2746 2747=item * 2748 2749When subroutine calls are intercepted by the debugger, the name of the 2750subroutine or a reference to it is stored in C<$DB::sub>, for the debugger 2751to access. Sometimes (such as C<$foo = *bar; undef *bar; &$foo>) 2752C<$DB::sub> would be set to a name that could not be used to find the 2753subroutine, and so the debugger's attempt to call it would fail. Now the 2754check to see whether a reference is needed is more robust, so those 2755problems should not happen anymore [rt.cpan.org #69862]. 2756 2757=item * 2758 2759Every subroutine has a filename associated with it that the debugger uses. 2760The one associated with constant subroutines used to be misallocated when 2761cloned under threads. Consequently, debugging threaded applications could 2762result in memory corruption [perl #96126]. 2763 2764=back 2765 2766=head2 Dereferencing operators 2767 2768=over 2769 2770=item * 2771 2772C<defined(${"..."})>, C<defined(*{"..."})>, etc., used to 2773return true for most, but not all built-in variables, if 2774they had not been used yet. This bug affected C<${^GLOBAL_PHASE}> and 2775C<${^UTF8CACHE}>, among others. It also used to return false if the 2776package name was given as well (C<${"::!"}>) [perl #97978, #97492]. 2777 2778=item * 2779 2780Perl 5.10.0 introduced a similar bug: C<defined(*{"foo"})> where "foo" 2781represents the name of a built-in global variable used to return false if 2782the variable had never been used before, but only on the I<first> call. 2783This, too, has been fixed. 2784 2785=item * 2786 2787Since 5.6.0, C<*{ ... }> has been inconsistent in how it treats undefined 2788values. It would die in strict mode or lvalue context for most undefined 2789values, but would be treated as the empty string (with a warning) for the 2790specific scalar return by C<undef()> (C<&PL_sv_undef> internally). This 2791has been corrected. C<undef()> is now treated like other undefined 2792scalars, as in Perl 5.005. 2793 2794=back 2795 2796=head2 Filehandle, last-accessed 2797 2798Perl has an internal variable that stores the last filehandle to be 2799accessed. It is used by C<$.> and by C<tell> and C<eof> without 2800arguments. 2801 2802=over 2803 2804=item * 2805 2806It used to be possible to set this internal variable to a glob copy and 2807then modify that glob copy to be something other than a glob, and still 2808have the last-accessed filehandle associated with the variable after 2809assigning a glob to it again: 2810 2811 my $foo = *STDOUT; # $foo is a glob copy 2812 <$foo>; # $foo is now the last-accessed handle 2813 $foo = 3; # no longer a glob 2814 $foo = *STDERR; # still the last-accessed handle 2815 2816Now the C<$foo = 3> assignment unsets that internal variable, so there 2817is no last-accessed filehandle, just as if C<< <$foo> >> had never 2818happened. 2819 2820This also prevents some unrelated handle from becoming the last-accessed 2821handle if $foo falls out of scope and the same internal SV gets used for 2822another handle [perl #97988]. 2823 2824=item * 2825 2826A regression in 5.14 caused these statements not to set that internal 2827variable: 2828 2829 my $fh = *STDOUT; 2830 tell $fh; 2831 eof $fh; 2832 seek $fh, 0,0; 2833 tell *$fh; 2834 eof *$fh; 2835 seek *$fh, 0,0; 2836 readline *$fh; 2837 2838This is now fixed, but C<tell *{ *$fh }> still has the problem, and it 2839is not clear how to fix it [perl #106536]. 2840 2841=back 2842 2843=head2 Filetests and C<stat> 2844 2845The term "filetests" refers to the operators that consist of a hyphen 2846followed by a single letter: C<-r>, C<-x>, C<-M>, etc. The term "stacked" 2847when applied to filetests means followed by another filetest operator 2848sharing the same operand, as in C<-r -x -w $fooo>. 2849 2850=over 2851 2852=item * 2853 2854C<stat> produces more consistent warnings. It no longer warns for "_" 2855[perl #71002] and no longer skips the warning at times for other unopened 2856handles. It no longer warns about an unopened handle when the operating 2857system's C<fstat> function fails. 2858 2859=item * 2860 2861C<stat> would sometimes return negative numbers for large inode numbers, 2862because it was using the wrong internal C type. [perl #84590] 2863 2864=item * 2865 2866C<lstat> is documented to fall back to C<stat> (with a warning) when given 2867a filehandle. When passed an IO reference, it was actually doing the 2868equivalent of S<C<stat _>> and ignoring the handle. 2869 2870=item * 2871 2872C<-T _> with no preceding C<stat> used to produce a 2873confusing "uninitialized" warning, even though there 2874is no visible uninitialized value to speak of. 2875 2876=item * 2877 2878C<-T>, C<-B>, C<-l> and C<-t> now work 2879when stacked with other filetest operators 2880[perl #77388]. 2881 2882=item * 2883 2884In 5.14.0, filetest ops (C<-r>, C<-x>, etc.) started calling FETCH on a 2885tied argument belonging to the previous argument to a list operator, if 2886called with a bareword argument or no argument at all. This has been 2887fixed, so C<push @foo, $tied, -r> no longer calls FETCH on C<$tied>. 2888 2889=item * 2890 2891In Perl 5.6, C<-l> followed by anything other than a bareword would treat 2892its argument as a file name. That was changed in 5.8 for glob references 2893(C<\*foo>), but not for globs themselves (C<*foo>). C<-l> started 2894returning C<undef> for glob references without setting the last 2895stat buffer that the "_" handle uses, but only if warnings 2896were turned on. With warnings off, it was the same as 5.6. 2897In other words, it was simply buggy and inconsistent. Now the 5.6 2898behavior has been restored. 2899 2900=item * 2901 2902C<-l> followed by a bareword no longer "eats" the previous argument to 2903the list operator in whose argument list it resides. Hence, 2904C<print "bar", -l foo> now actually prints "bar", because C<-l> 2905on longer eats it. 2906 2907=item * 2908 2909Perl keeps several internal variables to keep track of the last stat 2910buffer, from which file(handle) it originated, what type it was, and 2911whether the last stat succeeded. 2912 2913There were various cases where these could get out of synch, resulting in 2914inconsistent or erratic behavior in edge cases (every mention of C<-T> 2915applies to C<-B> as well): 2916 2917=over 2918 2919=item * 2920 2921C<-T I<HANDLE>>, even though it does a C<stat>, was not resetting the last 2922stat type, so an C<lstat _> following it would merrily return the wrong 2923results. Also, it was not setting the success status. 2924 2925=item * 2926 2927Freeing the handle last used by C<stat> or a filetest could result in 2928S<C<-T _>> using an unrelated handle. 2929 2930=item * 2931 2932C<stat> with an IO reference would not reset the stat type or record the 2933filehandle for S<C<-T _>> to use. 2934 2935=item * 2936 2937Fatal warnings could cause the stat buffer not to be reset 2938for a filetest operator on an unopened filehandle or C<-l> on any handle. 2939Fatal warnings also stopped C<-T> from setting C<$!>. 2940 2941=item * 2942 2943When the last stat was on an unreadable file, C<-T _> is supposed to 2944return C<undef>, leaving the last stat buffer unchanged. But it was 2945setting the stat type, causing C<lstat _> to stop working. 2946 2947=item * 2948 2949C<-T I<FILENAME>> was not resetting the internal stat buffers for 2950unreadable files. 2951 2952=back 2953 2954These have all been fixed. 2955 2956=back 2957 2958=head2 Formats 2959 2960=over 2961 2962=item * 2963 2964Several edge cases have been fixed with formats and C<formline>; 2965in particular, where the format itself is potentially variable (such as 2966with ties and overloading), and where the format and data differ in their 2967encoding. In both these cases, it used to possible for the output to be 2968corrupted [perl #91032]. 2969 2970=item * 2971 2972C<formline> no longer converts its argument into a string in-place. So 2973passing a reference to C<formline> no longer destroys the reference 2974[perl #79532]. 2975 2976=item * 2977 2978Assignment to C<$^A> (the format output accumulator) now recalculates 2979the number of lines output. 2980 2981=back 2982 2983=head2 C<given> and C<when> 2984 2985=over 2986 2987=item * 2988 2989C<given> was not scoping its implicit $_ properly, resulting in memory 2990leaks or "Variable is not available" warnings [perl #94682]. 2991 2992=item * 2993 2994C<given> was not calling set-magic on the implicit lexical C<$_> that it 2995uses. This meant, for example, that C<pos> would be remembered from one 2996execution of the same C<given> block to the next, even if the input were a 2997different variable [perl #84526]. 2998 2999=item * 3000 3001C<when> blocks are now capable of returning variables declared inside the 3002enclosing C<given> block [perl #93548]. 3003 3004=back 3005 3006=head2 The C<glob> operator 3007 3008=over 3009 3010=item * 3011 3012On OSes other than VMS, Perl's C<glob> operator (and the C<< <...> >> form) 3013use L<File::Glob> underneath. L<File::Glob> splits the pattern into words, 3014before feeding each word to its C<bsd_glob> function. 3015 3016There were several inconsistencies in the way the split was done. Now 3017quotation marks (' and ") are always treated as shell-style word delimiters 3018(that allow whitespace as part of a word) and backslashes are always 3019preserved, unless they exist to escape quotation marks. Before, those 3020would only sometimes be the case, depending on whether the pattern 3021contained whitespace. Also, escaped whitespace at the end of the pattern 3022is no longer stripped [perl #40470]. 3023 3024=item * 3025 3026C<CORE::glob> now works as a way to call the default globbing function. It 3027used to respect overrides, despite the C<CORE::> prefix. 3028 3029=item * 3030 3031Under miniperl (used to configure modules when perl itself is built), 3032C<glob> now clears %ENV before calling csh, since the latter croaks on some 3033systems if it does not like the contents of the LS_COLORS environment 3034variable [perl #98662]. 3035 3036=back 3037 3038=head2 Lvalue subroutines 3039 3040=over 3041 3042=item * 3043 3044Explicit return now returns the actual argument passed to return, instead 3045of copying it [perl #72724, #72706]. 3046 3047=item * 3048 3049Lvalue subroutines used to enforce lvalue syntax (i.e., whatever can go on 3050the left-hand side of C<=>) for the last statement and the arguments to 3051return. Since lvalue subroutines are not always called in lvalue context, 3052this restriction has been lifted. 3053 3054=item * 3055 3056Lvalue subroutines are less restrictive about what values can be returned. 3057It used to croak on values returned by C<shift> and C<delete> and from 3058other subroutines, but no longer does so [perl #71172]. 3059 3060=item * 3061 3062Empty lvalue subroutines (C<sub :lvalue {}>) used to return C<@_> in list 3063context. All subroutines used to do this, but regular subs were fixed in 3064Perl 5.8.2. Now lvalue subroutines have been likewise fixed. 3065 3066=item * 3067 3068Autovivification now works on values returned from lvalue subroutines 3069[perl #7946], as does returning C<keys> in lvalue context. 3070 3071=item * 3072 3073Lvalue subroutines used to copy their return values in rvalue context. Not 3074only was this a waste of CPU cycles, but it also caused bugs. A C<($)> 3075prototype would cause an lvalue sub to copy its return value [perl #51408], 3076and C<while(lvalue_sub() =~ m/.../g) { ... }> would loop endlessly 3077[perl #78680]. 3078 3079=item * 3080 3081When called in potential lvalue context 3082(e.g., subroutine arguments or a list 3083passed to C<for>), lvalue subroutines used to copy 3084any read-only value that was returned. E.g., C< sub :lvalue { $] } > 3085would not return C<$]>, but a copy of it. 3086 3087=item * 3088 3089When called in potential lvalue context, an lvalue subroutine returning 3090arrays or hashes used to bind the arrays or hashes to scalar variables, 3091resulting in bugs. This was fixed in 5.14.0 if an array were the first 3092thing returned from the subroutine (but not for C<$scalar, @array> or 3093hashes being returned). Now a more general fix has been applied 3094[perl #23790]. 3095 3096=item * 3097 3098Method calls whose arguments were all surrounded with C<my()> or C<our()> 3099(as in C<< $object->method(my($a,$b)) >>) used to force lvalue context on 3100the subroutine. This would prevent lvalue methods from returning certain 3101values. 3102 3103=item * 3104 3105Lvalue sub calls that are not determined to be such at compile time 3106(C<&$name> or &{"name"}) are no longer exempt from strict refs if they 3107occur in the last statement of an lvalue subroutine [perl #102486]. 3108 3109=item * 3110 3111Sub calls whose subs are not visible at compile time, if 3112they occurred in the last statement of an lvalue subroutine, 3113would reject non-lvalue subroutines and die with "Can't modify non-lvalue 3114subroutine call" [perl #102486]. 3115 3116Non-lvalue sub calls whose subs I<are> visible at compile time exhibited 3117the opposite bug. If the call occurred in the last statement of an lvalue 3118subroutine, there would be no error when the lvalue sub was called in 3119lvalue context. Perl would blindly assign to the temporary value returned 3120by the non-lvalue subroutine. 3121 3122=item * 3123 3124C<AUTOLOAD> routines used to take precedence over the actual sub being 3125called (i.e., when autoloading wasn't needed), for sub calls in lvalue or 3126potential lvalue context, if the subroutine was not visible at compile 3127time. 3128 3129=item * 3130 3131Applying the C<:lvalue> attribute to an XSUB or to an aliased subroutine 3132stub with C<< sub foo :lvalue; >> syntax stopped working in Perl 5.12. 3133This has been fixed. 3134 3135=item * 3136 3137Applying the :lvalue attribute to subroutine that is already defined does 3138not work properly, as the attribute changes the way the sub is compiled. 3139Hence, Perl 5.12 began warning when an attempt is made to apply the 3140attribute to an already defined sub. In such cases, the attribute is 3141discarded. 3142 3143But the change in 5.12 missed the case where custom attributes are also 3144present: that case still silently and ineffectively applied the attribute. 3145That omission has now been corrected. C<sub foo :lvalue :Whatever> (when 3146C<foo> is already defined) now warns about the :lvalue attribute, and does 3147not apply it. 3148 3149=item * 3150 3151A bug affecting lvalue context propagation through nested lvalue subroutine 3152calls has been fixed. Previously, returning a value in nested rvalue 3153context would be treated as lvalue context by the inner subroutine call, 3154resulting in some values (such as read-only values) being rejected. 3155 3156=back 3157 3158=head2 Overloading 3159 3160=over 3161 3162=item * 3163 3164Arithmetic assignment (C<$left += $right>) involving overloaded objects 3165that rely on the 'nomethod' override no longer segfault when the left 3166operand is not overloaded. 3167 3168=item * 3169 3170Errors that occur when methods cannot be found during overloading now 3171mention the correct package name, as they did in 5.8.x, instead of 3172erroneously mentioning the "overload" package, as they have since 5.10.0. 3173 3174=item * 3175 3176Undefining C<%overload::> no longer causes a crash. 3177 3178=back 3179 3180=head2 Prototypes of built-in keywords 3181 3182=over 3183 3184=item * 3185 3186The C<prototype> function no longer dies for the C<__FILE__>, C<__LINE__> 3187and C<__PACKAGE__> directives. It now returns an empty-string prototype 3188for them, because they are syntactically indistinguishable from nullary 3189functions like C<time>. 3190 3191=item * 3192 3193C<prototype> now returns C<undef> for all overridable infix operators, 3194such as C<eq>, which are not callable in any way resembling functions. 3195It used to return incorrect prototypes for some and die for others 3196[perl #94984]. 3197 3198=item * 3199 3200The prototypes of several built-in functions--C<getprotobynumber>, C<lock>, 3201C<not> and C<select>--have been corrected, or at least are now closer to 3202reality than before. 3203 3204=back 3205 3206=head2 Regular expressions 3207 3208=for comment Is it possible to merge some of these items? 3209 3210=over 4 3211 3212=item * 3213 3214C</[[:ascii:]]/> and C</[[:blank:]]/> now use locale rules under 3215C<use locale> when the platform supports that. Previously, they used 3216the platform's native character set. 3217 3218=item * 3219 3220C<m/[[:ascii:]]/i> and C</\p{ASCII}/i> now match identically (when not 3221under a differing locale). This fixes a regression introduced in 5.14 3222in which the first expression could match characters outside of ASCII, 3223such as the KELVIN SIGN. 3224 3225=item * 3226 3227C</.*/g> would sometimes refuse to match at the end of a string that ends 3228with "\n". This has been fixed [perl #109206]. 3229 3230=item * 3231 3232Starting with 5.12.0, Perl used to get its internal bookkeeping muddled up 3233after assigning C<${ qr// }> to a hash element and locking it with 3234L<Hash::Util>. This could result in double frees, crashes, or erratic 3235behavior. 3236 3237=item * 3238 3239The new (in 5.14.0) regular expression modifier C</a> when repeated like 3240C</aa> forbids the characters outside the ASCII range that match 3241characters inside that range from matching under C</i>. This did not 3242work under some circumstances, all involving alternation, such as: 3243 3244 "\N{KELVIN SIGN}" =~ /k|foo/iaa; 3245 3246succeeded inappropriately. This is now fixed. 3247 3248=item * 3249 32505.14.0 introduced some memory leaks in regular expression character 3251classes such as C<[\w\s]>, which have now been fixed. (5.14.1) 3252 3253=item * 3254 3255An edge case in regular expression matching could potentially loop. 3256This happened only under C</i> in bracketed character classes that have 3257characters with multi-character folds, and the target string to match 3258against includes the first portion of the fold, followed by another 3259character that has a multi-character fold that begins with the remaining 3260portion of the fold, plus some more. 3261 3262 "s\N{U+DF}" =~ /[\x{DF}foo]/i 3263 3264is one such case. C<\xDF> folds to C<"ss">. (5.14.1) 3265 3266=item * 3267 3268A few characters in regular expression pattern matches did not 3269match correctly in some circumstances, all involving C</i>. The 3270affected characters are: 3271COMBINING GREEK YPOGEGRAMMENI, 3272GREEK CAPITAL LETTER IOTA, 3273GREEK CAPITAL LETTER UPSILON, 3274GREEK PROSGEGRAMMENI, 3275GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA, 3276GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, 3277GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA, 3278GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, 3279LATIN SMALL LETTER LONG S, 3280LATIN SMALL LIGATURE LONG S T, 3281and 3282LATIN SMALL LIGATURE ST. 3283 3284=item * 3285 3286A memory leak regression in regular expression compilation 3287under threading has been fixed. 3288 3289=item * 3290 3291A regression introduced in 5.14.0 has 3292been fixed. This involved an inverted 3293bracketed character class in a regular expression that consisted solely 3294of a Unicode property. That property wasn't getting inverted outside the 3295Latin1 range. 3296 3297=item * 3298 3299Three problematic Unicode characters now work better in regex pattern matching under C</i>. 3300 3301In the past, three Unicode characters: 3302LATIN SMALL LETTER SHARP S, 3303GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, 3304and 3305GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, 3306along with the sequences that they fold to 3307(including "ss" for LATIN SMALL LETTER SHARP S), 3308did not properly match under C</i>. 5.14.0 fixed some of these cases, 3309but introduced others, including a panic when one of the characters or 3310sequences was used in the C<(?(DEFINE)> regular expression predicate. 3311The known bugs that were introduced in 5.14 have now been fixed; as well 3312as some other edge cases that have never worked until now. These all 3313involve using the characters and sequences outside bracketed character 3314classes under C</i>. This closes [perl #98546]. 3315 3316There remain known problems when using certain characters with 3317multi-character folds inside bracketed character classes, including such 3318constructs as C<qr/[\N{LATIN SMALL LETTER SHARP}a-z]/i>. These 3319remaining bugs are addressed in [perl #89774]. 3320 3321=item * 3322 3323RT #78266: The regex engine has been leaking memory when accessing 3324named captures that weren't matched as part of a regex ever since 5.10 3325when they were introduced; e.g., this would consume over a hundred MB of 3326memory: 3327 3328 for (1..10_000_000) { 3329 if ("foo" =~ /(foo|(?<capture>bar))?/) { 3330 my $capture = $+{capture} 3331 } 3332 } 3333 system "ps -o rss $$"' 3334 3335=item * 3336 3337In 5.14, C</[[:lower:]]/i> and C</[[:upper:]]/i> no longer matched the 3338opposite case. This has been fixed [perl #101970]. 3339 3340=item * 3341 3342A regular expression match with an overloaded object on the right-hand side 3343would sometimes stringify the object too many times. 3344 3345=item * 3346 3347A regression has been fixed that was introduced in 5.14, in C</i> 3348regular expression matching, in which a match improperly fails if the 3349pattern is in UTF-8, the target string is not, and a Latin-1 character 3350precedes a character in the string that should match the pattern. 3351[perl #101710] 3352 3353=item * 3354 3355In case-insensitive regular expression pattern matching, no longer on 3356UTF-8 encoded strings does the scan for the start of match look only at 3357the first possible position. This caused matches such as 3358C<"f\x{FB00}" =~ /ff/i> to fail. 3359 3360=item * 3361 3362The regexp optimizer no longer crashes on debugging builds when merging 3363fixed-string nodes with inconvenient contents. 3364 3365=item * 3366 3367A panic involving the combination of the regular expression modifiers 3368C</aa> and the C<\b> escape sequence introduced in 5.14.0 has been 3369fixed [perl #95964]. (5.14.2) 3370 3371=item * 3372 3373The combination of the regular expression modifiers C</aa> and the C<\b> 3374and C<\B> escape sequences did not work properly on UTF-8 encoded 3375strings. All non-ASCII characters under C</aa> should be treated as 3376non-word characters, but what was happening was that Unicode rules were 3377used to determine wordness/non-wordness for non-ASCII characters. This 3378is now fixed [perl #95968]. 3379 3380=item * 3381 3382C<< (?foo: ...) >> no longer loses passed in character set. 3383 3384=item * 3385 3386The trie optimization used to have problems with alternations containing 3387an empty C<(?:)>, causing C<< "x" =~ /\A(?>(?:(?:)A|B|C?x))\z/ >> not to 3388match, whereas it should [perl #111842]. 3389 3390=item * 3391 3392Use of lexical (C<my>) variables in code blocks embedded in regular 3393expressions will no longer result in memory corruption or crashes. 3394 3395Nevertheless, these code blocks are still experimental, as there are still 3396problems with the wrong variables being closed over (in loops for instance) 3397and with abnormal exiting (e.g., C<die>) causing memory corruption. 3398 3399=item * 3400 3401The C<\h>, C<\H>, C<\v> and C<\V> regular expression metacharacters used to 3402cause a panic error message when trying to match at the end of the 3403string [perl #96354]. 3404 3405=item * 3406 3407The abbreviations for four C1 control characters C<MW> C<PM>, C<RI>, and 3408C<ST> were previously unrecognized by C<\N{}>, vianame(), and 3409string_vianame(). 3410 3411=item * 3412 3413Mentioning a variable named "&" other than C<$&> (i.e., C<@&> or C<%&>) no 3414longer stops C<$&> from working. The same applies to variables named "'" 3415and "`" [perl #24237]. 3416 3417=item * 3418 3419Creating a C<UNIVERSAL::AUTOLOAD> sub no longer stops C<%+>, C<%-> and 3420C<%!> from working some of the time [perl #105024]. 3421 3422=back 3423 3424=head2 Smartmatching 3425 3426=over 3427 3428=item * 3429 3430C<~~> now correctly handles the precedence of Any~~Object, and is not tricked 3431by an overloaded object on the left-hand side. 3432 3433=item * 3434 3435In Perl 5.14.0, C<$tainted ~~ @array> stopped working properly. Sometimes 3436it would erroneously fail (when C<$tainted> contained a string that occurs 3437in the array I<after> the first element) or erroneously succeed (when 3438C<undef> occurred after the first element) [perl #93590]. 3439 3440=back 3441 3442=head2 The C<sort> operator 3443 3444=over 3445 3446=item * 3447 3448C<sort> was not treating C<sub {}> and C<sub {()}> as equivalent when 3449such a sub was provided as the comparison routine. It used to croak on 3450C<sub {()}>. 3451 3452=item * 3453 3454C<sort> now works once more with custom sort routines that are XSUBs. It 3455stopped working in 5.10.0. 3456 3457=item * 3458 3459C<sort> with a constant for a custom sort routine, although it produces 3460unsorted results, no longer crashes. It started crashing in 5.10.0. 3461 3462=item * 3463 3464Warnings emitted by C<sort> when a custom comparison routine returns a 3465non-numeric value now contain "in sort" and show the line number of the 3466C<sort> operator, rather than the last line of the comparison routine. The 3467warnings also now occur only if warnings are enabled in the scope where 3468C<sort> occurs. Previously the warnings would occur if enabled in the 3469comparison routine's scope. 3470 3471=item * 3472 3473C<< sort { $a <=> $b } >>, which is optimized internally, now produces 3474"uninitialized" warnings for NaNs (not-a-number values), since C<< <=> >> 3475returns C<undef> for those. This brings it in line with 3476S<C<< sort { 1; $a <=> $b } >>> and other more complex cases, which are not 3477optimized [perl #94390]. 3478 3479=back 3480 3481=head2 The C<substr> operator 3482 3483=over 3484 3485=item * 3486 3487Tied (and otherwise magical) variables are no longer exempt from the 3488"Attempt to use reference as lvalue in substr" warning. 3489 3490=item * 3491 3492That warning now occurs when the returned lvalue is assigned to, not 3493when C<substr> itself is called. This makes a difference only if the 3494return value of C<substr> is referenced and later assigned to. 3495 3496=item * 3497 3498Passing a substring of a read-only value or a typeglob to a function 3499(potential lvalue context) no longer causes an immediate "Can't coerce" 3500or "Modification of a read-only value" error. That error occurs only 3501if the passed value is assigned to. 3502 3503The same thing happens with the "substr outside of string" error. If 3504the lvalue is only read from, not written to, it is now just a warning, as 3505with rvalue C<substr>. 3506 3507=item * 3508 3509C<substr> assignments no longer call FETCH twice if the first argument 3510is a tied variable, just once. 3511 3512=back 3513 3514=head2 Support for embedded nulls 3515 3516Some parts of Perl did not work correctly with nulls (C<chr 0>) embedded in 3517strings. That meant that, for instance, C<< $m = "a\0b"; foo->$m >> would 3518call the "a" method, instead of the actual method name contained in $m. 3519These parts of perl have been fixed to support nulls: 3520 3521=over 3522 3523=item * 3524 3525Method names 3526 3527=item * 3528 3529Typeglob names (including filehandle and subroutine names) 3530 3531=item * 3532 3533Package names, including the return value of C<ref()> 3534 3535=item * 3536 3537Typeglob elements (C<*foo{"THING\0stuff"}>) 3538 3539=item * 3540 3541Signal names 3542 3543=item * 3544 3545Various warnings and error messages that mention variable names or values, 3546methods, etc. 3547 3548=back 3549 3550One side effect of these changes is that blessing into "\0" no longer 3551causes C<ref()> to return false. 3552 3553=head2 Threading bugs 3554 3555=over 3556 3557=item * 3558 3559Typeglobs returned from threads are no longer cloned if the parent thread 3560already has a glob with the same name. This means that returned 3561subroutines will now assign to the right package variables [perl #107366]. 3562 3563=item * 3564 3565Some cases of threads crashing due to memory allocation during cloning have 3566been fixed [perl #90006]. 3567 3568=item * 3569 3570Thread joining would sometimes emit "Attempt to free unreferenced scalar" 3571warnings if C<caller> had been used from the C<DB> package before thread 3572creation [perl #98092]. 3573 3574=item * 3575 3576Locking a subroutine (via C<lock &sub>) is no longer a compile-time error 3577for regular subs. For lvalue subroutines, it no longer tries to return the 3578sub as a scalar, resulting in strange side effects like C<ref \$_> 3579returning "CODE" in some instances. 3580 3581C<lock &sub> is now a run-time error if L<threads::shared> is loaded (a 3582no-op otherwise), but that may be rectified in a future version. 3583 3584=back 3585 3586=head2 Tied variables 3587 3588=over 3589 3590=item * 3591 3592Various cases in which FETCH was being ignored or called too many times 3593have been fixed: 3594 3595=over 3596 3597=item * 3598 3599C<PerlIO::get_layers> [perl #97956] 3600 3601=item * 3602 3603C<$tied =~ y/a/b/>, C<chop $tied> and C<chomp $tied> when $tied holds a 3604reference. 3605 3606=item * 3607 3608When calling C<local $_> [perl #105912] 3609 3610=item * 3611 3612Four-argument C<select> 3613 3614=item * 3615 3616A tied buffer passed to C<sysread> 3617 3618=item * 3619 3620C<< $tied .= <> >> 3621 3622=item * 3623 3624Three-argument C<open>, the third being a tied file handle 3625(as in C<< open $fh, ">&", $tied >>) 3626 3627=item * 3628 3629C<sort> with a reference to a tied glob for the comparison routine. 3630 3631=item * 3632 3633C<..> and C<...> in list context [perl #53554]. 3634 3635=item * 3636 3637C<${$tied}>, C<@{$tied}>, C<%{$tied}> and C<*{$tied}> where the tied 3638variable returns a string (C<&{}> was unaffected) 3639 3640=item * 3641 3642C<defined ${ $tied_variable }> 3643 3644=item * 3645 3646Various functions that take a filehandle argument in rvalue context 3647(C<close>, C<readline>, etc.) [perl #97482] 3648 3649=item * 3650 3651Some cases of dereferencing a complex expression, such as 3652C<${ (), $tied } = 1>, used to call C<FETCH> multiple times, but now call 3653it once. 3654 3655=item * 3656 3657C<$tied-E<gt>method> where $tied returns a package name--even resulting in 3658a failure to call the method, due to memory corruption 3659 3660=item * 3661 3662Assignments like C<*$tied = \&{"..."}> and C<*glob = $tied> 3663 3664=item * 3665 3666C<chdir>, C<chmod>, C<chown>, C<utime>, C<truncate>, C<stat>, C<lstat> and 3667the filetest ops (C<-r>, C<-x>, etc.) 3668 3669=back 3670 3671=item * 3672 3673C<caller> sets C<@DB::args> to the subroutine arguments when called from 3674the DB package. It used to crash when doing so if C<@DB::args> happened to 3675be tied. Now it croaks instead. 3676 3677=item * 3678 3679Tying an element of %ENV or C<%^H> and then deleting that element would 3680result in a call to the tie object's DELETE method, even though tying the 3681element itself is supposed to be equivalent to tying a scalar (the element 3682is, of course, a scalar) [perl #67490]. 3683 3684=item * 3685 3686When Perl autovivifies an element of a tied array or hash (which entails 3687calling STORE with a new reference), it now calls FETCH immediately after 3688the STORE, instead of assuming that FETCH would have returned the same 3689reference. This can make it easier to implement tied objects [perl #35865, #43011]. 3690 3691=item * 3692 3693Four-argument C<select> no longer produces its "Non-string passed as 3694bitmask" warning on tied or tainted variables that are strings. 3695 3696=item * 3697 3698Localizing a tied scalar that returns a typeglob no longer stops it from 3699being tied till the end of the scope. 3700 3701=item * 3702 3703Attempting to C<goto> out of a tied handle method used to cause memory 3704corruption or crashes. Now it produces an error message instead 3705[perl #8611]. 3706 3707=item * 3708 3709A bug has been fixed that occurs when a tied variable is used as a 3710subroutine reference: if the last thing assigned to or returned from the 3711variable was a reference or typeglob, the C<\&$tied> could either crash or 3712return the wrong subroutine. The reference case is a regression introduced 3713in Perl 5.10.0. For typeglobs, it has probably never worked till now. 3714 3715=back 3716 3717=head2 Version objects and vstrings 3718 3719=over 3720 3721=item * 3722 3723The bitwise complement operator (and possibly other operators, too) when 3724passed a vstring would leave vstring magic attached to the return value, 3725even though the string had changed. This meant that 3726C<< version->new(~v1.2.3) >> would create a version looking like "v1.2.3" 3727even though the string passed to C<< version->new >> was actually 3728"\376\375\374". This also caused L<B::Deparse> to deparse C<~v1.2.3> 3729incorrectly, without the C<~> [perl #29070]. 3730 3731=item * 3732 3733Assigning a vstring to a magic (e.g., tied, C<$!>) variable and then 3734assigning something else used to blow away all magic. This meant that 3735tied variables would come undone, C<$!> would stop getting updated on 3736failed system calls, C<$|> would stop setting autoflush, and other 3737mischief would take place. This has been fixed. 3738 3739=item * 3740 3741C<< version->new("version") >> and C<printf "%vd", "version"> no longer 3742crash [perl #102586]. 3743 3744=item * 3745 3746Version comparisons, such as those that happen implicitly with C<use 3747v5.43>, no longer cause locale settings to change [perl #105784]. 3748 3749=item * 3750 3751Version objects no longer cause memory leaks in boolean context 3752[perl #109762]. 3753 3754=back 3755 3756=head2 Warnings, redefinition 3757 3758=over 3759 3760=item * 3761 3762Subroutines from the C<autouse> namespace are once more exempt from 3763redefinition warnings. This used to work in 5.005, but was broken in 37645.6 for most subroutines. For subs created via XS that redefine 3765subroutines from the C<autouse> package, this stopped working in 5.10. 3766 3767=item * 3768 3769New XSUBs now produce redefinition warnings if they overwrite existing 3770subs, as they did in 5.8.x. (The C<autouse> logic was reversed in 37715.10-14. Only subroutines from the C<autouse> namespace would warn 3772when clobbered.) 3773 3774=item * 3775 3776C<newCONSTSUB> used to use compile-time warning hints, instead of 3777run-time hints. The following code should never produce a redefinition 3778warning, but it used to, if C<newCONSTSUB> redefined an existing 3779subroutine: 3780 3781 use warnings; 3782 BEGIN { 3783 no warnings; 3784 some_XS_function_that_calls_new_CONSTSUB(); 3785 } 3786 3787=item * 3788 3789Redefinition warnings for constant subroutines are on by default (what 3790are known as severe warnings in L<perldiag>). This occurred only 3791when it was a glob assignment or declaration of a Perl subroutine that 3792caused the warning. If the creation of XSUBs triggered the warning, it 3793was not a default warning. This has been corrected. 3794 3795=item * 3796 3797The internal check to see whether a redefinition warning should occur 3798used to emit "uninitialized" warnings in cases like this: 3799 3800 use warnings "uninitialized"; 3801 use constant {u => undef, v => undef}; 3802 sub foo(){u} 3803 sub foo(){v} 3804 3805=back 3806 3807=head2 Warnings, "Uninitialized" 3808 3809=over 3810 3811=item * 3812 3813Various functions that take a filehandle argument in rvalue context 3814(C<close>, C<readline>, etc.) used to warn twice for an undefined handle 3815[perl #97482]. 3816 3817=item * 3818 3819C<dbmopen> now only warns once, rather than three times, if the mode 3820argument is C<undef> [perl #90064]. 3821 3822=item * 3823 3824The C<+=> operator does not usually warn when the left-hand side is 3825C<undef>, but it was doing so for tied variables. This has been fixed 3826[perl #44895]. 3827 3828=item * 3829 3830A bug fix in Perl 5.14 introduced a new bug, causing "uninitialized" 3831warnings to report the wrong variable if the operator in question had 3832two operands and one was C<%{...}> or C<@{...}>. This has been fixed 3833[perl #103766]. 3834 3835=item * 3836 3837C<..> and C<...> in list context now mention the name of the variable in 3838"uninitialized" warnings for string (as opposed to numeric) ranges. 3839 3840=back 3841 3842=head2 Weak references 3843 3844=over 3845 3846=item * 3847 3848Weakening the first argument to an automatically-invoked C<DESTROY> method 3849could result in erroneous "DESTROY created new reference" errors or 3850crashes. Now it is an error to weaken a read-only reference. 3851 3852=item * 3853 3854Weak references to lexical hashes going out of scope were not going stale 3855(becoming undefined), but continued to point to the hash. 3856 3857=item * 3858 3859Weak references to lexical variables going out of scope are now broken 3860before any magical methods (e.g., DESTROY on a tie object) are called. 3861This prevents such methods from modifying the variable that will be seen 3862the next time the scope is entered. 3863 3864=item * 3865 3866Creating a weak reference to an @ISA array or accessing the array index 3867(C<$#ISA>) could result in confused internal bookkeeping for elements 3868later added to the @ISA array. For instance, creating a weak 3869reference to the element itself could push that weak reference on to @ISA; 3870and elements added after use of C<$#ISA> would be ignored by method lookup 3871[perl #85670]. 3872 3873=back 3874 3875=head2 Other notable fixes 3876 3877=over 3878 3879=item * 3880 3881C<quotemeta> now quotes consistently the same non-ASCII characters under 3882C<use feature 'unicode_strings'>, regardless of whether the string is 3883encoded in UTF-8 or not, hence fixing the last vestiges (we hope) of the 3884notorious L<perlunicode/The "Unicode Bug">. [perl #77654]. 3885 3886Which of these code points is quoted has changed, based on Unicode's 3887recommendations. See L<perlfunc/quotemeta> for details. 3888 3889=item * 3890 3891C<study> is now a no-op, presumably fixing all outstanding bugs related to 3892study causing regex matches to behave incorrectly! 3893 3894=item * 3895 3896When one writes C<open foo || die>, which used to work in Perl 4, a 3897"Precedence problem" warning is produced. This warning used erroneously to 3898apply to fully-qualified bareword handle names not followed by C<||>. This 3899has been corrected. 3900 3901=item * 3902 3903After package aliasing (C<*foo:: = *bar::>), C<select> with 0 or 1 argument 3904would sometimes return a name that could not be used to refer to the 3905filehandle, or sometimes it would return C<undef> even when a filehandle 3906was selected. Now it returns a typeglob reference in such cases. 3907 3908=item * 3909 3910C<PerlIO::get_layers> no longer ignores some arguments that it thinks are 3911numeric, while treating others as filehandle names. It is now consistent 3912for flat scalars (i.e., not references). 3913 3914=item * 3915 3916Unrecognized switches on C<#!> line 3917 3918If a switch, such as B<-x>, that cannot occur on the C<#!> line is used 3919there, perl dies with "Can't emulate...". 3920 3921It used to produce the same message for switches that perl did not 3922recognize at all, whether on the command line or the C<#!> line. 3923 3924Now it produces the "Unrecognized switch" error message [perl #104288]. 3925 3926=item * 3927 3928C<system> now temporarily blocks the SIGCHLD signal handler, to prevent the 3929signal handler from stealing the exit status [perl #105700]. 3930 3931=item * 3932 3933The %n formatting code for C<printf> and C<sprintf>, which causes the number 3934of characters to be assigned to the next argument, now actually 3935assigns the number of characters, instead of the number of bytes. 3936 3937It also works now with special lvalue functions like C<substr> and with 3938nonexistent hash and array elements [perl #3471, #103492]. 3939 3940=item * 3941 3942Perl skips copying values returned from a subroutine, for the sake of 3943speed, if doing so would make no observable difference. Because of faulty 3944logic, this would happen with the 3945result of C<delete>, C<shift> or C<splice>, even if the result was 3946referenced elsewhere. It also did so with tied variables about to be freed 3947[perl #91844, #95548]. 3948 3949=item * 3950 3951C<utf8::decode> now refuses to modify read-only scalars [perl #91850]. 3952 3953=item * 3954 3955Freeing $_ inside a C<grep> or C<map> block, a code block embedded in a 3956regular expression, or an @INC filter (a subroutine returned by a 3957subroutine in @INC) used to result in double frees or crashes 3958[perl #91880, #92254, #92256]. 3959 3960=item * 3961 3962C<eval> returns C<undef> in scalar context or an empty list in list 3963context when there is a run-time error. When C<eval> was passed a 3964string in list context and a syntax error occurred, it used to return a 3965list containing a single undefined element. Now it returns an empty 3966list in list context for all errors [perl #80630]. 3967 3968=item * 3969 3970C<goto &func> no longer crashes, but produces an error message, when 3971the unwinding of the current subroutine's scope fires a destructor that 3972undefines the subroutine being "goneto" [perl #99850]. 3973 3974=item * 3975 3976Perl now holds an extra reference count on the package that code is 3977currently compiling in. This means that the following code no longer 3978crashes [perl #101486]: 3979 3980 package Foo; 3981 BEGIN {*Foo:: = *Bar::} 3982 sub foo; 3983 3984=item * 3985 3986The C<x> repetition operator no longer crashes on 64-bit builds with large 3987repeat counts [perl #94560]. 3988 3989=item * 3990 3991Calling C<require> on an implicit C<$_> when C<*CORE::GLOBAL::require> has 3992been overridden does not segfault anymore, and C<$_> is now passed to the 3993overriding subroutine [perl #78260]. 3994 3995=item * 3996 3997C<use> and C<require> are no longer affected by the I/O layers active in 3998the caller's scope (enabled by L<open.pm|open>) [perl #96008]. 3999 4000=item * 4001 4002C<our $::é; $é> (which is invalid) no longer produces the "Compilation 4003error at lib/utf8_heavy.pl..." error message, which it started emitting in 40045.10.0 [perl #99984]. 4005 4006=item * 4007 4008On 64-bit systems, C<read()> now understands large string offsets beyond 4009the 32-bit range. 4010 4011=item * 4012 4013Errors that occur when processing subroutine attributes no longer cause the 4014subroutine's op tree to leak. 4015 4016=item * 4017 4018Passing the same constant subroutine to both C<index> and C<formline> no 4019longer causes one or the other to fail [perl #89218]. (5.14.1) 4020 4021=item * 4022 4023List assignment to lexical variables declared with attributes in the same 4024statement (C<my ($x,@y) : blimp = (72,94)>) stopped working in Perl 5.8.0. 4025It has now been fixed. 4026 4027=item * 4028 4029Perl 5.10.0 introduced some faulty logic that made "U*" in the middle of 4030a pack template equivalent to "U0" if the input string was empty. This has 4031been fixed [perl #90160]. (5.14.2) 4032 4033=item * 4034 4035Destructors on objects were not called during global destruction on objects 4036that were not referenced by any scalars. This could happen if an array 4037element were blessed (e.g., C<bless \$a[0]>) or if a closure referenced a 4038blessed variable (C<bless \my @a; sub foo { @a }>). 4039 4040Now there is an extra pass during global destruction to fire destructors on 4041any objects that might be left after the usual passes that check for 4042objects referenced by scalars [perl #36347]. 4043 4044=item * 4045 4046Fixed a case where it was possible that a freed buffer may have been read 4047from when parsing a here document [perl #90128]. (5.14.1) 4048 4049=item * 4050 4051C<each(I<ARRAY>)> is now wrapped in C<defined(...)>, like C<each(I<HASH>)>, 4052inside a C<while> condition [perl #90888]. 4053 4054=item * 4055 4056A problem with context propagation when a C<do> block is an argument to 4057C<return> has been fixed. It used to cause C<undef> to be returned in 4058certain cases of a C<return> inside an C<if> block which itself is followed by 4059another C<return>. 4060 4061=item * 4062 4063Calling C<index> with a tainted constant no longer causes constants in 4064subsequently compiled code to become tainted [perl #64804]. 4065 4066=item * 4067 4068Infinite loops like C<1 while 1> used to stop C<strict 'subs'> mode from 4069working for the rest of the block. 4070 4071=item * 4072 4073For list assignments like C<($a,$b) = ($b,$a)>, Perl has to make a copy of 4074the items on the right-hand side before assignment them to the left. For 4075efficiency's sake, it assigns the values on the right straight to the items 4076on the left if no one variable is mentioned on both sides, as in C<($a,$b) = 4077($c,$d)>. The logic for determining when it can cheat was faulty, in that 4078C<&&> and C<||> on the right-hand side could fool it. So C<($a,$b) = 4079$some_true_value && ($b,$a)> would end up assigning the value of C<$b> to 4080both scalars. 4081 4082=item * 4083 4084Perl no longer tries to apply lvalue context to the string in 4085C<("string", $variable) ||= 1> (which used to be an error). Since the 4086left-hand side of C<||=> is evaluated in scalar context, that's a scalar 4087comma operator, which gives all but the last item void context. There is 4088no such thing as void lvalue context, so it was a mistake for Perl to try 4089to force it [perl #96942]. 4090 4091=item * 4092 4093C<caller> no longer leaks memory when called from the DB package if 4094C<@DB::args> was assigned to after the first call to C<caller>. L<Carp> 4095was triggering this bug [perl #97010]. (5.14.2) 4096 4097=item * 4098 4099C<close> and similar filehandle functions, when called on built-in global 4100variables (like C<$+>), used to die if the variable happened to hold the 4101undefined value, instead of producing the usual "Use of uninitialized 4102value" warning. 4103 4104=item * 4105 4106When autovivified file handles were introduced in Perl 5.6.0, C<readline> 4107was inadvertently made to autovivify when called as C<readline($foo)> (but 4108not as C<E<lt>$fooE<gt>>). It has now been fixed never to autovivify. 4109 4110=item * 4111 4112Calling an undefined anonymous subroutine (e.g., what $x holds after 4113C<undef &{$x = sub{}}>) used to cause a "Not a CODE reference" error, which 4114has been corrected to "Undefined subroutine called" [perl #71154]. 4115 4116=item * 4117 4118Causing C<@DB::args> to be freed between uses of C<caller> no longer 4119results in a crash [perl #93320]. 4120 4121=item * 4122 4123C<setpgrp($foo)> used to be equivalent to C<($foo, setpgrp)>, because 4124C<setpgrp> was ignoring its argument if there was just one. Now it is 4125equivalent to C<setpgrp($foo,0)>. 4126 4127=item * 4128 4129C<shmread> was not setting the scalar flags correctly when reading from 4130shared memory, causing the existing cached numeric representation in the 4131scalar to persist [perl #98480]. 4132 4133=item * 4134 4135C<++> and C<--> now work on copies of globs, instead of dying. 4136 4137=item * 4138 4139C<splice()> doesn't warn when truncating 4140 4141You can now limit the size of an array using C<splice(@a,MAX_LEN)> without 4142worrying about warnings. 4143 4144=item * 4145 4146C<< $$ >> is no longer tainted. Since this value comes directly from 4147C<< getpid() >>, it is always safe. 4148 4149=item * 4150 4151The parser no longer leaks a filehandle if STDIN was closed before parsing 4152started [perl #37033]. 4153 4154=item * 4155 4156C<< die; >> with a non-reference, non-string, or magical (e.g., tainted) 4157value in $@ now properly propagates that value [perl #111654]. 4158 4159=back 4160 4161=head1 Known Problems 4162 4163=over 4 4164 4165=item * 4166 4167On Solaris, we have two kinds of failure. 4168 4169If F<make> is Sun's F<make>, we get an error about a badly formed macro 4170assignment in the F<Makefile>. That happens when F<./Configure> tries to 4171make depends. F<Configure> then exits 0, but further F<make>-ing fails. 4172 4173If F<make> is F<gmake>, F<Configure> completes, then we get errors related 4174to F</usr/include/stdbool.h> 4175 4176=item * 4177 4178On Win32, a number of tests hang unless STDERR is redirected. The cause of 4179this is still under investigation. 4180 4181=item * 4182 4183When building as root with a umask that prevents files from being 4184other-readable, F<t/op/filetest.t> will fail. This is a test bug, not a 4185bug in perl's behavior. 4186 4187=item * 4188 4189Configuring with a recent gcc and link-time-optimization, such as 4190C<Configure -Doptimize='-O2 -flto'> fails 4191because the optimizer optimizes away some of Configure's tests. A 4192workaround is to omit the C<-flto> flag when running Configure, but add 4193it back in while actually building, something like 4194 4195 sh Configure -Doptimize=-O2 4196 make OPTIMIZE='-O2 -flto' 4197 4198=item * 4199 4200The following CPAN modules have test failures with perl 5.16. Patches have 4201been submitted for all of these, so hopefully there will be new releases 4202soon: 4203 4204=over 4205 4206=item * 4207 4208L<Date::Pcalc> version 6.1 4209 4210=item * 4211 4212L<Module::CPANTS::Analyse> version 0.85 4213 4214This fails due to problems in L<Module::Find> 0.10 and L<File::MMagic> 42151.27. 4216 4217=item * 4218 4219L<PerlIO::Util> version 0.72 4220 4221=back 4222 4223=back 4224 4225=head1 Acknowledgements 4226 4227Perl 5.16.0 represents approximately 12 months of development since Perl 42285.14.0 and contains approximately 590,000 lines of changes across 2,500 4229files from 139 authors. 4230 4231Perl continues to flourish into its third decade thanks to a vibrant 4232community of users and developers. The following people are known to 4233have contributed the improvements that became Perl 5.16.0: 4234 4235Aaron Crane, Abhijit Menon-Sen, Abigail, Alan Haggai Alavi, Alberto 4236Simões, Alexandr Ciornii, Andreas König, Andy Dougherty, Aristotle 4237Pagaltzis, Bo Johansson, Bo Lindbergh, Breno G. de Oliveira, brian d 4238foy, Brian Fraser, Brian Greenfield, Carl Hayter, Chas. Owens, 4239Chia-liang Kao, Chip Salzenberg, Chris 'BinGOs' Williams, Christian 4240Hansen, Christopher J. Madsen, chromatic, Claes Jacobsson, Claudio 4241Ramirez, Craig A. Berry, Damian Conway, Daniel Kahn Gillmor, Darin 4242McBride, Dave Rolsky, David Cantrell, David Golden, David Leadbeater, 4243David Mitchell, Dee Newcum, Dennis Kaarsemaker, Dominic Hargreaves, 4244Douglas Christopher Wilson, Eric Brine, Father Chrysostomos, Florian 4245Ragwitz, Frederic Briere, George Greer, Gerard Goossen, Gisle Aas, 4246H.Merijn Brand, Hojung Youn, Ian Goodacre, James E Keenan, Jan Dubois, 4247Jerry D. Hedden, Jesse Luehrs, Jesse Vincent, Jilles Tjoelker, Jim 4248Cromie, Jim Meyering, Joel Berger, Johan Vromans, Johannes Plunien, John 4249Hawkinson, John P. Linderman, John Peacock, Joshua ben Jore, Juerd 4250Waalboer, Karl Williamson, Karthik Rajagopalan, Keith Thompson, Kevin J. 4251Woolley, Kevin Ryde, Laurent Dami, Leo Lapworth, Leon Brocard, Leon 4252Timmermans, Louis Strous, Lukas Mai, Marc Green, Marcel Grünauer, Mark 4253A. Stratman, Mark Dootson, Mark Jason Dominus, Martin Hasch, Matthew 4254Horsfall, Max Maischein, Michael G Schwern, Michael Witten, Mike 4255Sheldrake, Moritz Lenz, Nicholas Clark, Niko Tyni, Nuno Carvalho, Pau 4256Amma, Paul Evans, Paul Green, Paul Johnson, Perlover, Peter John Acklam, 4257Peter Martini, Peter Scott, Phil Monsen, Pino Toscano, Rafael 4258Garcia-Suarez, Rainer Tammer, Reini Urban, Ricardo Signes, Robin Barker, 4259Rodolfo Carvalho, Salvador Fandiño, Sam Kimbrel, Samuel Thibault, Shawn 4260M Moore, Shigeya Suzuki, Shirakata Kentaro, Shlomi Fish, Sisyphus, 4261Slaven Rezic, Spiros Denaxas, Steffen Müller, Steffen Schwigon, Stephen 4262Bennett, Stephen Oberholtzer, Stevan Little, Steve Hay, Steve Peters, 4263Thomas Sibley, Thorsten Glaser, Timothe Litt, Todd Rinaldo, Tom 4264Christiansen, Tom Hukins, Tony Cook, Vadim Konovalov, Vincent Pit, 4265Vladimir Timofeev, Walt Mankowski, Yves Orton, Zefram, Zsbán Ambrus, 4266Ævar Arnfjörð Bjarmason. 4267 4268The list above is almost certainly incomplete as it is automatically 4269generated from version control history. In particular, it does not 4270include the names of the (very much appreciated) contributors who 4271reported issues to the Perl bug tracker. 4272 4273Many of the changes included in this version originated in the CPAN 4274modules included in Perl's core. We're grateful to the entire CPAN 4275community for helping Perl to flourish. 4276 4277For a more complete list of all of Perl's historical contributors, 4278please see the F<AUTHORS> file in the Perl source distribution. 4279 4280=head1 Reporting Bugs 4281 4282If you find what you think is a bug, you might check the articles 4283recently posted to the comp.lang.perl.misc newsgroup and the perl 4284bug database at L<http://rt.perl.org/perlbug/>. There may also be 4285information at L<http://www.perl.org/>, the Perl Home Page. 4286 4287If you believe you have an unreported bug, please run the L<perlbug> 4288program included with your release. Be sure to trim your bug down 4289to a tiny but sufficient test case. Your bug report, along with the 4290output of C<perl -V>, will be sent off to perlbug@perl.org to be 4291analysed by the Perl porting team. 4292 4293If the bug you are reporting has security implications, which make it 4294inappropriate to send to a publicly archived mailing list, then please 4295send it to perl5-security-report@perl.org. This points to a closed 4296subscription unarchived mailing list, which includes all core 4297committers, who will be able to help assess the impact of issues, figure 4298out a resolution, and help co-ordinate the release of patches to 4299mitigate or fix the problem across all platforms on which Perl is 4300supported. Please use this address only for security issues in the Perl 4301core, not for modules independently distributed on CPAN. 4302 4303=head1 SEE ALSO 4304 4305The F<Changes> file for an explanation of how to view exhaustive details 4306on what changed. 4307 4308The F<INSTALL> file for how to build Perl. 4309 4310The F<README> file for general stuff. 4311 4312The F<Artistic> and F<Copying> files for copyright information. 4313 4314=cut 4315