Cari di Perl 
    Perl Tutorial
Daftar Isi
(Sebelumnya) What is new for perl v5.16.0What is new for perl v5.14.2 (Berikutnya)
History-Changes

What is new for perl v5.16.0

Daftar Isi

NAME

perldelta - what is new for perl v5.16.0

DESCRIPTION

This document describes differences between the 5.14.0 release andthe 5.16.0 release.

If you are upgrading from an earlier release such as 5.12.0, first readperl5140delta, which describes differences between 5.12.0 and5.14.0.

Some bug fixes in this release have been backported to laterreleases of 5.14.x. Those are indicated with the 5.14.x version inparentheses.

Notice

With the release of Perl 5.16.0, the 5.12.x series of releases is now out ofits support period. There may be future 5.12.x releases, but only in theevent of a critical security issue. Users of Perl 5.12 or earlier shouldconsider upgrading to a more recent release of Perl.

This policy is described in greater detail inperlpolicy.

Core Enhancements

use VERSION

As of this release, version declarations like use v5.16 now disableall features before enabling the new feature bundle. This means thatthe following holds true:

  1. use 5.016;
  2. # only 5.16 features enabled here
  3. use 5.014;
  4. # only 5.14 features enabled here (not 5.16)

use v5.12 and higher continue to enable strict, but explicit usestrict and no strict now override the version declaration, evenwhen they come first:

  1. no strict;
  2. use 5.012;
  3. # no strict here

There is a new ":default" feature bundle that represents the set offeatures enabled before any version declaration or use feature hasbeen seen. Version declarations below 5.10 now enable the ":default"feature set. This does not actually change the behavior of usev5.8, because features added to the ":default" set are those that weretraditionally enabled by default, before they could be turned off.

no feature now resets to the default feature set. To disable allfeatures (which is likely to be a pretty special-purpose request, sinceit presumably won't match any named set of semantics) you can now write no feature ':all'.

$[ is now disabled under use v5.16. It is part of the defaultfeature set and can be turned on or off explicitly with use feature'array_base'.

__SUB__

The new __SUB__ token, available under the current_sub feature(see feature) or use v5.16, returns a reference to the currentsubroutine, making it easier to write recursive closures.

New and Improved Built-ins

More consistent eval

The eval operator sometimes treats a string argument as a sequence ofcharacters and sometimes as a sequence of bytes, depending on theinternal encoding. The internal encoding is not supposed to make anydifference, but there is code that relies on this inconsistency.

The new unicode_eval and evalbytes features (enabled under use5.16.0) resolve this. The unicode_eval feature causes eval$string to treat the string always as Unicode. The evalbytesfeatures provides a function, itself called evalbytes, whichevaluates its argument always as a string of bytes.

These features also fix oddities with source filters leaking to outerdynamic scopes.

See feature for more detail.

substr lvalue revamp

When substr is called in lvalue or potential lvalue context with twoor three arguments, a special lvalue scalar is returned that modifiesthe original string (the first argument) when assigned to.

Previously, the offsets (the second and third arguments) passed tosubstr would be converted immediately to match the string, negativeoffsets being translated to positive and offsets beyond the end of thestring being truncated.

Now, the offsets are recorded without modification in the speciallvalue scalar that is returned, and the original string is not evenlooked at by substr itself, but only when the returned lvalue isread or modified.

These changes result in an incompatible change:

If the original string changes length after the call to substr butbefore assignment to its return value, negative offsets will remembertheir position from the end of the string, affecting code like this:

  1. my $string = "string";
  2. my $lvalue = \substr $string, -4, 2;
  3. print $$lvalue, "\n"; # prints "ri"
  4. $string = "bailing twine";
  5. print $$lvalue, "\n"; # prints "wi" used to print "il"

The same thing happens with an omitted third argument. The returnedlvalue will always extend to the end of the string, even if the stringbecomes longer.

Since this change also allowed many bugs to be fixed (seeThe substr operator), and since the behaviorof negative offsets has never been specified, thechange was deemed acceptable.

Return value of tied

The value returned by tied on a tied variable is now the actualscalar that holds the object to which the variable is tied. Thislets ties be weakened with Scalar::Util::weaken(tied$tied_variable).

Unicode Support

Supports (almost) Unicode 6.1

Besides the addition of whole new scripts, and new characters inexisting scripts, this new version of Unicode, as always, makes somechanges to existing characters. One change that may trip up someapplications is that the General Category of two characters in theLatin-1 range, PILCROW SIGN and SECTION SIGN, has been changed fromOther_Symbol to Other_Punctuation. The same change has been made fora character in each of Tibetan, Ethiopic, and Aegean.The code points U+3248..U+324F (CIRCLED NUMBER TEN ON BLACK SQUAREthrough CIRCLED NUMBER EIGHTY ON BLACK SQUARE) have had their GeneralCategory changed from Other_Symbol to Other_Numeric. The Line Breakproperty has changes for Hebrew and Japanese; and because ofother changes in 6.1, the Perl regular expression construct \X nowworks differently for some characters in Thai and Lao.

New aliases (synonyms) have been defined for many property values;these, along with the previously existing ones, are all cross-indexed inperluniprops.

The return value of charnames::viacode() is affected by otherchanges:

  1. Code point Old Name New Name
  2. U+000A LINE FEED (LF) LINE FEED
  3. U+000C FORM FEED (FF) FORM FEED
  4. U+000D CARRIAGE RETURN (CR) CARRIAGE RETURN
  5. U+0085 NEXT LINE (NEL) NEXT LINE
  6. U+008E SINGLE-SHIFT 2 SINGLE-SHIFT-2
  7. U+008F SINGLE-SHIFT 3 SINGLE-SHIFT-3
  8. U+0091 PRIVATE USE 1 PRIVATE USE-1
  9. U+0092 PRIVATE USE 2 PRIVATE USE-2
  10. U+2118 SCRIPT CAPITAL P WEIERSTRASS ELLIPTIC FUNCTION

Perl will accept any of these names as input, butcharnames::viacode() now returns the new name of each pair. Thechange for U+2118 is considered by Unicode to be a correction, that isthe original name was a mistake (but again, it will remain forever validto use it to refer to U+2118). But most of these changes are thefallout of the mistake Unicode 6.0 made in naming a character used inJapanese cell phones to be "BELL", which conflicts with the longstandingindustry use of (and Unicode's recommendation to use) that nameto mean the ASCII control character at U+0007. Therefore, that namehas been deprecated in Perl since v5.14, and any use of it will raise awarning message (unless turned off). The name "ALERT" is now thepreferred name for this code point, with "BEL" an acceptable shortform. The name for the new cell phone character, at code point U+1F514,remains undefined in this version of Perl (hence we don't implement quite all of Unicode 6.1), but starting in v5.18, BELL will meanthis character, and not U+0007.

Unicode has taken steps to make sure that this sort of mistake does nothappen again. The Standard now includes all generally acceptednames and abbreviations for control characters, whereas previously itdidn't (though there were recommended names for most of them, which Perlused). This means that most of those recommended names are nowofficially in the Standard. Unicode did not recommend names for thefour code points listed above between U+008E and U+008F, and instandardizing them Unicode subtly changed the names that Perl hadpreviously given them, by replacing the final blank in each name by ahyphen. Unicode also officially accepts names that Perl had deprecated,such as FILE SEPARATOR. Now the only deprecated name is BELL.Finally, Perl now uses the new official names instead of the old(now considered obsolete) names for the first four code points in thelist above (the ones which have the parentheses in them).

Now that the names have been placed in the Unicode standard, these kindsof changes should not happen again, though corrections, such as toU+2118, are still possible.

Unicode also added some name abbreviations, which Perl now accepts:SP for SPACE;TAB for CHARACTER TABULATION;NEW LINE, END OF LINE, NL, and EOL for LINE FEED;LOCKING-SHIFT ONE for SHIFT OUT;LOCKING-SHIFT ZERO for SHIFT IN;and ZWNBSP for ZERO WIDTH NO-BREAK SPACE.

More details on this version of Unicode are provided inhttp://www.unicode.org/versions/Unicode6.1.0/.

use charnames is no longer needed for \N{name}

When \N{name} is encountered, the charnames module is nowautomatically loaded when needed as if the :full and :shortoptions had been specified. See charnames for more information.

\N{...} can now have Unicode loose name matching

This is described in the charnames item inUpdated Modules and Pragmata below.

Unicode Symbol Names

Perl now has proper support for Unicode in symbol names. It used to bethat *{$foo} would ignore the internal UTF8 flag and use the bytes ofthe underlying representation to look up the symbol. That meant that*{"\x{100}"} and *{"\xc4\x80"} would return the same thing. Allthese parts of Perl have been fixed to account for Unicode:

  • Method names (including those passed to use overload)

  • Typeglob names (including names of variables, subroutines, and filehandles)

  • Package names

  • goto

  • Symbolic dereferencing

  • Second argument to bless() and tie()

  • Return value of ref()

  • Subroutine prototypes

  • Attributes

  • Various warnings and error messages that mention variable names or values,methods, etc.

In addition, a parsing bug has been fixed that prevented *{é} fromimplicitly quoting the name, but instead interpreted it as *{+é}, whichwould cause a strict violation.

*{"*a::b"} automatically strips off the * if it is followed by an ASCIIletter. That has been extended to all Unicode identifier characters.

One-character non-ASCII non-punctuation variables (like ) are nowsubject to "Used only once" warnings. They used to be exempt, as theywere treated as punctuation variables.

Also, single-character Unicode punctuation variables (like $‰) are nowsupported [perl #69032].

Improved ability to mix locales and Unicode, including UTF-8 locales

An optional parameter has been added to use locale

  1. use locale ':not_characters';

which tells Perl to use all but the LC_CTYPE and LC_COLLATEportions of the current locale. Instead, the character set is assumedto be Unicode. This lets locales and Unicode be seamlessly mixed,including the increasingly frequent UTF-8 locales. When using thishybrid form of locales, the :locale layer to the open pragma canbe used to interface with the file system, and there are CPAN modulesavailable for ARGV and environment variable conversions.

Full details are in perllocale.

New function fc and corresponding escape sequence \F for Unicode foldcase

Unicode foldcase is an extension to lowercase that gives better resultswhen comparing two strings case-insensitively. It has long been usedinternally in regular expression /i matching. Now it is availableexplicitly through the new fc function call (enabled by"use feature 'fc'", or use v5.16, or explicitly callable viaCORE::fc) or through the new \F sequence in double-quotishstrings.

Full details are in fc.

The Unicode Script_Extensions property is now supported.

New in Unicode 6.0, this is an improved Script property. Detailsare in Scripts in perlunicode.

XS Changes

Improved typemaps for Some Builtin Types

Most XS authors will know there is a longstanding bug in theOUTPUT typemap for T_AVREF (AV*), T_HVREF (HV*), T_CVREF (CV*),and T_SVREF (SVREF or \$foo) that requires manually decrementingthe reference count of the return value instead of the typemap takingcare of this. For backwards-compatibility, this cannot be changed in thedefault typemaps. But we now provide additional typemapsT_AVREF_REFCOUNT_FIXED, etc. that do not exhibit this bug. Usingthem in your extension is as simple as having one line in yourTYPEMAP section:

  1. HV*T_HVREF_REFCOUNT_FIXED

is_utf8_char()

The XS-callable function is_utf8_char(), when presented withmalformed UTF-8 input, can read up to 12 bytes beyond the end of thestring. This cannot be fixed without changing its API, and so itsuse is now deprecated. Use is_utf8_char_buf() (described just below)instead.

Added is_utf8_char_buf()

This function is designed to replace the deprecated is_utf8_char()function. It includes an extra parameter to make sure it doesn't readpast the end of the input buffer.

Other is_utf8_foo() functions, as well as utf8_to_foo(), etc.

Most other XS-callable functions that take UTF-8 encoded inputimplicitly assume that the UTF-8 is valid (not malformed) with respect tobuffer length. Do not do things such as change a character's case orsee if it is alphanumeric without first being sure that it is validUTF-8. This can be safely done for a whole string by using one of thefunctions is_utf8_string(), is_utf8_string_loc(), andis_utf8_string_loclen().

New Pad API

Many new functions have been added to the API for manipulating lexicalpads. See Pad Data Structures in perlapi for more information.

Changes to Special Variables

$$ can be assigned to

$$ was made read-only in Perl 5.8.0. But only sometimes: local $$would make it writable again. Some CPAN modules were using local $$ orXS code to bypass the read-only check, so there is no reason to keep $$read-only. (This change also allowed a bug to be fixed while maintainingbackward compatibility.)

$^X converted to an absolute path on FreeBSD, OS X and Solaris

$^X is now converted to an absolute path on OS X, FreeBSD (withoutneeding /proc mounted) and Solaris 10 and 11. This augments theprevious approach of using /proc on Linux, FreeBSD, and NetBSD(in all cases, where mounted).

This makes relocatable perl installations more useful on these platforms.(See "Relocatable @INC" in INSTALL)

Debugger Changes

Features inside the debugger

The current Perl's feature bundle is now enabled for commands enteredin the interactive debugger.

New option for the debugger's t command

The t command in the debugger, which toggles tracing mode, nowaccepts a numeric argument that determines how many levels of subroutinecalls to trace.

enable and disable

The debugger now has disable and enable commands for disablingexisting breakpoints and re-enabling them. See perldebug.

Breakpoints with file names

The debugger's "b" command for setting breakpoints now lets a linenumber be prefixed with a file name. Seeb [file]:[line] [condition] in perldebug.

The CORE Namespace

The CORE:: prefix

The CORE:: prefix can now be used on keywords enabled byfeature.pm, even outside the scope of use feature.

Subroutines in the CORE namespace

Many Perl keywords are now available as subroutines in the CORE namespace.This lets them be aliased:

  1. BEGIN { *entangle = \&CORE::tie }
  2. entangle $variable, $package, @args;

And for prototypes to be bypassed:

  1. sub mytie(\[%$*@]$@) {
  2. my ($ref, $pack, @args) = @_;
  3. ... do something ...
  4. goto &CORE::tie;
  5. }

Some of these cannot be called through references or via &foo syntax,but must be called as barewords.

See CORE for details.

Other Changes

Anonymous handles

Automatically generated file handles are now named __ANONIO__ when thevariable name cannot be determined, rather than $__ANONIO__.

Autoloaded sort Subroutines

Custom sort subroutines can now be autoloaded [perl #30661]:

  1. sub AUTOLOAD { ... }
  2. @sorted = sort foo @list; # uses AUTOLOAD

continue no longer requires the "switch" feature

The continue keyword has two meanings. It can introduce a continueblock after a loop, or it can exit the current when block. Up to now,the latter meaning was valid only with the "switch" feature enabled, andwas a syntax error otherwise. Since the main purpose of feature.pm is toavoid conflicts with user-defined subroutines, there is no reason forcontinue to depend on it.

DTrace probes for interpreter phase change

The phase-change probes will fire when the interpreter's phasechanges, which tracks the ${^GLOBAL_PHASE} variable. arg0 isthe new phase name; arg1 is the old one. This is useful for limiting your instrumentation to one or more of: compile time,run time, or destruct time.

__FILE__() Syntax

The __FILE__, __LINE__ and __PACKAGE__ tokens can now be writtenwith an empty pair of parentheses after them. This makes them parse thesame way as time, fork and other built-in functions.

The \$ prototype accepts any scalar lvalue

The \$ and \[$] subroutine prototypes now accept any scalar lvalueargument. Previously they accepted only scalars beginning with $ andhash and array elements. This change makes them consistent with the waythe built-in read and recv functions (among others) parse theirarguments. This means that one can override the built-in functions withcustom subroutines that parse their arguments the same way.

_ in subroutine prototypes

The _ character in subroutine prototypes is now allowed before @ or%.

Security

Use is_utf8_char_buf() and not is_utf8_char()

The latter function is now deprecated because its API is insufficient toguarantee that it doesn't read (up to 12 bytes in the worst case) beyondthe end of its input string. Seeis_utf8_char_buf().

Malformed UTF-8 input could cause attempts to read beyond the end of the buffer

Two new XS-accessible functions, utf8_to_uvchr_buf() andutf8_to_uvuni_buf() are now available to prevent this, and the Perlcore has been converted to use them.See Internal Changes.

File::Glob::bsd_glob() memory error with GLOB_ALTDIRFUNC (CVE-2011-2728).

Calling File::Glob::bsd_glob with the unsupported flagGLOB_ALTDIRFUNC would cause an access violation / segfault. A Perlprogram that accepts a flags value from an external source could exposeitself to denial of service or arbitrary code execution attacks. Thereare no known exploits in the wild. The problem has been corrected byexplicitly disabling all unsupported flags and setting unused functionpointers to null. Bug reported by Clément Lecigne. (5.14.2)

Privileges are now set correctly when assigning to $(

A hypothetical bug (probably unexploitable in practice) because theincorrect setting of the effective group ID while setting $( has beenfixed. The bug would have affected only systems that have setresgid()but not setregid(), but no such systems are known to exist.

Deprecations

Don't read the Unicode data base files in lib/unicore

It is now deprecated to directly read the Unicode data base files.These are stored in the lib/unicore directory. Instead, you shoulduse the new functions in Unicode::UCD. These provide a stable API,and give complete information.

Perl may at some point in the future change or remove these files. Thefile which applications were most likely to have used islib/unicore/ToDigit.pl. prop_invmap() in Unicode::UCD can be used toget at its data instead.

XS functions is_utf8_char(), utf8_to_uvchr() andutf8_to_uvuni()

This function is deprecated because it could read beyond the end of theinput string. Use the new is_utf8_char_buf(),utf8_to_uvchr_buf() and utf8_to_uvuni_buf() instead.

Future Deprecations

This section serves as a notice of features that are likely to beremoved or deprecated in the next release ofperl (5.18.0). If your code depends on these features, you shouldcontact the Perl 5 Porters via the mailing list or perlbug toexplain your use case and inform the deprecation process.

Core Modules

These modules may be marked as deprecated from the core. This onlymeans that they will no longer be installed by default with the coredistribution, but will remain available on the CPAN.

  • CPANPLUS

  • Filter::Simple

  • PerlIO::mmap

  • Pod::LaTeX

  • Pod::Parser

  • SelfLoader

  • Text::Soundex

  • Thread.pm

Platforms with no supporting programmers:

These platforms will probably have theirspecial build support removed during the5.17.0 development series.

  • BeOS

  • djgpp

  • dgux

  • EPOC

  • MPE/iX

  • Rhapsody

  • UTS

  • VM/ESA

Other Future Deprecations

  • Swapping of $< and $>

    For more information about this future deprecation, see the relevant RT ticket.

  • sfio, stdio

    Perl supports being built without PerlIO proper, using a stdio or sfiowrapper instead. A perl build like this will not support IO layers andthus Unicode IO, making it rather handicapped.

    PerlIO supports a stdio layer if stdio use is desired, and similarly asfio layer could be produced.

  • Unescaped literal "{" in regular expressions.

    Starting with v5.20, it is planned to require a literal "{" to beescaped, for example by preceding it with a backslash. In v5.18, adeprecated warning message will be emitted for all such uses. This affects only patterns that are to match a literal "{". Otheruses of this character, such as part of a quantifier or sequence as inthose below, are completely unaffected:

    1. /foo{3,5}/
    2. /\p{Alphabetic}/
    3. /\N{DIGIT ZERO}

    Removing this will permit extensions to Perl's pattern syntax and bettererror checking for existing syntax. See Quantifiers in perlre for anexample.

  • Revamping "\Q" semantics in double-quotish strings when combined with other escapes.

    There are several bugs and inconsistencies involving combinationsof \Q and escapes like \x, \L, etc., within a \Q...\E pair.These need to be fixed, and doing so will necessarily change currentbehavior. The changes have not yet been settled.

Incompatible Changes

Special blocks called in void context

Special blocks (BEGIN, CHECK, INIT, UNITCHECK, END) are nowcalled in void context. This avoids wasteful copying of the result of thelast statement [perl #108794].

The overloading pragma and regexp objects

With no overloading, regular expression objects returned by qr// arenow stringified as "Regexp=REGEXP(0xbe600d)" instead of the regularexpression itself [perl #108780].

Two XS typemap Entries removed

Two presumably unused XS typemap entries have been removed from thecore typemap: T_DATAUNIT and T_CALLBACK. If you are, against all odds,a user of these, please see the instructions on how to restore themin perlxstypemap.

Unicode 6.1 has incompatibilities with Unicode 6.0

These are detailed in Supports (almost) Unicode 6.1 above.You can compile this version of Perl to use Unicode 6.0. SeeHacking Perl to work on earlier Unicode versions (for very serious hackers only) in perlunicode.

Borland compiler

All support for the Borland compiler has been dropped. The code had notworked for a long time anyway.

Certain deprecated Unicode properties are no longer supported by default

Perl should never have exposed certain Unicode properties that are usedby Unicode internally and not meant to be publicly available. Use ofthese has generated deprecated warning messages since Perl 5.12. Theremoved properties are Other_Alphabetic,Other_Default_Ignorable_Code_Point, Other_Grapheme_Extend,Other_ID_Continue, Other_ID_Start, Other_Lowercase, Other_Math, andOther_Uppercase.

Perl may be recompiled to include any or all of them; instructions aregiven inUnicode character properties that are NOT accepted by Perl in perluniprops.

Dereferencing IO thingies as typeglobs

The *{...} operator, when passed a reference to an IO thingy (as in*{*STDIN{IO}}), creates a new typeglob containing just that IO object.Previously, it would stringify as an empty string, but some operators wouldtreat it as undefined, producing an "uninitialized" warning.Now it stringifies as __ANONIO__ [perl #96326].

User-defined case-changing operations

This feature was deprecated in Perl 5.14, and has now been removed.The CPAN module Unicode::Casing provides better functionality withoutthe drawbacks that this feature had, as are detailed in the 5.14documentation:http://perldoc.perl.org/5.14.0/perlunicode.html#User-Defined-Case-Mappings-%28for-serious-hackers-only%29

XSUBs are now 'static'

XSUB C functions are now 'static', that is, they are not visible fromoutside the compilation unit. Users can use the new XS_EXTERNAL(name)and XS_INTERNAL(name) macros to pick the desired linking behavior.The ordinary XS(name) declaration for XSUBs will continue to declarenon-'static' XSUBs for compatibility, but the XS compiler,ExtUtils::ParseXS (xsubpp) will emit 'static' XSUBs by default.ExtUtils::ParseXS's behavior can be reconfigured from XS using theEXPORT_XSUB_SYMBOLS keyword. See perlxs for details.

Weakening read-only references

Weakening read-only references is no longer permitted. It should neverhave worked anyway, and could sometimes result in crashes.

Tying scalars that hold typeglobs

Attempting to tie a scalar after a typeglob was assigned to it wouldinstead tie the handle in the typeglob's IO slot. This meant that it wasimpossible to tie the scalar itself. Similar problems affected tied anduntie: tied $scalar would return false on a tied scalar if the lastthing returned was a typeglob, and untie $scalar on such a tied scalarwould do nothing.

We fixed this problem before Perl 5.14.0, but it caused problems with someCPAN modules, so we put in a deprecation cycle instead.

Now the deprecation has been removed and this bug has been fixed. Sotie $scalar will always tie the scalar, not the handle it holds. To tiethe handle, use tie *$scalar (with an explicit asterisk). The sameapplies to tied *$scalar and untie *$scalar.

IPC::Open3 no longer provides xfork(), xclose_on_exec()and xpipe_anon()

All three functions were private, undocumented, and unexported. They donot appear to be used by any code on CPAN. Two have been inlined and onedeleted entirely.

$$ no longer caches PID

Previously, if one called fork(3) from C, Perl'snotion of $$ could go out of sync with what getpid() returns. By alwaysfetching the value of $$ via getpid(), this potential bug is eliminated.Code that depends on the caching behavior will break. As described inCore Enhancements,$$ is now writable, but it will be reset during afork.

$$ and getppid() no longer emulate POSIX semantics under LinuxThreads

The POSIX emulation of $$ and getppid() under the obsoleteLinuxThreads implementation has been removed.This only impacts users of Linux 2.4 andusers of Debian GNU/kFreeBSD up to and including 6.0, not the vastmajority of Linux installations that use NPTL threads.

This means that getppid(), like $$, is now always guaranteed toreturn the OS's idea of the current state of the process, not perl'scached version of it.

See the documentation for $$ for details.

$<, $>, $( and $) are no longer cached

Similarly to the changes to $$ and getppid(), the internalcaching of $<, $>, $( and $) has been removed.

When we cached these values our idea of what they were would drift outof sync with reality if someone (e.g., someone embedding perl) calledsete?[ug]id() without updating PL_e?[ug]id. Having to deal withthis complexity wasn't worth it given how cheap the gete?[ug]id()system call is.

This change will break a handful of CPAN modules that use the XS-levelPL_uid, PL_gid, PL_euid or PL_egid variables.

The fix for those breakages is to use PerlProc_gete?[ug]id() toretrieve them (e.g., PerlProc_getuid()), and not to assign toPL_e?[ug]id if you change the UID/GID/EUID/EGID. There is no longerany need to do so since perl will always retrieve the up-to-dateversion of those values from the OS.

Which Non-ASCII characters get quoted by quotemeta and \Q has changed

This is unlikely to result in a real problem, as Perl does not attachspecial meaning to any non-ASCII character, so it is currentlyirrelevant which are quoted or not. This change fixes bug [perl #77654] andbrings Perl's behavior more into line with Unicode's recommendations.See quotemeta.

Performance Enhancements

  • Improved performance for Unicode properties in regular expressions

    Matching a code point against a Unicode property is now done via abinary search instead of linear. This means for example that the worstcase for a 1000 item property is 10 probes instead of 1000. Thisinefficiency has been compensated for in the past by permanently storingin a hash the results of a given probe plus the results for the adjacent64 code points, under the theory that near-by code points are likely tobe searched for. A separate hash was used for each mention of a Unicodeproperty in each regular expression. Thus, qr/\p{foo}abc\p{foo}/would generate two hashes. Any probes in one instance would be unknownto the other, and the hashes could expand separately to be quite largeif the regular expression were used on many different widely-separatedcode points.Now, however, there is just one hash shared by all instances of a givenproperty. This means that if \p{foo} is matched against "A" in oneregular expression in a thread, the result will be known immediately toall regular expressions, and the relentless march of using up memory isslowed considerably.

  • Version declarations with the use keyword (e.g., use 5.012) are nowfaster, as they enable features without loading feature.pm.

  • local $_ is faster now, as it no longer iterates through magic that itis not going to copy anyway.

  • Perl 5.12.0 sped up the destruction of objects whose classes defineempty DESTROY methods (to prevent autoloading), by simply notcalling such empty methods. This release takes this optimization astep further, by not calling any DESTROY method that begins with areturn statement. This can be useful for destructors that are onlyused for debugging:

    1. use constant DEBUG => 1;
    2. sub DESTROY { return unless DEBUG; ... }

    Constant-folding will reduce the first statement to return; if DEBUGis set to 0, triggering this optimization.

  • Assigning to a variable that holds a typeglob or copy-on-write scalaris now much faster. Previously the typeglob would be stringified orthe copy-on-write scalar would be copied before being clobbered.

  • Assignment to substr in void context is now more than twice itsprevious speed. Instead of creating and returning a special lvaluescalar that is then assigned to, substr modifies the original stringitself.

  • substr no longer calculates a value to return when called in voidcontext.

  • Due to changes in File::Glob, Perl's glob function and its <...> equivalent are now much faster. The splitting of the patterninto words has been rewritten in C, resulting in speed-ups of 20% forsome cases.

    This does not affect glob on VMS, as it does not use File::Glob.

  • The short-circuiting operators &&, ||, and //, when chained(such as $a || $b || $c), are now considerably faster to short-circuit,due to reduced optree traversal.

  • The implementation of s///r makes one fewer copy of the scalar's value.

  • Recursive calls to lvalue subroutines in lvalue scalar context use lessmemory.

Modules and Pragmata

Deprecated Modules

New Modules and Pragmata

  • arybase -- this new module implements the $[ variable.

  • PerlIO::mmap 0.010 has been added to the Perl core.

    The mmap PerlIO layer is no longer implemented by perl itself, but hasbeen moved out into the new PerlIO::mmap module.

Updated Modules and Pragmata

This is only an overview of selected module updates. For a complete list ofupdates, run:

  1. $ corelist --diff 5.14.0 5.16.0

You can substitute your favorite version in place of 5.14.0, too.

  • Archive::Extract has been upgraded from version 0.48 to 0.58.

    Includes a fix for FreeBSD to only use unzip if it is located in/usr/local/bin, as FreeBSD 9.0 will ship with a limited unzip in/usr/bin.

  • Archive::Tar has been upgraded from version 1.76 to 1.82.

    Adjustments to handle files >8gb (>0777777777777 octal) and a featureto return the MD5SUM of files in the archive.

  • base has been upgraded from version 2.16 to 2.18.

    base no longer sets a module's $VERSION to "-1" when a module itloads does not define a $VERSION. This change has been made because"-1" is not a valid version number under the new "lax" criteria usedinternally by UNIVERSAL::VERSION. (See version for more on "lax"version criteria.)

    base no longer internally skips loading modules it has already loadedand instead relies on require to inspect %INC. This fixes a bugwhen base is used with code that clear %INC to force a module tobe reloaded.

  • Carp has been upgraded from version 1.20 to 1.26.

    It now includes last read filehandle info and puts a dot after the fileand line number, just like errors from die [perl #106538].

  • charnames has been updated from version 1.18 to 1.30.

    charnames can now be invoked with a new option, :loose,which is like the existing :full option, but enables Unicode loosename matching. Details are in LOOSE MATCHES in charnames.

  • B::Deparse has been upgraded from version 1.03 to 1.14. This fixesnumerous deparsing bugs.

  • CGI has been upgraded from version 3.52 to 3.59.

    It uses the public and documented FCGI.pm API in CGI::Fast. CGI::Fast wasusing an FCGI API that was deprecated and removed from documentationmore than ten years ago. Usage of this deprecated API with FCGI >=0.70 or FCGI <= 0.73 introduces a security issue.https://rt.cpan.org/Public/Bug/Display.html?id=68380http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-2766

    Things that may break your code:

    url() was fixed to return PATH_INFO when it is explicitly requestedwith either the path=>1 or path_info=>1 flag.

    If your code is running under mod_rewrite (or compatible) and you arecalling self_url() or you are calling url() and passingpath_info=>1, these methods will actually be returningPATH_INFO now, as you have explicitly requested or self_url()has requested on your behalf.

    The PATH_INFO has been omitted in such URLs since the issue wasintroduced in the 3.12 release in December, 2005.

    This bug is so old your application may have come to depend on it orworkaround it. Check for application before upgrading to this release.

    Examples of affected method calls:

    1. $q->url(-absolute => 1, -query => 1, -path_info => 1);
    2. $q->url(-path=>1);
    3. $q->url(-full=>1,-path=>1);
    4. $q->url(-rewrite=>1,-path=>1);
    5. $q->self_url();

    We no longer read from STDIN when the Content-Length is not set,preventing requests with no Content-Length from sometimes freezing.This is consistent with the CGI RFC 3875, and is also consistent withCGI::Simple. However, the old behavior may have been expected by somecommand-line uses of CGI.pm.

    In addition, the DELETE HTTP verb is now supported.

  • Compress::Zlib has been upgraded from version 2.035 to 2.048.

    IO::Compress::Zip and IO::Uncompress::Unzip now have support for LZMA(method 14). There is a fix for a CRC issue in IO::Compress::Unzip andit supports Streamed Stored context now. And fixed a Zip64 issue inIO::Compress::Zip when the content size was exactly 0xFFFFFFFF.

  • Digest::SHA has been upgraded from version 5.61 to 5.71.

    Added BITS mode to the addfile method and shasum. This makespartial-byte inputs possible via files/STDIN and lets shasum checkall 8074 NIST Msg vectors, where previously special programming wasrequired to do this.

  • Encode has been upgraded from version 2.42 to 2.44.

    Missing aliases added, a deep recursion error fixed and variousdocumentation updates.

    Addressed 'decode_xs n-byte heap-overflow' security bug in Unicode.xs(CVE-2011-2939). (5.14.2)

  • ExtUtils::CBuilder updated from version 0.280203 to 0.280206.

    The new version appends CFLAGS and LDFLAGS to their Config.pmcounterparts.

  • ExtUtils::ParseXS has been upgraded from version 2.2210 to 3.16.

    Much of ExtUtils::ParseXS, the module behind the XS compiler xsubpp,was rewritten and cleaned up. It has been made somewhat more extensibleand now finally uses strictures.

    The typemap logic has been moved into a separate module,ExtUtils::Typemaps. See New Modules and Pragmata, above.

    For a complete set of changes, please see the ExtUtils::ParseXSchangelog, available on the CPAN.

  • File::Glob has been upgraded from version 1.12 to 1.17.

    On Windows, tilde (~) expansion now checks the USERPROFILE environmentvariable, after checking HOME.

    It has a new :bsd_glob export tag, intended to replace :glob. Like:glob it overrides glob with a function that does not split the globpattern into words, but, unlike :glob, it iterates properly in scalarcontext, instead of returning the last file.

    There are other changes affecting Perl's own glob operator (which usesFile::Glob internally, except on VMS). See Performance Enhancementsand Selected Bug Fixes.

  • FindBin updated from version 1.50 to 1.51.

    It no longer returns a wrong result if a script of the same name as thecurrent one exists in the path and is executable.

  • HTTP::Tiny has been upgraded from version 0.012 to 0.017.

    Added support for using $ENV{http_proxy} to set the default proxy host.

    Adds additional shorthand methods for all common HTTP verbs,a post_form() method for POST-ing x-www-form-urlencoded data anda www_form_urlencode() utility method.

  • IO has been upgraded from version 1.25_04 to 1.25_06, and IO::Handlefrom version 1.31 to 1.33.

    Together, these upgrades fix a problem with IO::Handle's getline andgetlines methods. When these methods are called on the special ARGVhandle, the next file is automatically opened, as happens with the built-in<> and readline functions. But, unlike the built-ins, thesemethods were not respecting the caller's use of the open pragma andapplying the appropriate I/O layers to the newly-opened file[rt.cpan.org #66474].

  • IPC::Cmd has been upgraded from version 0.70 to 0.76.

    Capturing of command output (both STDOUT and STDERR) is now supportedusing IPC::Open3 on MSWin32 without requiring IPC::Run.

  • IPC::Open3 has been upgraded from version 1.09 to 1.12.

    Fixes a bug which prevented use of open3 on Windows when *STDIN,*STDOUT or *STDERR had been localized.

    Fixes a bug which prevented duplicating numeric file descriptors on Windows.

    open3 with "-" for the program name works once more. This was broken inversion 1.06 (and hence in Perl 5.14.0) [perl #95748].

  • Locale::Codes has been upgraded from version 3.16 to 3.21.

    Added Language Extension codes (langext) and Language Variation codes (langvar)as defined in the IANA language registry.

    Added language codes from ISO 639-5

    Added language/script codes from the IANA language subtag registry

    Fixed an uninitialized value warning [rt.cpan.org #67438].

    Fixed the return value for the all_XXX_codes and all_XXX_names functions[rt.cpan.org #69100].

    Reorganized modules to move Locale::MODULE to Locale::Codes::MODULE to allowfor cleaner future additions. The original four modules (Locale::Language,Locale::Currency, Locale::Country, Locale::Script) will continue to work, butall new sets of codes will be added in the Locale::Codes namespace.

    The code2XXX, XXX2code, all_XXX_codes, and all_XXX_names functions nowsupport retired codes. All codesets may be specified by a constant orby their name now. Previously, they were specified only by a constant.

    The alias_code function exists for backward compatibility. It has beenreplaced by rename_country_code. The alias_code function will beremoved some time after September, 2013.

    All work is now done in the central module (Locale::Codes). Previously,some was still done in the wrapper modules (Locale::Codes::*). AddedLanguage Family codes (langfam) as defined in ISO 639-5.

  • Math::BigFloat has been upgraded from version 1.993 to 1.997.

    The numify method has been corrected to return a normalized Perl number(the result of 0 + $thing), instead of a string [rt.cpan.org #66732].

  • Math::BigInt has been upgraded from version 1.994 to 1.998.

    It provides a new bsgn method that complements the babs method.

    It fixes the internal objectify function's handling of "foreign objects"so they are converted to the appropriate class (Math::BigInt orMath::BigFloat).

  • Math::BigRat has been upgraded from version 0.2602 to 0.2603.

    int() on a Math::BigRat object containing -1/2 now creates aMath::BigInt containing 0, rather than -0. Math::BigInt does not evensupport negative zero, so the resulting object was actually malformed[perl #95530].

  • Math::Complex has been upgraded from version 1.56 to 1.59and Math::Trig from version 1.2 to 1.22.

    Fixes include: correct copy constructor usage; fix polarwise formatting withnumeric format specifier; and more stable great_circle_direction algorithm.

  • Module::CoreList has been upgraded from version 2.51 to 2.66.

    The corelist utility now understands the -r option for displayingPerl release dates and the --diff option to print the set of modlibchanges between two perl distributions.

  • Module::Metadata has been upgraded from version 1.000004 to 1.000009.

    Adds provides method to generate a CPAN META provides data structurecorrectly; use of package_versions_from_directory is discouraged.

  • ODBM_File has been upgraded from version 1.10 to 1.12.

    The XS code is now compiled with PERL_NO_GET_CONTEXT, which will aidperformance under ithreads.

  • open has been upgraded from version 1.08 to 1.10.

    It no longer turns off layers on standard handles when invoked without the":std" directive. Similarly, when invoked with the ":std" directive, itnow clears layers on STDERR before applying the new ones, and not just onSTDIN and STDOUT [perl #92728].

  • overload has been upgraded from version 1.13 to 1.18.

    overload::Overloaded no longer calls can on the class, but usesanother means to determine whether the object has overloading. It wasnever correct for it to call can, as overloading does not respectAUTOLOAD. So classes that autoload methods and implement can no longerhave to account for overloading [perl #40333].

    A warning is now produced for invalid arguments. See New Diagnostics.

  • PerlIO::scalar has been upgraded from version 0.11 to 0.14.

    (This is the module that implements open $fh, '>', \$scalar.)

    It fixes a problem with open my $fh, ">", \$scalar not working if$scalar is a copy-on-write scalar. (5.14.2)

    It also fixes a hang that occurs with readline or <$fh> if atypeglob has been assigned to $scalar [perl #92258].

    It no longer assumes during seek that $scalar is a string internally.If it didn't crash, it was close to doing so [perl #92706]. Also, theinternal print routine no longer assumes that the position set by seekis valid, but extends the string to that position, filling the interveningbytes (between the old length and the seek position) with nulls[perl #78980].

    Printing to an in-memory handle now works if the $scalar holds a reference,stringifying the reference before modifying it. References used to betreated as empty strings.

    Printing to an in-memory handle no longer crashes if the $scalar happens tohold a number internally, but no string buffer.

    Printing to an in-memory handle no longer creates scalars that confusethe regular expression engine [perl #108398].

  • Pod::Functions has been upgraded from version 1.04 to 1.05.

    Functions.pm is now generated at perl build time from annotations inperlfunc.pod. This will ensure that Pod::Functions and perlfuncremain in synchronisation.

  • Pod::Html has been upgraded from version 1.11 to 1.1502.

    This is an extensive rewrite of Pod::Html to use Pod::Simple underthe hood. The output has changed significantly.

  • Pod::Perldoc has been upgraded from version 3.15_03 to 3.17.

    It corrects the search paths on VMS [perl #90640]. (5.14.1)

    The -v option now fetches the right section for $0.

    This upgrade has numerous significant fixes. Consult its changelog onthe CPAN for more information.

  • POSIX has been upgraded from version 1.24 to 1.30.

    POSIX no longer uses AutoLoader. Any code which was relying on thisimplementation detail was buggy, and may fail because of this change.The module's Perl code has been considerably simplified, roughly halvingthe number of lines, with no change in functionality. The XS code hasbeen refactored to reduce the size of the shared object by about 12%,with no change in functionality. More POSIX functions now have tests.

    sigsuspend and pause now run signal handlers before returning, as thewhole point of these two functions is to wait until a signal hasarrived, and then return after it has been triggered. Delayed, or"safe", signals were preventing that from happening, possibly resulting inrace conditions [perl #107216].

    POSIX::sleep is now a direct call into the underlying OS sleepfunction, instead of being a Perl wrapper on CORE::sleep.POSIX::dup2 now returns the correct value on Win32 (i.e., the filedescriptor). POSIX::SigSet sigsuspend and sigpending andPOSIX::pause now dispatch safe signals immediately before returning totheir caller.

    POSIX::Termios::setattr now defaults the third argument to TCSANOW,instead of 0. On most platforms TCSANOW is defined to be 0, but on some0 is not a valid parameter, which caused a call with defaults to fail.

  • Socket has been upgraded from version 1.94 to 2.001.

    It has new functions and constants for handling IPv6 sockets:

    1. pack_ipv6_mreq
    2. unpack_ipv6_mreq
    3. IPV6_ADD_MEMBERSHIP
    4. IPV6_DROP_MEMBERSHIP
    5. IPV6_MTU
    6. IPV6_MTU_DISCOVER
    7. IPV6_MULTICAST_HOPS
    8. IPV6_MULTICAST_IF
    9. IPV6_MULTICAST_LOOP
    10. IPV6_UNICAST_HOPS
    11. IPV6_V6ONLY
  • Storable has been upgraded from version 2.27 to 2.34.

    It no longer turns copy-on-write scalars into read-only scalars whenfreezing and thawing.

  • Sys::Syslog has been upgraded from version 0.27 to 0.29.

    This upgrade closes many outstanding bugs.

  • Term::ANSIColor has been upgraded from version 3.00 to 3.01.

    Only interpret an initial array reference as a list of colors, not any initialreference, allowing the colored function to work properly on objects withstringification defined.

  • Term::ReadLine has been upgraded from version 1.07 to 1.09.

    Term::ReadLine now supports any event loop, including unpublished ones andsimple IO::Select, loops without the need to rewrite existing code forany particular framework [perl #108470].

  • threads::shared has been upgraded from version 1.37 to 1.40.

    Destructors on shared objects used to be ignored sometimes if the objectswere referenced only by shared data structures. This has been mostlyfixed, but destructors may still be ignored if the objects still exist atglobal destruction time [perl #98204].

  • Unicode::Collate has been upgraded from version 0.73 to 0.89.

    Updated to CLDR 1.9.1

    Locales updated to CLDR 2.0: mk, mt, nb, nn, ro, ru, sk, sr, sv, uk,zh__pinyin, zh__stroke

    Newly supported locales: bn, fa, ml, mr, or, pa, sa, si, si__dictionary,sr_Latn, sv__reformed, ta, te, th, ur, wae.

    Tailored compatibility ideographs as well as unified ideographs for thelocales: ja, ko, zh__big5han, zh__gb2312han, zh__pinyin, zh__stroke.

    Locale/*.pl files are now searched for in @INC.

  • Unicode::Normalize has been upgraded from version 1.10 to 1.14.

    Fixes for the removal of unicore/CompositionExclusions.txt from core.

  • Unicode::UCD has been upgraded from version 0.32 to 0.43.

    This adds four new functions: prop_aliases() andprop_value_aliases(), which are used to find all Unicode-approvedsynonyms for property names, or to convert from one name to another;prop_invlist which returns all code points matching a givenUnicode binary property; and prop_invmap which returns the completespecification of a given Unicode property.

  • Win32API::File has been upgraded from version 0.1101 to 0.1200.

    Added SetStdHandle and GetStdHandle functions

Removed Modules and Pragmata

As promised in Perl 5.14.0's release notes, the following modules havebeen removed from the core distribution, and if needed should be installedfrom CPAN instead.

  • Devel::DProf has been removed from the Perl core. Prior version was20110228.00.

  • Shell has been removed from the Perl core. Prior version was 0.72_01.

  • Several old perl4-style libraries which have been deprecated with 5.14are now removed:

    1. abbrev.pl assert.pl bigfloat.pl bigint.pl bigrat.pl cacheout.pl
    2. complete.pl ctime.pl dotsh.pl exceptions.pl fastcwd.pl flush.pl
    3. getcwd.pl getopt.pl getopts.pl hostname.pl importenv.pl
    4. lib/find{,depth}.pl look.pl newgetopt.pl open2.pl open3.pl
    5. pwd.pl shellwords.pl stat.pl tainted.pl termcap.pl timelocal.pl

    They can be found on CPAN as Perl4::CoreLibs.

Documentation

New Documentation

perldtrace

perldtrace describes Perl's DTrace support, listing the provided probesand gives examples of their use.

perlexperiment

This document is intended to provide a list of experimental features inPerl. It is still a work in progress.

perlootut

This a new OO tutorial. It focuses on basic OO concepts, and then recommendsthat readers choose an OO framework from CPAN.

perlxstypemap

The new manual describes the XS typemapping mechanism in unprecedenteddetail and combines new documentation with information extracted fromperlxs and the previously unofficial list of all core typemaps.

Changes to Existing Documentation

perlapi

  • The HV API has long accepted negative lengths to show that the key isin UTF8. This is now documented.

  • The boolSV() macro is now documented.

perlfunc

  • dbmopen treats a 0 mode as a special case, that prevents a nonexistentfile from being created. This has been the case since Perl 5.000, but wasnever documented anywhere. Now the perlfunc entry mentions it[perl #90064].

  • As an accident of history, open $fh, '<:', ... applies the defaultlayers for the platform (:raw on Unix, :crlf on Windows), ignoringwhatever is declared by open.pm. This seems such a useful featureit has been documented in open and open.

  • The entry for split has been rewritten. It is now far clearer thanbefore.

perlguts

  • A new section, Autoloading with XSUBs,has been added, which explains the two APIs for accessing the name of theautoloaded sub.

  • Some function descriptions in perlguts were confusing, as it wasnot clear whether they referred to the function above or below thedescription. This has been clarified [perl #91790].

perlobj

  • This document has been rewritten from scratch, and its coverage of various OOconcepts has been expanded.

perlop

  • Documentation of the smartmatch operator has been reworked and moved fromperlsyn to perlop where it belongs.

    It has also been corrected for the case of undef on the left-handside. The list of different smart match behaviors had an item in thewrong place.

  • Documentation of the ellipsis statement (...) has been reworked andmoved from perlop to perlsyn.

  • The explanation of bitwise operators has been expanded to explain how theywork on Unicode strings (5.14.1).

  • More examples for m//g have been added (5.14.1).

  • The <<\FOO here-doc syntax has been documented (5.14.1).

perlpragma

  • There is now a standard convention for naming keys in the %^H,documented under Key naming.

Laundering and Detecting Tainted Data in perlsec

  • The example function for checking for taintedness contained a subtleerror. $@ needs to be localized to prevent its changing thisglobal's value outside the function. The preferred method to check forthis remains tainted in Scalar::Util.

perllol

  • perllol has been expanded with examples using the new push $scalarsyntax introduced in Perl 5.14.0 (5.14.1).

perlmod

  • perlmod now states explicitly that some types of explicit symbol tablemanipulation are not supported. This codifies what was effectively alreadythe case [perl #78074].

perlpodstyle

  • The tips on which formatting codes to use have been corrected and greatlyexpanded.

  • There are now a couple of example one-liners for previewing POD files afterthey have been edited.

perlre

perlrun

  • perlrun has undergone a significant clean-up. Most notably, the-0x... form of the -0 flag has been clarified, and the final sectionon environment variables has been corrected and expanded (5.14.1).

perlsub

  • The ($;) prototype syntax, which has existed for rather a long time, is nowdocumented in perlsub. It lets a unary function have the sameprecedence as a list operator.

perltie

  • The required syntax for tying handles has been documented.

perlvar

  • The documentation for $! has been corrected and clarified.It used to state that $! could be undef, which is not the case. It wasalso unclear whether system calls set C's errno or Perl's $![perl #91614].

  • Documentation for $$ has been amended with additionalcautions regarding changing the process ID.

Other Changes

  • perlxs was extended with documentation on inline typemaps.

  • perlref has a new Circular Referencessection explaining how circularities may not be freed and how to solve thatwith weak references.

  • Parts of perlapi were clarified, and Perl equivalents of some Cfunctions have been added as an additional mode of exposition.

  • A few parts of perlre and perlrecharclass were clarified.

Removed Documentation

Old OO Documentation

The old OO tutorials, perltoot, perltooc, and perlboot, have beenremoved. The perlbot (bag of object tricks) document has been removedas well.

Development Deltas

The perldelta files for development releases are no longer packaged withperl. These can still be found in the perl source code repository.

Diagnostics

The following additions or changes have been made to diagnostic output,including warnings and fatal error messages. For the complete list ofdiagnostic messages, see perldiag.

New Diagnostics

New Errors

New Warnings

Removed Errors

  • "sort is now a reserved word"

    This error used to occur when sort was called without arguments,followed by ; or ). (E.g., sort; would die, but {sort} wasOK.) This error message was added in Perl 3 to catch code likeclose(sort) which would no longer work. More than two decades later,this message is no longer appropriate. Now sort without arguments isalways allowed, and returns an empty list, as it did in those caseswhere it was already allowed [perl #90030].

Changes to Existing Diagnostics

  • The "Applying pattern match..." or similar warning produced when anarray or hash is on the left-hand side of the =~ operator nowmentions the name of the variable.

  • The "Attempt to free non-existent shared string" has had the spellingof "non-existent" corrected to "nonexistent". It was already listedwith the correct spelling in perldiag.

  • The error messages for using default and when outside atopicalizer have been standardized to match the messages for continueand loop controls. They now read 'Can't "default" outside atopicalizer' and 'Can't "when" outside a topicalizer'. They both usedto be 'Can't use when() outside a topicalizer' [perl #91514].

  • The message, "Code point 0x%X is not Unicode, no properties match it;all inverse properties do" has been changed to "Code point 0x%X is notUnicode, all \p{} matches fail; all \P{} matches succeed".

  • Redefinition warnings for constant subroutines used to be mandatory,even occurring under no warnings. Now they respect the warningspragma.

  • The "glob failed" warning message is now suppressible via no warnings[perl #111656].

  • The Invalid version formaterror message now says "negative version number" within the parentheses,rather than "non-numeric data", for negative numbers.

  • The two warningsPossible attempt to put comments in qw() listandPossible attempt to separate words with commasare no longer mutually exclusive: the same qw construct may produceboth.

  • The uninitialized warning for y///r when $_ is implicit andundefined now mentions the variable name, just like the non-/r variationof the operator.

  • The 'Use of "foo" without parentheses is ambiguous' warning has beenextended to apply also to user-defined subroutines with a (;$)prototype, and not just to built-in functions.

  • Warnings that mention the names of lexical (my) variables withUnicode characters in them now respect the presence or absence of the:utf8 layer on the output handle, instead of outputting UTF8regardless. Also, the correct names are included in the strings passedto $SIG{__WARN__} handlers, rather than the raw UTF8 bytes.

Utility Changes

h2ph

  • h2ph used to generate code of the form

    1. unless(defined(&FOO)) {
    2. sub FOO () {42;}
    3. }

    But the subroutine is a compile-time declaration, and is hence unaffectedby the condition. It has now been corrected to emit a string evalaround the subroutine [perl #99368].

splain

  • splain no longer emits backtraces with the first line number repeated.

    This:

    1. Uncaught exception from user code:
    2. Cannot fwiddle the fwuddle at -e line 1.
    3. at -e line 1
    4. main::baz() called at -e line 1
    5. main::bar() called at -e line 1
    6. main::foo() called at -e line 1

    has become this:

    1. Uncaught exception from user code:
    2. Cannot fwiddle the fwuddle at -e line 1.
    3. main::baz() called at -e line 1
    4. main::bar() called at -e line 1
    5. main::foo() called at -e line 1
  • Some error messages consist of multiple lines that are listed as separateentries in perldiag. splain has been taught to find the separateentries in these cases, instead of simply failing to find the message.

zipdetails

  • This is a new utility, included as part of anIO::Compress::Base upgrade.

    zipdetails displays information about the internal record structureof the zip file. It is not concerned with displaying any details ofthe compressed data stored in the zip file.

Configuration and Compilation

  • regexp.h has been modified for compatibility with GCC's -Werroroption, as used by some projects that include perl's header files (5.14.1).

  • USE_LOCALE{,_COLLATE,_CTYPE,_NUMERIC} have been added the output of perl -Vas they have affect the behavior of the interpreter binary (albeitin only a small area).

  • The code and tests for IPC::Open2 have been moved from ext/IPC-Open2into ext/IPC-Open3, as IPC::Open2::open2() is implemented as a thinwrapper around IPC::Open3::_open3(), and hence is very tightly coupled toit.

  • The magic types and magic vtables are now generated from data in a new scriptregen/mg_vtable.pl, instead of being maintained by hand. As differentEBCDIC variants can't agree on the code point for '~', the character to codepoint conversion is done at build time by generate_uudmap to a new generatedheader mg_data.h. PL_vtbl_bm and PL_vtbl_fm are now defined by thepre-processor as PL_vtbl_regexp, instead of being distinct C variables.PL_vtbl_sig has been removed.

  • Building with -DPERL_GLOBAL_STRUCT works again. This configuration is notgenerally used.

  • Perl configured with MAD now correctly frees MADPROP structures whenOPs are freed. MADPROPs are now allocated with PerlMemShared_malloc()

  • makedef.pl has been refactored. This should have no noticeable affect onany of the platforms that use it as part of their build (AIX, VMS, Win32).

  • useperlio can no longer be disabled.

  • The file global.sym is no longer needed, and has been removed. Itcontained a list of all exported functions, one of the files generated byregen/embed.pl from data in embed.fnc and regen/opcodes. The codehas been refactored so that the only user of global.sym, makedef.pl,now reads embed.fnc and regen/opcodes directly, removing the need tostore the list of exported functions in an intermediate file.

    As global.sym was never installed, this change should not be visibleoutside the build process.

  • pod/buildtoc, used by the build process to build perltoc, has beenrefactored and simplified. It now contains only code to build perltoc;the code to regenerate Makefiles has been moved to Porting/pod_rules.pl.It's a bug if this change has any material effect on the build process.

  • pod/roffitall is now built by pod/buildtoc, instead of beingshipped with the distribution. Its list of manpages is now generated(and therefore current). See also RT #103202 for an unresolved relatedissue.

  • The man page for XS::Typemap is no longer installed. XS::Typemapis a test module which is not installed, hence installing itsdocumentation makes no sense.

  • The -Dusesitecustomize and -Duserelocatableinc options now worktogether properly.

Platform Support

Platform-Specific Notes

Cygwin

  • Since version 1.7, Cygwin supports native UTF-8 paths. If Perl is builtunder that environment, directory and filenames will be UTF-8 encoded.

  • Cygwin does not initialize all original Win32 environment variables. SeeREADME.cygwin for a discussion of the newly-addedCygwin::sync_winenv() function [perl #110190] and forfurther links.

HP-UX

  • HP-UX PA-RISC/64 now supports gcc-4.x

    A fix to correct the socketsize now makes the test suite pass on HP-UXPA-RISC for 64bitall builds. (5.14.2)

VMS

  • Remove unnecessary includes, fix miscellaneous compiler warnings andclose some unclosed comments on vms/vms.c.

  • Remove sockadapt layer from the VMS build.

  • Explicit support for VMS versions before v7.0 and DEC C versionsbefore v6.0 has been removed.

  • Since Perl 5.10.1, the home-grown stat wrapper has been unable todistinguish between a directory name containing an underscore and anotherwise-identical filename containing a dot in the same position(e.g., t/test_pl as a directory and t/test.pl as a file). This problemhas been corrected.

  • The build on VMS now permits names of the resulting symbols in C code forPerl longer than 31 characters. Symbols likePerl__it_was_the_best_of_times_it_was_the_worst_of_times can now becreated freely without causing the VMS linker to seize up.

GNU/Hurd

  • Numerous build and test failures on GNU/Hurd have been resolved with hintsfor building DBM modules, detection of the library search path, and enablingof large file support.

OpenVOS

  • Perl is now built with dynamic linking on OpenVOS, the minimum supportedversion of which is now Release 17.1.0.

SunOS

The CC workshop C++ compiler is now detected and used on systems that shipwithout cc.

Internal Changes

  • The compiled representation of formats is now stored via the mg_ptr oftheir PERL_MAGIC_fm. Previously it was stored in the string buffer,beyond SvLEN(), the regular end of the string. SvCOMPILED() andSvCOMPILED_{on,off}() now exist solely for compatibility for XS code.The first is always 0, the other two now no-ops. (5.14.1)

  • Some global variables have been marked const, members in the interpreterstructure have been re-ordered, and the opcodes have been re-ordered. Theop OP_AELEMFAST has been split into OP_AELEMFAST and OP_AELEMFAST_LEX.

  • When empting a hash of its elements (e.g., via undef(%h), or %h=()), HvARRAYfield is no longer temporarily zeroed. Any destructors called on the freedelements see the remaining elements. Thus, %h=() becomes more likedelete $h{$_} for keys %h.

  • Boyer-Moore compiled scalars are now PVMGs, and the Boyer-Moore tables are nowstored via the mg_ptr of their PERL_MAGIC_bm.Previously they were PVGVs, with the tables stored inthe string buffer, beyond SvLEN(). This eliminatesthe last place where the core stores data beyond SvLEN().

  • Simplified logic in Perl_sv_magic() introduces a small change ofbehavior for error cases involving unknown magic types. Previously, ifPerl_sv_magic() was passed a magic type unknown to it, it would

    1.

    Croak "Modification of a read-only value attempted" if read only

    2.

    Return without error if the SV happened to already have this magic

    3.

    otherwise croak "Don't know how to handle magic of type \%o"

    Now it will always croak "Don't know how to handle magic of type \%o", evenon read-only values, or SVs which already have the unknown magic type.

  • The experimental fetch_cop_label function has been renamed tocop_fetch_label.

  • The cop_store_label function has been added to the API, but isexperimental.

  • embedvar.h has been simplified, and one level of macro indirection forPL_* variables has been removed for the default (non-multiplicity)configuration. PERLVAR*() macros now directly expand their arguments totokens such as PL_defgv, instead of expanding to PL_Idefgv, withembedvar.h defining a macro to map PL_Idefgv to PL_defgv. XS codewhich has unwarranted chumminess with the implementation may need updating.

  • An API has been added to explicitly choose whether to export XSUBsymbols. More detail can be found in the comments for commit e64345f8.

  • The is_gv_magical_sv function has been eliminated and merged withgv_fetchpvn_flags. It used to be called to determine whether a GVshould be autovivified in rvalue context. Now it has been replaced with anew GV_ADDMG flag (not part of the API).

  • The returned code point from the function utf8n_to_uvuni()when the input is malformed UTF-8, malformations are allowed, andutf8 warnings are off is now the Unicode REPLACEMENT CHARACTERwhenever the malformation is such that no well-defined code point can becomputed. Previously the returned value was essentially garbage. Theonly malformations that have well-defined values are a zero-lengthstring (0 is the return), and overlong UTF-8 sequences.

  • Padlists are now marked AvREAL; i.e., reference-counted. They havealways been reference-counted, but were not marked real, because pad.cdid its own clean-up, instead of using the usual clean-up code in sv.c.That caused problems in thread cloning, so now the AvREAL flag is on,but is turned off in pad.c right before the padlist is freed (afterpad.c has done its custom freeing of the pads).

  • All C files that make up the Perl core have been converted to UTF-8.

  • These new functions have been added as part of the work on Unicode symbols:

    1. HvNAMELEN
    2. HvNAMEUTF8
    3. HvENAMELEN
    4. HvENAMEUTF8
    5. gv_init_pv
    6. gv_init_pvn
    7. gv_init_pvsv
    8. gv_fetchmeth_pv
    9. gv_fetchmeth_pvn
    10. gv_fetchmeth_sv
    11. gv_fetchmeth_pv_autoload
    12. gv_fetchmeth_pvn_autoload
    13. gv_fetchmeth_sv_autoload
    14. gv_fetchmethod_pv_flags
    15. gv_fetchmethod_pvn_flags
    16. gv_fetchmethod_sv_flags
    17. gv_autoload_pv
    18. gv_autoload_pvn
    19. gv_autoload_sv
    20. newGVgen_flags
    21. sv_derived_from_pv
    22. sv_derived_from_pvn
    23. sv_derived_from_sv
    24. sv_does_pv
    25. sv_does_pvn
    26. sv_does_sv
    27. whichsig_pv
    28. whichsig_pvn
    29. whichsig_sv
    30. newCONSTSUB_flags

    The gv_fetchmethod_*_flags functions, like gv_fetchmethod_flags, areexperimental and may change in a future release.

  • The following functions were added. These are not part of the API:

    1. GvNAMEUTF8
    2. GvENAMELEN
    3. GvENAME_HEK
    4. CopSTASH_flags
    5. CopSTASH_flags_set
    6. PmopSTASH_flags
    7. PmopSTASH_flags_set
    8. sv_sethek
    9. HEKfARG

    There is also a HEKf macro corresponding to SVf, forinterpolating HEKs in formatted strings.

  • sv_catpvn_flags takes a couple of new internal-only flags,SV_CATBYTES and SV_CATUTF8, which tell it whether the char array tobe concatenated is UTF8. This allows for more efficient concatenation thancreating temporary SVs to pass to sv_catsv.

  • For XS AUTOLOAD subs, $AUTOLOAD is set once more, as it was in 5.6.0. Thisis in addition to setting SvPVX(cv), for compatibility with 5.8 to 5.14.See Autoloading with XSUBs in perlguts.

  • Perl now checks whether the array (the linearized isa) returned by a MROplugin begins with the name of the class itself, for which the array wascreated, instead of assuming that it does. This prevents the first elementfrom being skipped during method lookup. It also means thatmro::get_linear_isa may return an array with one more element than theMRO plugin provided [perl #94306].

  • PL_curstash is now reference-counted.

  • There are now feature bundle hints in PL_hints ($^H) that versiondeclarations use, to avoid having to load feature.pm. One setting ofthe hint bits indicates a "custom" feature bundle, which means that theentries in %^H still apply. feature.pm uses that.

    The HINT_FEATURE_MASK macro is defined in perl.h along with otherhints. Other macros for setting and testing features and bundles are inthe new feature.h. FEATURE_IS_ENABLED (which has moved tofeature.h) is no longer used throughout the codebase, but more specificmacros, e.g., FEATURE_SAY_IS_ENABLED, that are defined in feature.h.

  • lib/feature.pm is now a generated file, created by the newregen/feature.pl script, which also generates feature.h.

  • Tied arrays are now always AvREAL. If @_ or DB::args is tied, itis reified first, to make sure this is always the case.

  • Two new functions utf8_to_uvchr_buf() and utf8_to_uvuni_buf() havebeen added. These are the same as utf8_to_uvchr andutf8_to_uvuni (which are now deprecated), but take an extra parameterthat is used to guard against reading beyond the end of the inputstring.See utf8_to_uvchr_buf in perlapi and utf8_to_uvuni_buf in perlapi.

  • The regular expression engine now does TRIE case insensitive matchesunder Unicode. This may change the output of use re 'debug';,and will speed up various things.

  • There is a new wrap_op_checker() function, which provides a thread-safealternative to writing to PL_check directly.

Selected Bug Fixes

Array and hash

  • A bug has been fixed that would cause a "Use of freed value in iteration"error if the next two hash elements that would be iterated over aredeleted [perl #85026]. (5.14.1)

  • Deleting the current hash iterator (the hash element that would be returnedby the next call to each) in void context used not to free it[perl #85026].

  • Deletion of methods via delete $Class::{method} syntax used to updatemethod caches if called in void context, but not scalar or list context.

  • When hash elements are deleted in void context, the internal hash entry isnow freed before the value is freed, to prevent destructors called by thatlatter freeing from seeing the hash in an inconsistent state. It waspossible to cause double-frees if the destructor freed the hash itself[perl #100340].

  • A keys optimization in Perl 5.12.0 to make it faster on empty hashescaused each not to reset the iterator if called after the last elementwas deleted.

  • Freeing deeply nested hashes no longer crashes [perl #44225].

  • It is possible from XS code to create hashes with elements that have novalues. The hash element and slice operators used to crashwhen handling these in lvalue context. They nowproduce a "Modification of non-creatable hash value attempted" errormessage.

  • If list assignment to a hash or array triggered destructors that freed thehash or array itself, a crash would ensue. This is no longer the case[perl #107440].

  • It used to be possible to free the typeglob of a localized array or hash(e.g., local @{"x"}; delete $::{x}), resulting in a crash on scope exit.

  • Some core bugs affecting Hash::Util have been fixed: locking a hashelement that is a glob copy no longer causes the next assignment to it tocorrupt the glob (5.14.2), and unlocking a hash element that holds acopy-on-write scalar no longer causes modifications to that scalar tomodify other scalars that were sharing the same string buffer.

C API fixes

  • The newHVhv XS function now works on tied hashes, instead of crashing orreturning an empty hash.

  • The SvIsCOW C macro now returns false for read-only copies of typeglobs,such as those created by:

    1. $hash{elem} = *foo;
    2. Hash::Util::lock_value %hash, 'elem';

    It used to return true.

  • The SvPVutf8 C function no longer tries to modify its argument,resulting in errors [perl #108994].

  • SvPVutf8 now works properly with magical variables.

  • SvPVbyte now works properly non-PVs.

  • When presented with malformed UTF-8 input, the XS-callable functionsis_utf8_string(), is_utf8_string_loc(), andis_utf8_string_loclen() could read beyond the end of the inputstring by up to 12 bytes. This no longer happens. [perl #32080].However, currently, is_utf8_char() still has this defect, seeis_utf8_char() above.

  • The C-level pregcomp function could become confused about whether thepattern was in UTF8 if the pattern was an overloaded, tied, or otherwisemagical scalar [perl #101940].

Compile-time hints

  • Tying %^H no longer causes perl to crash or ignore the contents of%^H when entering a compilation scope [perl #106282].

  • eval $string and require used not tolocalize %^H during compilation if itwas empty at the time the eval call itself was compiled. This couldlead to scary side effects, like use re "/m" enabling other flags thatthe surrounding code was trying to enable for its caller [perl #68750].

  • eval $string and require no longer localize hints ($^H and %^H)at run time, but only during compilation of the $string or required file.This makes BEGIN { $^H{foo}=7 } equivalent toBEGIN { eval '$^H{foo}=7' } [perl #70151].

  • Creating a BEGIN block from XS code (via newXS or newATTRSUB) would,on completion, make the hints of the current compiling code the currenthints. This could cause warnings to occur in a non-warning scope.

Copy-on-write scalars

Copy-on-write or shared hash key scalarswere introduced in 5.8.0, but most Perl codedid not encounter them (they were used mostly internally). Perl5.10.0 extended them, such that assigning __PACKAGE__ or ahash key to a scalar would make it copy-on-write. Several partsof Perl were not updated to account for them, but have now been fixed.

  • utf8::decode had a nasty bug that would modify copy-on-write scalars'string buffers in place (i.e., skipping the copy). This could result inhashes having two elements with the same key [perl #91834]. (5.14.2)

  • Lvalue subroutines were not allowing COW scalars to be returned. This wasfixed for lvalue scalar context in Perl 5.12.3 and 5.14.0, but list contextwas not fixed until this release.

  • Elements of restricted hashes (see the fields pragma) containingcopy-on-write values couldn't be deleted, nor could such hashes be cleared(%hash = ()). (5.14.2)

  • Localizing a tied variable used to make it read-only if it contained acopy-on-write string. (5.14.2)

  • Assigning a copy-on-write string to a stashelement no longer causes a double free. Regardless of this change, theresults of such assignments are still undefined.

  • Assigning a copy-on-write string to a tied variable no longer stops thatvariable from being tied if it happens to be a PVMG or PVLV internally.

  • Doing a substitution on a tied variable returning a copy-on-writescalar used to cause an assertion failure or an "Attempt to freenonexistent shared string" warning.

  • This one is a regression from 5.12: In 5.14.0, the bitwise assignmentoperators |=, ^= and &= started leaving the left-hand sideundefined if it happened to be a copy-on-write string [perl #108480].

  • Storable, Devel::Peek and PerlIO::scalar had similar problems.See Updated Modules and Pragmata, above.

The debugger

  • dumpvar.pl, and therefore the x command in the debugger, have beenfixed to handle objects blessed into classes whose names contain "=". Thecontents of such objects used not to be dumped [perl #101814].

  • The "R" command for restarting a debugger session has been fixed to work onWindows, or any other system lacking a POSIX::_SC_OPEN_MAX constant[perl #87740].

  • The #line 42 foo directive used not to update the arrays of lines usedby the debugger if it occurred in a string eval. This was partially fixedin 5.14, but it worked only for a single #line 42 foo in each eval. Nowit works for multiple.

  • When subroutine calls are intercepted by the debugger, the name of thesubroutine or a reference to it is stored in $DB::sub, for the debuggerto access. Sometimes (such as $foo = *bar; undef *bar; &$foo)$DB::sub would be set to a name that could not be used to find thesubroutine, and so the debugger's attempt to call it would fail. Now thecheck to see whether a reference is needed is more robust, so thoseproblems should not happen anymore [rt.cpan.org #69862].

  • Every subroutine has a filename associated with it that the debugger uses.The one associated with constant subroutines used to be misallocated whencloned under threads. Consequently, debugging threaded applications couldresult in memory corruption [perl #96126].

Dereferencing operators

  • defined(${"..."}), defined(*{"..."}), etc., used toreturn true for most, but not all built-in variables, ifthey had not been used yet. This bug affected ${^GLOBAL_PHASE} and${^UTF8CACHE}, among others. It also used to return false if thepackage name was given as well (${"::!"}) [perl #97978, #97492].

  • Perl 5.10.0 introduced a similar bug: defined(*{"foo"}) where "foo"represents the name of a built-in global variable used to return false ifthe variable had never been used before, but only on the first call.This, too, has been fixed.

  • Since 5.6.0, *{ ... } has been inconsistent in how it treats undefinedvalues. It would die in strict mode or lvalue context for most undefinedvalues, but would be treated as the empty string (with a warning) for thespecific scalar return by undef() (&PL_sv_undef internally). Thishas been corrected. undef() is now treated like other undefinedscalars, as in Perl 5.005.

Filehandle, last-accessed

Perl has an internal variable that stores the last filehandle to beaccessed. It is used by $. and by tell and eof withoutarguments.

  • It used to be possible to set this internal variable to a glob copy andthen modify that glob copy to be something other than a glob, and stillhave the last-accessed filehandle associated with the variable afterassigning a glob to it again:

    1. my $foo = *STDOUT; # $foo is a glob copy
    2. <$foo>; # $foo is now the last-accessed handle
    3. $foo = 3; # no longer a glob
    4. $foo = *STDERR; # still the last-accessed handle

    Now the $foo = 3 assignment unsets that internal variable, so thereis no last-accessed filehandle, just as if <$foo> had neverhappened.

    This also prevents some unrelated handle from becoming the last-accessedhandle if $foo falls out of scope and the same internal SV gets used foranother handle [perl #97988].

  • A regression in 5.14 caused these statements not to set that internalvariable:

    1. my $fh = *STDOUT;
    2. tell $fh;
    3. eof $fh;
    4. seek $fh, 0,0;
    5. tell *$fh;
    6. eof *$fh;
    7. seek *$fh, 0,0;
    8. readline *$fh;

    This is now fixed, but tell *{ *$fh } still has the problem, and itis not clear how to fix it [perl #106536].

Filetests and stat

The term "filetests" refers to the operators that consist of a hyphenfollowed by a single letter: -r, -x, -M, etc. The term "stacked"when applied to filetests means followed by another filetest operatorsharing the same operand, as in -r -x -w $fooo.

  • stat produces more consistent warnings. It no longer warns for "_"[perl #71002] and no longer skips the warning at times for other unopenedhandles. It no longer warns about an unopened handle when the operatingsystem's fstat function fails.

  • stat would sometimes return negative numbers for large inode numbers,because it was using the wrong internal C type. [perl #84590]

  • lstat is documented to fall back to stat (with a warning) when givena filehandle. When passed an IO reference, it was actually doing theequivalent of stat _ and ignoring the handle.

  • -T _ with no preceding stat used to produce aconfusing "uninitialized" warning, even though thereis no visible uninitialized value to speak of.

  • -T, -B, -l and -t now workwhen stacked with other filetest operators[perl #77388].

  • In 5.14.0, filetest ops (-r, -x, etc.) started calling FETCH on atied argument belonging to the previous argument to a list operator, ifcalled with a bareword argument or no argument at all. This has beenfixed, so push @foo, $tied, -r no longer calls FETCH on $tied.

  • In Perl 5.6, -l followed by anything other than a bareword would treatits argument as a file name. That was changed in 5.8 for glob references(\*foo), but not for globs themselves (*foo). -l startedreturning undef for glob references without setting the laststat buffer that the "_" handle uses, but only if warningswere turned on. With warnings off, it was the same as 5.6.In other words, it was simply buggy and inconsistent. Now the 5.6behavior has been restored.

  • -l followed by a bareword no longer "eats" the previous argument tothe list operator in whose argument list it resides. Hence,print "bar", -l foo now actually prints "bar", because -lon longer eats it.

  • Perl keeps several internal variables to keep track of the last statbuffer, from which file(handle) it originated, what type it was, andwhether the last stat succeeded.

    There were various cases where these could get out of synch, resulting ininconsistent or erratic behavior in edge cases (every mention of -Tapplies to -B as well):

    • -T HANDLE, even though it does a stat, was not resetting the laststat type, so an lstat _ following it would merrily return the wrongresults. Also, it was not setting the success status.

    • Freeing the handle last used by stat or a filetest could result in-T _ using an unrelated handle.

    • stat with an IO reference would not reset the stat type or record thefilehandle for -T _ to use.

    • Fatal warnings could cause the stat buffer not to be resetfor a filetest operator on an unopened filehandle or -l on any handle.Fatal warnings also stopped -T from setting $!.

    • When the last stat was on an unreadable file, -T _ is supposed toreturn undef, leaving the last stat buffer unchanged. But it wassetting the stat type, causing lstat _ to stop working.

    • -T FILENAME was not resetting the internal stat buffers forunreadable files.

    These have all been fixed.

Formats

  • Several edge cases have been fixed with formats and formline;in particular, where the format itself is potentially variable (such aswith ties and overloading), and where the format and data differ in theirencoding. In both these cases, it used to possible for the output to becorrupted [perl #91032].

  • formline no longer converts its argument into a string in-place. Sopassing a reference to formline no longer destroys the reference[perl #79532].

  • Assignment to $^A (the format output accumulator) now recalculatesthe number of lines output.

given and when

  • given was not scoping its implicit $_ properly, resulting in memoryleaks or "Variable is not available" warnings [perl #94682].

  • given was not calling set-magic on the implicit lexical $_ that ituses. This meant, for example, that pos would be remembered from oneexecution of the same given block to the next, even if the input were adifferent variable [perl #84526].

  • when blocks are now capable of returning variables declared inside theenclosing given block [perl #93548].

The glob operator

  • On OSes other than VMS, Perl's glob operator (and the <...> form)use File::Glob underneath. File::Glob splits the pattern into words,before feeding each word to its bsd_glob function.

    There were several inconsistencies in the way the split was done. Nowquotation marks (' and ") are always treated as shell-style word delimiters(that allow whitespace as part of a word) and backslashes are alwayspreserved, unless they exist to escape quotation marks. Before, thosewould only sometimes be the case, depending on whether the patterncontained whitespace. Also, escaped whitespace at the end of the patternis no longer stripped [perl #40470].

  • CORE::glob now works as a way to call the default globbing function. Itused to respect overrides, despite the CORE:: prefix.

  • Under miniperl (used to configure modules when perl itself is built),glob now clears %ENV before calling csh, since the latter croaks on somesystems if it does not like the contents of the LS_COLORS environmentvariable [perl #98662].

Lvalue subroutines

  • Explicit return now returns the actual argument passed to return, insteadof copying it [perl #72724, #72706].

  • Lvalue subroutines used to enforce lvalue syntax (i.e., whatever can go onthe left-hand side of =) for the last statement and the arguments toreturn. Since lvalue subroutines are not always called in lvalue context,this restriction has been lifted.

  • Lvalue subroutines are less restrictive about what values can be returned.It used to croak on values returned by shift and delete and fromother subroutines, but no longer does so [perl #71172].

  • Empty lvalue subroutines (sub :lvalue {}) used to return @_ in listcontext. All subroutines used to do this, but regular subs were fixed inPerl 5.8.2. Now lvalue subroutines have been likewise fixed.

  • Autovivification now works on values returned from lvalue subroutines[perl #7946], as does returning keys in lvalue context.

  • Lvalue subroutines used to copy their return values in rvalue context. Notonly was this a waste of CPU cycles, but it also caused bugs. A ($)prototype would cause an lvalue sub to copy its return value [perl #51408],and while(lvalue_sub() =~ m/.../g) { ... } would loop endlessly[perl #78680].

  • When called in potential lvalue context(e.g., subroutine arguments or a listpassed to for), lvalue subroutines used to copyany read-only value that was returned. E.g., sub :lvalue { $] } would not return $], but a copy of it.

  • When called in potential lvalue context, an lvalue subroutine returningarrays or hashes used to bind the arrays or hashes to scalar variables,resulting in bugs. This was fixed in 5.14.0 if an array were the firstthing returned from the subroutine (but not for $scalar, @array orhashes being returned). Now a more general fix has been applied[perl #23790].

  • Method calls whose arguments were all surrounded with my() or our()(as in $object->method(my($a,$b))) used to force lvalue context onthe subroutine. This would prevent lvalue methods from returning certainvalues.

  • Lvalue sub calls that are not determined to be such at compile time(&$name or &{"name"}) are no longer exempt from strict refs if theyoccur in the last statement of an lvalue subroutine [perl #102486].

  • Sub calls whose subs are not visible at compile time, ifthey occurred in the last statement of an lvalue subroutine,would reject non-lvalue subroutines and die with "Can't modify non-lvaluesubroutine call" [perl #102486].

    Non-lvalue sub calls whose subs are visible at compile time exhibitedthe opposite bug. If the call occurred in the last statement of an lvaluesubroutine, there would be no error when the lvalue sub was called inlvalue context. Perl would blindly assign to the temporary value returnedby the non-lvalue subroutine.

  • AUTOLOAD routines used to take precedence over the actual sub beingcalled (i.e., when autoloading wasn't needed), for sub calls in lvalue orpotential lvalue context, if the subroutine was not visible at compiletime.

  • Applying the :lvalue attribute to an XSUB or to an aliased subroutinestub with sub foo :lvalue; syntax stopped working in Perl 5.12.This has been fixed.

  • Applying the :lvalue attribute to subroutine that is already defined doesnot work properly, as the attribute changes the way the sub is compiled.Hence, Perl 5.12 began warning when an attempt is made to apply theattribute to an already defined sub. In such cases, the attribute isdiscarded.

    But the change in 5.12 missed the case where custom attributes are alsopresent: that case still silently and ineffectively applied the attribute.That omission has now been corrected. sub foo :lvalue :Whatever (whenfoo is already defined) now warns about the :lvalue attribute, and doesnot apply it.

  • A bug affecting lvalue context propagation through nested lvalue subroutinecalls has been fixed. Previously, returning a value in nested rvaluecontext would be treated as lvalue context by the inner subroutine call,resulting in some values (such as read-only values) being rejected.

Overloading

  • Arithmetic assignment ($left += $right) involving overloaded objectsthat rely on the 'nomethod' override no longer segfault when the leftoperand is not overloaded.

  • Errors that occur when methods cannot be found during overloading nowmention the correct package name, as they did in 5.8.x, instead oferroneously mentioning the "overload" package, as they have since 5.10.0.

  • Undefining %overload:: no longer causes a crash.

Prototypes of built-in keywords

  • The prototype function no longer dies for the __FILE__, __LINE__and __PACKAGE__ directives. It now returns an empty-string prototypefor them, because they are syntactically indistinguishable from nullaryfunctions like time.

  • prototype now returns undef for all overridable infix operators,such as eq, which are not callable in any way resembling functions.It used to return incorrect prototypes for some and die for others[perl #94984].

  • The prototypes of several built-in functions--getprotobynumber, lock,not and select--have been corrected, or at least are now closer toreality than before.

Regular expressions

  • /[[:ascii:]]/ and /[[:blank:]]/ now use locale rules underuse locale when the platform supports that. Previously, they usedthe platform's native character set.

  • m/[[:ascii:]]/i and /\p{ASCII}/i now match identically (when notunder a differing locale). This fixes a regression introduced in 5.14in which the first expression could match characters outside of ASCII,such as the KELVIN SIGN.

  • /.*/g would sometimes refuse to match at the end of a string that endswith "\n". This has been fixed [perl #109206].

  • Starting with 5.12.0, Perl used to get its internal bookkeeping muddled upafter assigning ${ qr// } to a hash element and locking it withHash::Util. This could result in double frees, crashes, or erraticbehavior.

  • The new (in 5.14.0) regular expression modifier /a when repeated like/aa forbids the characters outside the ASCII range that matchcharacters inside that range from matching under /i. This did notwork under some circumstances, all involving alternation, such as:

    1. "\N{KELVIN SIGN}" =~ /k|foo/iaa;

    succeeded inappropriately. This is now fixed.

  • 5.14.0 introduced some memory leaks in regular expression characterclasses such as [\w\s], which have now been fixed. (5.14.1)

  • An edge case in regular expression matching could potentially loop.This happened only under /i in bracketed character classes that havecharacters with multi-character folds, and the target string to matchagainst includes the first portion of the fold, followed by anothercharacter that has a multi-character fold that begins with the remainingportion of the fold, plus some more.

    1. "s\N{U+DF}" =~ /[\x{DF}foo]/i

    is one such case. \xDF folds to "ss". (5.14.1)

  • A few characters in regular expression pattern matches did notmatch correctly in some circumstances, all involving /i. Theaffected characters are:COMBINING GREEK YPOGEGRAMMENI,GREEK CAPITAL LETTER IOTA,GREEK CAPITAL LETTER UPSILON,GREEK PROSGEGRAMMENI,GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA,GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS,GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA,GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS,LATIN SMALL LETTER LONG S,LATIN SMALL LIGATURE LONG S T,andLATIN SMALL LIGATURE ST.

  • A memory leak regression in regular expression compilationunder threading has been fixed.

  • A regression introduced in 5.14.0 hasbeen fixed. This involved an invertedbracketed character class in a regular expression that consisted solelyof a Unicode property. That property wasn't getting inverted outside theLatin1 range.

  • Three problematic Unicode characters now work better in regex pattern matching under /i.

    In the past, three Unicode characters:LATIN SMALL LETTER SHARP S,GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS,andGREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS,along with the sequences that they fold to(including "ss" for LATIN SMALL LETTER SHARP S),did not properly match under /i. 5.14.0 fixed some of these cases,but introduced others, including a panic when one of the characters orsequences was used in the (?(DEFINE) regular expression predicate.The known bugs that were introduced in 5.14 have now been fixed; as wellas some other edge cases that have never worked until now. These allinvolve using the characters and sequences outside bracketed characterclasses under /i. This closes [perl #98546].

    There remain known problems when using certain characters withmulti-character folds inside bracketed character classes, including suchconstructs as qr/[\N{LATIN SMALL LETTER SHARP}a-z]/i. Theseremaining bugs are addressed in [perl #89774].

  • RT #78266: The regex engine has been leaking memory when accessingnamed captures that weren't matched as part of a regex ever since 5.10when they were introduced; e.g., this would consume over a hundred MB ofmemory:

    1. for (1..10_000_000) {
    2. if ("foo" =~ /(foo|(?<capture>bar))?/) {
    3. my $capture = $+{capture}
    4. }
    5. }
    6. system "ps -o rss $$"'
  • In 5.14, /[[:lower:]]/i and /[[:upper:]]/i no longer matched theopposite case. This has been fixed [perl #101970].

  • A regular expression match with an overloaded object on the right-hand sidewould sometimes stringify the object too many times.

  • A regression has been fixed that was introduced in 5.14, in /iregular expression matching, in which a match improperly fails if thepattern is in UTF-8, the target string is not, and a Latin-1 characterprecedes a character in the string that should match the pattern.[perl #101710]

  • In case-insensitive regular expression pattern matching, no longer onUTF-8 encoded strings does the scan for the start of match look only atthe first possible position. This caused matches such as"f\x{FB00}" =~ /ff/i to fail.

  • The regexp optimizer no longer crashes on debugging builds when mergingfixed-string nodes with inconvenient contents.

  • A panic involving the combination of the regular expression modifiers/aa and the \b escape sequence introduced in 5.14.0 has beenfixed [perl #95964]. (5.14.2)

  • The combination of the regular expression modifiers /aa and the \band \B escape sequences did not work properly on UTF-8 encodedstrings. All non-ASCII characters under /aa should be treated asnon-word characters, but what was happening was that Unicode rules wereused to determine wordness/non-wordness for non-ASCII characters. Thisis now fixed [perl #95968].

  • (?foo: ...) no longer loses passed in character set.

  • The trie optimization used to have problems with alternations containingan empty (?:), causing "x" =~ /\A(?>(?:(?:)A|B|C?x))\z/ not tomatch, whereas it should [perl #111842].

  • Use of lexical (my) variables in code blocks embedded in regularexpressions will no longer result in memory corruption or crashes.

    Nevertheless, these code blocks are still experimental, as there are stillproblems with the wrong variables being closed over (in loops for instance)and with abnormal exiting (e.g., die) causing memory corruption.

  • The \h, \H, \v and \V regular expression metacharacters used tocause a panic error message when trying to match at the end of thestring [perl #96354].

  • The abbreviations for four C1 control characters MW PM, RI, andST were previously unrecognized by \N{}, vianame(), andstring_vianame().

  • Mentioning a variable named "&" other than $& (i.e., @& or %&) nolonger stops $& from working. The same applies to variables named "'"and "`" [perl #24237].

  • Creating a UNIVERSAL::AUTOLOAD sub no longer stops %+, %- and%! from working some of the time [perl #105024].

Smartmatching

  • ~~ now correctly handles the precedence of Any~~Object, and is not trickedby an overloaded object on the left-hand side.

  • In Perl 5.14.0, $tainted ~~ @array stopped working properly. Sometimesit would erroneously fail (when $tainted contained a string that occursin the array after the first element) or erroneously succeed (whenundef occurred after the first element) [perl #93590].

The sort operator

  • sort was not treating sub {} and sub {()} as equivalent whensuch a sub was provided as the comparison routine. It used to croak onsub {()}.

  • sort now works once more with custom sort routines that are XSUBs. Itstopped working in 5.10.0.

  • sort with a constant for a custom sort routine, although it producesunsorted results, no longer crashes. It started crashing in 5.10.0.

  • Warnings emitted by sort when a custom comparison routine returns anon-numeric value now contain "in sort" and show the line number of thesort operator, rather than the last line of the comparison routine. Thewarnings also now occur only if warnings are enabled in the scope wheresort occurs. Previously the warnings would occur if enabled in thecomparison routine's scope.

  • sort { $a <=> $b }, which is optimized internally, now produces"uninitialized" warnings for NaNs (not-a-number values), since <=>returns undef for those. This brings it in line withsort { 1; $a <=> $b } and other more complex cases, which are notoptimized [perl #94390].

The substr operator

  • Tied (and otherwise magical) variables are no longer exempt from the"Attempt to use reference as lvalue in substr" warning.

  • That warning now occurs when the returned lvalue is assigned to, notwhen substr itself is called. This makes a difference only if thereturn value of substr is referenced and later assigned to.

  • Passing a substring of a read-only value or a typeglob to a function(potential lvalue context) no longer causes an immediate "Can't coerce"or "Modification of a read-only value" error. That error occurs only if the passed value is assigned to.

    The same thing happens with the "substr outside of string" error. Ifthe lvalue is only read from, not written to, it is now just a warning, aswith rvalue substr.

  • substr assignments no longer call FETCH twice if the first argumentis a tied variable, just once.

Support for embedded nulls

Some parts of Perl did not work correctly with nulls (chr 0) embedded instrings. That meant that, for instance, $m = "a\0b"; foo->$m wouldcall the "a" method, instead of the actual method name contained in $m.These parts of perl have been fixed to support nulls:

  • Method names

  • Typeglob names (including filehandle and subroutine names)

  • Package names, including the return value of ref()

  • Typeglob elements (*foo{"THING\0stuff"})

  • Signal names

  • Various warnings and error messages that mention variable names or values,methods, etc.

One side effect of these changes is that blessing into "\0" no longercauses ref() to return false.

Threading bugs

  • Typeglobs returned from threads are no longer cloned if the parent threadalready has a glob with the same name. This means that returnedsubroutines will now assign to the right package variables [perl #107366].

  • Some cases of threads crashing due to memory allocation during cloning havebeen fixed [perl #90006].

  • Thread joining would sometimes emit "Attempt to free unreferenced scalar"warnings if caller had been used from the DB package before threadcreation [perl #98092].

  • Locking a subroutine (via lock &sub) is no longer a compile-time errorfor regular subs. For lvalue subroutines, it no longer tries to return thesub as a scalar, resulting in strange side effects like ref \$_returning "CODE" in some instances.

    lock &sub is now a run-time error if threads::shared is loaded (ano-op otherwise), but that may be rectified in a future version.

Tied variables

  • Various cases in which FETCH was being ignored or called too many timeshave been fixed:

    • PerlIO::get_layers [perl #97956]

    • $tied =~ y/a/b/, chop $tied and chomp $tied when $tied holds areference.

    • When calling local $_ [perl #105912]

    • Four-argument select

    • A tied buffer passed to sysread

    • $tied .= <>

    • Three-argument open, the third being a tied file handle(as in open $fh, ">&", $tied)

    • sort with a reference to a tied glob for the comparison routine.

    • .. and ... in list context [perl #53554].

    • ${$tied}, @{$tied}, %{$tied} and *{$tied} where the tiedvariable returns a string (&{} was unaffected)

    • defined ${ $tied_variable }

    • Various functions that take a filehandle argument in rvalue context(close, readline, etc.) [perl #97482]

    • Some cases of dereferencing a complex expression, such as${ (), $tied } = 1, used to call FETCH multiple times, but now callit once.

    • $tied->method where $tied returns a package name--even resulting ina failure to call the method, due to memory corruption

    • Assignments like *$tied = \&{"..."} and *glob = $tied

    • chdir, chmod, chown, utime, truncate, stat, lstat andthe filetest ops (-r, -x, etc.)

  • caller sets @DB::args to the subroutine arguments when called fromthe DB package. It used to crash when doing so if @DB::args happened tobe tied. Now it croaks instead.

  • Tying an element of %ENV or %^H and then deleting that element wouldresult in a call to the tie object's DELETE method, even though tying theelement itself is supposed to be equivalent to tying a scalar (the elementis, of course, a scalar) [perl #67490].

  • When Perl autovivifies an element of a tied array or hash (which entailscalling STORE with a new reference), it now calls FETCH immediately afterthe STORE, instead of assuming that FETCH would have returned the samereference. This can make it easier to implement tied objects [perl #35865, #43011].

  • Four-argument select no longer produces its "Non-string passed asbitmask" warning on tied or tainted variables that are strings.

  • Localizing a tied scalar that returns a typeglob no longer stops it frombeing tied till the end of the scope.

  • Attempting to goto out of a tied handle method used to cause memorycorruption or crashes. Now it produces an error message instead[perl #8611].

  • A bug has been fixed that occurs when a tied variable is used as asubroutine reference: if the last thing assigned to or returned from thevariable was a reference or typeglob, the \&$tied could either crash orreturn the wrong subroutine. The reference case is a regression introducedin Perl 5.10.0. For typeglobs, it has probably never worked till now.

Version objects and vstrings

  • The bitwise complement operator (and possibly other operators, too) whenpassed a vstring would leave vstring magic attached to the return value,even though the string had changed. This meant thatversion->new(~v1.2.3) would create a version looking like "v1.2.3"even though the string passed to version->new was actually"\376\375\374". This also caused B::Deparse to deparse ~v1.2.3incorrectly, without the ~ [perl #29070].

  • Assigning a vstring to a magic (e.g., tied, $!) variable and thenassigning something else used to blow away all magic. This meant thattied variables would come undone, $! would stop getting updated onfailed system calls, $| would stop setting autoflush, and othermischief would take place. This has been fixed.

  • version->new("version") and printf "%vd", "version" no longercrash [perl #102586].

  • Version comparisons, such as those that happen implicitly with usev5.43, no longer cause locale settings to change [perl #105784].

  • Version objects no longer cause memory leaks in boolean context[perl #109762].

Warnings, redefinition

  • Subroutines from the autouse namespace are once more exempt fromredefinition warnings. This used to work in 5.005, but was broken in5.6 for most subroutines. For subs created via XS that redefinesubroutines from the autouse package, this stopped working in 5.10.

  • New XSUBs now produce redefinition warnings if they overwrite existingsubs, as they did in 5.8.x. (The autouse logic was reversed in5.10-14. Only subroutines from the autouse namespace would warnwhen clobbered.)

  • newCONSTSUB used to use compile-time warning hints, instead ofrun-time hints. The following code should never produce a redefinitionwarning, but it used to, if newCONSTSUB redefined an existingsubroutine:

    1. use warnings;
    2. BEGIN {
    3. no warnings;
    4. some_XS_function_that_calls_new_CONSTSUB();
    5. }
  • Redefinition warnings for constant subroutines are on by default (whatare known as severe warnings in perldiag). This occurred onlywhen it was a glob assignment or declaration of a Perl subroutine thatcaused the warning. If the creation of XSUBs triggered the warning, itwas not a default warning. This has been corrected.

  • The internal check to see whether a redefinition warning should occurused to emit "uninitialized" warnings in cases like this:

    1. use warnings "uninitialized";
    2. use constant {u => undef, v => undef};
    3. sub foo(){u}
    4. sub foo(){v}

Warnings, "Uninitialized"

  • Various functions that take a filehandle argument in rvalue context(close, readline, etc.) used to warn twice for an undefined handle[perl #97482].

  • dbmopen now only warns once, rather than three times, if the modeargument is undef [perl #90064].

  • The += operator does not usually warn when the left-hand side isundef, but it was doing so for tied variables. This has been fixed[perl #44895].

  • A bug fix in Perl 5.14 introduced a new bug, causing "uninitialized"warnings to report the wrong variable if the operator in question hadtwo operands and one was %{...} or @{...}. This has been fixed[perl #103766].

  • .. and ... in list context now mention the name of the variable in"uninitialized" warnings for string (as opposed to numeric) ranges.

Weak references

  • Weakening the first argument to an automatically-invoked DESTROY methodcould result in erroneous "DESTROY created new reference" errors orcrashes. Now it is an error to weaken a read-only reference.

  • Weak references to lexical hashes going out of scope were not going stale(becoming undefined), but continued to point to the hash.

  • Weak references to lexical variables going out of scope are now brokenbefore any magical methods (e.g., DESTROY on a tie object) are called.This prevents such methods from modifying the variable that will be seenthe next time the scope is entered.

  • Creating a weak reference to an @ISA array or accessing the array index($#ISA) could result in confused internal bookkeeping for elementslater added to the @ISA array. For instance, creating a weakreference to the element itself could push that weak reference on to @ISA;and elements added after use of $#ISA would be ignored by method lookup[perl #85670].

Other notable fixes

  • quotemeta now quotes consistently the same non-ASCII characters underuse feature 'unicode_strings', regardless of whether the string isencoded in UTF-8 or not, hence fixing the last vestiges (we hope) of thenotorious The Unicode Bug in perlunicode. [perl #77654].

    Which of these code points is quoted has changed, based on Unicode'srecommendations. See quotemeta for details.

  • study is now a no-op, presumably fixing all outstanding bugs related tostudy causing regex matches to behave incorrectly!

  • When one writes open foo || die, which used to work in Perl 4, a"Precedence problem" warning is produced. This warning used erroneously toapply to fully-qualified bareword handle names not followed by ||. Thishas been corrected.

  • After package aliasing (*foo:: = *bar::), select with 0 or 1 argumentwould sometimes return a name that could not be used to refer to thefilehandle, or sometimes it would return undef even when a filehandlewas selected. Now it returns a typeglob reference in such cases.

  • PerlIO::get_layers no longer ignores some arguments that it thinks arenumeric, while treating others as filehandle names. It is now consistentfor flat scalars (i.e., not references).

  • Unrecognized switches on #! line

    If a switch, such as -x, that cannot occur on the #! line is usedthere, perl dies with "Can't emulate...".

    It used to produce the same message for switches that perl did notrecognize at all, whether on the command line or the #! line.

    Now it produces the "Unrecognized switch" error message [perl #104288].

  • system now temporarily blocks the SIGCHLD signal handler, to prevent thesignal handler from stealing the exit status [perl #105700].

  • The %n formatting code for printf and sprintf, which causes the numberof characters to be assigned to the next argument, now actuallyassigns the number of characters, instead of the number of bytes.

    It also works now with special lvalue functions like substr and withnonexistent hash and array elements [perl #3471, #103492].

  • Perl skips copying values returned from a subroutine, for the sake ofspeed, if doing so would make no observable difference. Because of faultylogic, this would happen with theresult of delete, shift or splice, even if the result wasreferenced elsewhere. It also did so with tied variables about to be freed[perl #91844, #95548].

  • utf8::decode now refuses to modify read-only scalars [perl #91850].

  • Freeing $_ inside a grep or map block, a code block embedded in aregular expression, or an @INC filter (a subroutine returned by asubroutine in @INC) used to result in double frees or crashes[perl #91880, #92254, #92256].

  • eval returns undef in scalar context or an empty list in listcontext when there is a run-time error. When eval was passed astring in list context and a syntax error occurred, it used to return alist containing a single undefined element. Now it returns an emptylist in list context for all errors [perl #80630].

  • goto &func no longer crashes, but produces an error message, whenthe unwinding of the current subroutine's scope fires a destructor thatundefines the subroutine being "goneto" [perl #99850].

  • Perl now holds an extra reference count on the package that code iscurrently compiling in. This means that the following code no longercrashes [perl #101486]:

    1. package Foo;
    2. BEGIN {*Foo:: = *Bar::}
    3. sub foo;
  • The x repetition operator no longer crashes on 64-bit builds with largerepeat counts [perl #94560].

  • Calling require on an implicit $_ when *CORE::GLOBAL::require hasbeen overridden does not segfault anymore, and $_ is now passed to theoverriding subroutine [perl #78260].

  • use and require are no longer affected by the I/O layers active inthe caller's scope (enabled by open.pm) [perl #96008].

  • our $::é; (which is invalid) no longer produces the "Compilationerror at lib/utf8_heavy.pl..." error message, which it started emitting in5.10.0 [perl #99984].

  • On 64-bit systems, read() now understands large string offsets beyondthe 32-bit range.

  • Errors that occur when processing subroutine attributes no longer cause thesubroutine's op tree to leak.

  • Passing the same constant subroutine to both index and formline nolonger causes one or the other to fail [perl #89218]. (5.14.1)

  • List assignment to lexical variables declared with attributes in the samestatement (my ($x,@y) : blimp = (72,94)) stopped working in Perl 5.8.0.It has now been fixed.

  • Perl 5.10.0 introduced some faulty logic that made "U*" in the middle ofa pack template equivalent to "U0" if the input string was empty. This hasbeen fixed [perl #90160]. (5.14.2)

  • Destructors on objects were not called during global destruction on objectsthat were not referenced by any scalars. This could happen if an arrayelement were blessed (e.g., bless \$a[0]) or if a closure referenced ablessed variable (bless \my @a; sub foo { @a }).

    Now there is an extra pass during global destruction to fire destructors onany objects that might be left after the usual passes that check forobjects referenced by scalars [perl #36347].

  • Fixed a case where it was possible that a freed buffer may have been readfrom when parsing a here document [perl #90128]. (5.14.1)

  • each(ARRAY) is now wrapped in defined(...), like each(HASH),inside a while condition [perl #90888].

  • A problem with context propagation when a do block is an argument toreturn has been fixed. It used to cause undef to be returned incertain cases of a return inside an if block which itself is followed byanother return.

  • Calling index with a tainted constant no longer causes constants insubsequently compiled code to become tainted [perl #64804].

  • Infinite loops like 1 while 1 used to stop strict 'subs' mode fromworking for the rest of the block.

  • For list assignments like ($a,$b) = ($b,$a), Perl has to make a copy ofthe items on the right-hand side before assignment them to the left. Forefficiency's sake, it assigns the values on the right straight to the itemson the left if no one variable is mentioned on both sides, as in ($a,$b) =($c,$d). The logic for determining when it can cheat was faulty, in that&& and || on the right-hand side could fool it. So ($a,$b) =$some_true_value && ($b,$a) would end up assigning the value of $b toboth scalars.

  • Perl no longer tries to apply lvalue context to the string in("string", $variable) ||= 1 (which used to be an error). Since theleft-hand side of ||= is evaluated in scalar context, that's a scalarcomma operator, which gives all but the last item void context. There isno such thing as void lvalue context, so it was a mistake for Perl to tryto force it [perl #96942].

  • caller no longer leaks memory when called from the DB package if@DB::args was assigned to after the first call to caller. Carpwas triggering this bug [perl #97010]. (5.14.2)

  • close and similar filehandle functions, when called on built-in globalvariables (like $+), used to die if the variable happened to hold theundefined value, instead of producing the usual "Use of uninitializedvalue" warning.

  • When autovivified file handles were introduced in Perl 5.6.0, readlinewas inadvertently made to autovivify when called as readline($foo) (butnot as <$foo>). It has now been fixed never to autovivify.

  • Calling an undefined anonymous subroutine (e.g., what $x holds afterundef &{$x = sub{}}) used to cause a "Not a CODE reference" error, whichhas been corrected to "Undefined subroutine called" [perl #71154].

  • Causing @DB::args to be freed between uses of caller no longerresults in a crash [perl #93320].

  • setpgrp($foo) used to be equivalent to ($foo, setpgrp), becausesetpgrp was ignoring its argument if there was just one. Now it isequivalent to setpgrp($foo,0).

  • shmread was not setting the scalar flags correctly when reading fromshared memory, causing the existing cached numeric representation in thescalar to persist [perl #98480].

  • ++ and -- now work on copies of globs, instead of dying.

  • splice() doesn't warn when truncating

    You can now limit the size of an array using splice(@a,MAX_LEN) withoutworrying about warnings.

  • $$ is no longer tainted. Since this value comes directly fromgetpid(), it is always safe.

  • The parser no longer leaks a filehandle if STDIN was closed before parsingstarted [perl #37033].

  • die; with a non-reference, non-string, or magical (e.g., tainted)value in $@ now properly propagates that value [perl #111654].

Known Problems

  • On Solaris, we have two kinds of failure.

    If make is Sun's make, we get an error about a badly formed macroassignment in the Makefile. That happens when ./Configure tries tomake depends. Configure then exits 0, but further make-ing fails.

    If make is gmake, Configure completes, then we get errors relatedto /usr/include/stdbool.h

  • On Win32, a number of tests hang unless STDERR is redirected. The cause ofthis is still under investigation.

  • When building as root with a umask that prevents files from beingother-readable, t/op/filetest.t will fail. This is a test bug, not abug in perl's behavior.

  • Configuring with a recent gcc and link-time-optimization, such asConfigure -Doptimize='-O2 -flto' failsbecause the optimizer optimizes away some of Configure's tests. Aworkaround is to omit the -flto flag when running Configure, but addit back in while actually building, something like

    1. sh Configure -Doptimize=-O2
    2. make OPTIMIZE='-O2 -flto'
  • The following CPAN modules have test failures with perl 5.16. Patches havebeen submitted for all of these, so hopefully there will be new releasessoon:

Acknowledgements

Perl 5.16.0 represents approximately 12 months of development since Perl5.14.0 and contains approximately 590,000 lines of changes across 2,500files from 139 authors.

Perl continues to flourish into its third decade thanks to a vibrantcommunity of users and developers. The following people are known tohave contributed the improvements that became Perl 5.16.0:

Aaron Crane, Abhijit Menon-Sen, Abigail, Alan Haggai Alavi, AlbertoSimões, Alexandr Ciornii, Andreas König, Andy Dougherty, AristotlePagaltzis, Bo Johansson, Bo Lindbergh, Breno G. de Oliveira, brian dfoy, Brian Fraser, Brian Greenfield, Carl Hayter, Chas. Owens,Chia-liang Kao, Chip Salzenberg, Chris 'BinGOs' Williams, ChristianHansen, Christopher J. Madsen, chromatic, Claes Jacobsson, ClaudioRamirez, Craig A. Berry, Damian Conway, Daniel Kahn Gillmor, DarinMcBride, Dave Rolsky, David Cantrell, David Golden, David Leadbeater,David Mitchell, Dee Newcum, Dennis Kaarsemaker, Dominic Hargreaves,Douglas Christopher Wilson, Eric Brine, Father Chrysostomos, FlorianRagwitz, Frederic Briere, George Greer, Gerard Goossen, Gisle Aas,H.Merijn Brand, Hojung Youn, Ian Goodacre, James E Keenan, Jan Dubois,Jerry D. Hedden, Jesse Luehrs, Jesse Vincent, Jilles Tjoelker, JimCromie, Jim Meyering, Joel Berger, Johan Vromans, Johannes Plunien, JohnHawkinson, John P. Linderman, John Peacock, Joshua ben Jore, JuerdWaalboer, Karl Williamson, Karthik Rajagopalan, Keith Thompson, Kevin J.Woolley, Kevin Ryde, Laurent Dami, Leo Lapworth, Leon Brocard, LeonTimmermans, Louis Strous, Lukas Mai, Marc Green, Marcel Grünauer, MarkA. Stratman, Mark Dootson, Mark Jason Dominus, Martin Hasch, MatthewHorsfall, Max Maischein, Michael G Schwern, Michael Witten, MikeSheldrake, Moritz Lenz, Nicholas Clark, Niko Tyni, Nuno Carvalho, PauAmma, Paul Evans, Paul Green, Paul Johnson, Perlover, Peter John Acklam,Peter Martini, Peter Scott, Phil Monsen, Pino Toscano, RafaelGarcia-Suarez, Rainer Tammer, Reini Urban, Ricardo Signes, Robin Barker,Rodolfo Carvalho, Salvador Fandiño, Sam Kimbrel, Samuel Thibault, ShawnM Moore, Shigeya Suzuki, Shirakata Kentaro, Shlomi Fish, Sisyphus,Slaven Rezic, Spiros Denaxas, Steffen Müller, Steffen Schwigon, StephenBennett, Stephen Oberholtzer, Stevan Little, Steve Hay, Steve Peters,Thomas Sibley, Thorsten Glaser, Timothe Litt, Todd Rinaldo, TomChristiansen, Tom Hukins, Tony Cook, Vadim Konovalov, Vincent Pit,Vladimir Timofeev, Walt Mankowski, Yves Orton, Zefram, Zsbán Ambrus,Ævar Arnfjörð Bjarmason.

The list above is almost certainly incomplete as it is automaticallygenerated from version control history. In particular, it does notinclude the names of the (very much appreciated) contributors whoreported issues to the Perl bug tracker.

Many of the changes included in this version originated in the CPANmodules included in Perl's core. We're grateful to the entire CPANcommunity for helping Perl to flourish.

For a more complete list of all of Perl's historical contributors,please see the AUTHORS file in the Perl source distribution.

Reporting Bugs

If you find what you think is a bug, you might check the articlesrecently posted to the comp.lang.perl.misc newsgroup and the perlbug database at http://rt.perl.org/perlbug/. There may also beinformation at http://www.perl.org/, the Perl Home Page.

If you believe you have an unreported bug, please run the perlbugprogram included with your release. Be sure to trim your bug downto a tiny but sufficient test case. Your bug report, along with theoutput of perl -V, will be sent off to [email protected] to beanalysed by the Perl porting team.

If the bug you are reporting has security implications, which make itinappropriate to send to a publicly archived mailing list, then pleasesend it to [email protected]. This points to a closedsubscription unarchived mailing list, which includes all corecommitters, who will be able to help assess the impact of issues, figureout a resolution, and help co-ordinate the release of patches tomitigate or fix the problem across all platforms on which Perl issupported. Please use this address only for security issues in the Perlcore, not for modules independently distributed on CPAN.

SEE ALSO

The Changes file for an explanation of how to view exhaustive detailson what changed.

The INSTALL file for how to build Perl.

The README file for general stuff.

The Artistic and Copying files for copyright information.

Page index
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) What is new for perl v5.16.0What is new for perl v5.14.2 (Berikutnya)