perldelta - what is new for perl v5.17.1


This document describes differences between the 5.17.0 release and the 5.17.1 release.

If you are upgrading from an earlier release such as 5.16.0, first read perl5170delta, which describes differences between 5.16.0 and 5.17.0.

Core Enhancements

More CORE:: subs

Several more built-in functions have been added as subroutines to the CORE:: namespace, namely, those non-overridable keywords that can be implemented without custom parsers: defined, delete, exists, glob, pos, protoytpe, scalar, split, study, and undef.

As some of these have prototypes, prototype('CORE::...') has been changed to not make a distinction between overridable and non-overridable keywords. This is to make prototype('CORE::pos') consistent with prototype(&CORE::pos).

Incompatible Changes

/(?{})/ and /(??{})/ have been heavily reworked

The implementation of this feature has been almost completely rewritten. Although its main intent is to fix bugs, some behaviors, especially related to the scope of lexical variables, will have changed. This is described more fully in the "Selected Bug Fixes" section.

\N{BELL} now refers to U+1F514 instead of U+0007

Unicode 6.0 reused the name "BELL" for a different code point than it traditionally had meant. Since Perl v5.14, use of this name still referred to U+0007, but would raise a deprecation warning. Now, "BELL" refers to U+1F514, and the name for U+0007 is "ALERT". All the functions in charnames have been correspondingly updated.

Alphanumeric operators must now be separated from the closing delimiter of regular expressions

You may no longer write something like:

 m/a/and 1

Instead you must write

 m/a/ and 1

with whitespace separating the operator from the closing delimiter of the regular expression. Not having whitespace has resulted in a deprecation warning since Perl v5.14.0.

require dies for unreadable files

When require encounters an unreadable file, it now dies. It used to ignore the file and continue searching the directories in @INC [perl #113422].

Upgrade to the Unicode 6.2 beta

Unicode 6.2 is proposing some changes that may very well break some CPAN modules. The timing of this nicely coincides with Perl's being early in the release cycle. This commit takes the current beta 6.2, adds the proposed changes that aren't yet in it, and subtracts the changes that would affect \X processing, as those turn out to have errors, and may have to be rethought. Unicode has been notified of these problems.

This will allow us to gather data as to whether or not the proposed changes cause us problems. These will be presented to Unicode to aid in their final decision as to whether or not to go forward with the changes.

These changes will be replaced by the final version of Unicode 6.2 before 5.18.0 is released.

Performance Enhancements

  • The x repetition operator is now folded to a single constant at compile time if called in scalar context with constant operands and no parentheses around the left operand.

Modules and Pragmata

Updated Modules and Pragmata

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

    Work around an edge case on Linux with Busybox's unzip.

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

    ptar now supports the -T option as well as dashless options [ #75473], [ #75475].

    Auto-encode filenames marked as UTF-8 [ #75474].

    Don't use tell on IO::Zlib handles [ #64339].

    Don't try to chown on symlinks.

  • attributes has been upgraded from version 0.19 to 0.20.

  • autodie has been upgraded from version 2.10 to 2.11.

  • B has been upgraded from version 1.35 to 1.36.

    B::COP::stashlen has been replaced with B::COP::stashoff.

    B::COP::stashpv now supports UTF-8 package names and embedded NULs.

  • B::Deparse has been upgraded from version 1.14 to 1.15.

    Avoid warning when run under perl -w.

  • Class::Struct has been upgraded from version 0.63 to 0.64.

    The constructor now respects overridden accessor methods [perl #29230].

  • Compress::Raw::Bzip2 has been upgraded from version 2.048 to 2.052.

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

    Upgrade bundled zlib to version 1.2.7.

    Fix build failures on Irix, Solaris, and Win32, and also when building as C++ [ #69985], [ #77030], [ #75222].

  • CPAN::Meta has been upgraded from version 2.120630 to 2.120921.

  • CPAN::Meta::Requirements has been upgraded from version 2.120630 to 2.122.

    Treat undef requirements to from_string_hash as 0 (with a warning).

    Added requirements_for_module method.

  • CPAN::Meta::YAML has been upgraded from version 0.007 to 0.008.

  • CPANPLUS has been upgraded from version 0.9121 to 0.9130.

    Allow adding blib/script to PATH.

    Save the history between invocations of the shell.

    Handle multiple makemakerargs and makeflags arguments better.

    Use File::HomeDir when available, and provide PERL5_CPANPLUS_HOME to override the autodetection.

    Always re-fetch CHECKSUMS if fetchdir is set.

  • Digest::MD5 has been upgraded from version 2.51 to 2.52.

    Fix Digest::Perl::MD5 OO fallback [ #66634].

  • DynaLoader has been upgraded from version 1.14 to 1.15.

    This is due to a minor code change in the XS for the VMS implementation.

  • ExtUtils::CBuilder has been upgraded from version 0.280206 to 0.280208.

    Manifest files are now correctly embedded for those versions of VC++ which make use of them. [perl #111782, #111798].

  • File::DosGlob has been upgraded from version 1.07 to 1.08.

  • File::Fetch has been upgraded from version 0.32 to 0.34.

  • File::Spec::Unix has been upgraded from version 3.39_02 to 3.39_03.

    abs2rel could produce incorrect results when given two relative paths or the root directory twice [perl #111510].

  • Filter::Util::Call has been upgraded from version 1.40 to 1.45.

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

    Add SSL verification features [github #6], [github #9].

    Include the final URL in the response hashref.

    Add local_address option.

  • IO has been upgraded from version 1.25_06 to 1.25_07.

    sync() can now be called on read-only file handles [perl #64772].

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

    Use POSIX::_exit instead of exit in run_forked [ #76901].

  • Memoize has been upgraded from version 1.02 to 1.03.

    Fix the MERGE cache option.

  • Module::Build has been upgraded from version 0.39_01 to 0.40.

    Fixed bug where modules without $VERSION might have a version of '0' listed in 'provides' metadata, which will be rejected by PAUSE.

    Fixed bug in PodParser to allow numerals in module names.

    Fixed bug where giving arguments twice led to them becoming arrays, resulting in install paths like ARRAY(0xdeadbeef)/lib/

  • Module::CoreList has been upgraded from version 2.67 to 2.68.

  • Module::Load::Conditional has been upgraded from version 0.46 to 0.50.

    Fix use of requires on perls installed to a path with spaces.

  • Object::Accessor has been upgraded from version 0.42 to 0.44.

  • Params::Check has been upgraded from version 0.32 to 0.36.

  • Parse::CPAN::Meta has been upgraded from version 1.4402 to 1.4404.

  • PerlIO::mmap has been upgraded from version 0.010 to 0.011.

  • PerlIO::via::QuotedPrint has been upgraded from version 0.06 to 0.07.

  • Pod::Html has been upgraded from version 1.15_02 to 1.16.

    The option --libpods has been reinstated. It is deprecated, and its use does nothing other than issue a warning that it is no longer supported.

    Since the HTML files generated by pod2html claim to have a UTF-8 charset, actually write the files out using UTF-8 [perl #111446].

  • POSIX has been upgraded from version 1.30 to 1.31.

  • re has been upgraded from version 0.19 to 0.20.

    See note about op_comp in the "Internal Changes" section below.

  • Safe has been upgraded from version 2.31_01 to 2.33_01.

    Fix interactions with Devel::Cover.

    Don't eval code under no strict.

  • Scalar::Util has been upgraded from version 1.23 to version 1.25.

    Fix an overloading issue with sum.

    first and reduce now check the callback first (so &first(1) is disallowed).

    Fix tainted on magical values [ #55763].

    Fix sum on previously magical values [ #61118].

    Fix reading past the end of a fixed buffer [ #72700].

  • Search::Dict has been upgraded from version 1.04 to 1.07.

    No longer require stat on filehandles.

    Use fc for casefolding.

  • Storable has been upgraded from version 2.35 to 2.36.

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

    Add support for italics.

    Improve error handling.

  • Test::Harness has been upgraded from version 3.23 to 3.25.

    Fix glob semantics on Win32 [ #49732].

    Don't use Win32::GetShortPathName when calling perl [ #47890].

    Ignore -T when reading shebang [ #64404].

    Handle the case where we don't know the wait status of the test more gracefully.

    Make the test summary 'ok' line overridable so that it can be changed to a plugin to make the output of prove idempotent.

    Don't run world-writable files.

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

    This adds a function all_casefolds() that returns all the casefolds.


Changes to Existing Documentation


  • perlfaq has been synchronized with version 5.0150040 from CPAN.


  • perlcheat has been reorganized, and a few new sections were added.


Removals of Diagnostics

  • The "Runaway prototype" warning that occurs in bizarre cases has been removed as being unhelpful and inconsistent.

  • The "Not a format reference" error has been removed, as the only case in which it could be triggered was a bug.

  • The "Unable to create sub named %s" error has been removed for the same reason.

Platform Support

Platform-Specific Notes


link on Win32 now attempts to set $! to more appropriate values based on the Win32 API error code. [perl #112272]

Perl no longer mangles the environment block, e.g. when launching a new sub-process, when the environment contains non-ASCII characters. Known problems still remain, however, when the environment contains characters outside of the current ANSI codepage (e.g. see the item about Unicode in %ENV in [perl #113536]


All C header files from the top-level directory of the distribution are now installed on VMS, providing consistency with a long-standing practice on other platforms. Previously only a subset were installed, which broke non-core extension builds for extensions that depended on the missing include files.

Internal Changes

  • The study function was made a no-op in 5.16. It was simply disabled via a return statement; the code was left in place. Now the code supporting what study used to do has been removed.

  • Under threaded perls, there is no longer a separate PV allocated for every COP to store its package name (cop->stashpv). Instead, there is an offset (cop->stashoff) into the new PL_stashpad array, which holds stash pointers.

  • In the pluggable regex API, the regexp_engine struct has acquired a new field op_comp, which is currently just for perl's internal use, and should be initialised to NULL by other regex plugin modules.

  • A new function alloccoptash has been added to the API, but is considered experimental. See perlapi.

Selected Bug Fixes

  • The implementation of code blocks in regular expressions, such as (?{}) and (??{}), has been heavily reworked to eliminate a whole slew of bugs. The main user-visible changes are:

    • Code blocks within patterns are now parsed in the same pass as the surrounding code; in particular it is no longer necessary to have balanced braces: this now works:

          /(?{  $x='{'  })/

      This means that this error message is longer generated:

          Sequence (?{...}) not terminated or not {}-balanced in regex

      but a new error may be seen:

          Sequence (?{...}) not terminated with ')'

      In addition, literal code blocks within run-time patterns are only compiled once, at perl compile-time:

          for my $p (...) {
              # this 'FOO' block of code is compiled once,
              # at the same time as the surrounding 'for' loop
    • Lexical variables are now sane as regards scope, recursion and closure behavior. In particular, /A(?{B})C/ behaves (from a closure viewpoint) exactly like /A/ && do { B } && /C/, while qr/A(?{B})C/ is like sub {/A/ && do { B } && /C/}. So this code now works how you might expect, creating three regexes that match 0, 1, and 2:

          for my $i (0..2) {
              push @r, qr/^(??{$i})$/;
          "1" =~ $r[1]; # matches
    • The use re 'eval' pragma is now only required for code blocks defined at runtime; in particular in the following, the text of the $r pattern is still interpolated into the new pattern and recompiled, but the individual compiled code-blocks within $r are reused rather than being recompiled, and use re 'eval' isn't needed any more:

          my $r = qr/abc(?{....})def/;
    • Flow control operators no longer crash. Each code block runs in a new dynamic scope, so next etc. will not see any enclosing loops and caller will not see any calling subroutines. return returns a value from the code block, not from any enclosing subroutine.

    • Perl normally caches the compilation of run-time patterns, and doesn't recompile if the pattern hasn't changed, but this is now disabled if required for the correct behavior of closures. For example:

          my $code = '(??{$x})';
          for my $x (1..3) {
              # recompile to see fresh value of $x each time
              $x =~ /$code/;
    • The /msix and (?msix) etc. flags are now propagated into the return value from (??{}); this now works:

          "AB" =~ /a(??{'b'})/i;
    • Warnings and errors will appear to come from the surrounding code (or for run-time code blocks, from an eval) rather than from an re_eval:

          use re 'eval'; $c = '(?{ warn "foo" })'; /$c/;
          /(?{ warn "foo" })/;

      formerly gave:

          foo at (re_eval 1) line 1.
          foo at (re_eval 2) line 1.

      and now gives:

          foo at (eval 1) line 1.
          foo at /some/prog line 2.
  • Perl now works as well as can be expected on all releases of Unicode so far. In v5.16, it worked on Unicodes 6.0 and 6.1, but there were various bugs for earlier releases; the older the release the more problems.

  • vec no longer produces "uninitialized" warnings in lvalue context [perl #9423].

  • An optimization involving fixed strings in regular expressions could cause a severe performance penalty in edge cases. This has been fixed [perl #76546].

  • In certain cases, including empty subpatterns within a regular expression (such as (?:) or (?:|)) could disable some optimizations. This has been fixed.

  • The "Can't find an opnumber" message that prototype produces when passed a string like "CORE::nonexistent_keyword" now passes UTF-8 and embedded NULs through unchanged [perl #97478].

  • prototype now treats magical variables like $1 the same way as non-magical variables when checking for the CORE:: prefix, instead of treating them as subroutine names.

  • Under threaded perls, a runtime code block in a regular expression could corrupt the package name stored in the op tree, resulting in bad reads in caller, and possibly crashes [perl #113060].

  • Referencing a closure prototype (\&{$_[1]} in an attribute handler for a closure) no longer results in a copy of the subroutine (or assertion failures on debugging builds).

  • eval '__PACKAGE__' now returns the right answer on threaded builds if the current package has been assigned over (as in *ThisPackage:: = *ThatPackage::) [perl #78742].

  • If a package is deleted by code that it calls, it is possible for caller to see a stack frame belonging to that deleted package. caller could crash if the stash's memory address was reused for a scalar and a substitution was performed on the same scalar [perl #113486].

  • UNIVERSAL::can no longer treats its first argument differently depending on whether it is a string or number internally.

  • open with <& for the mode checks to see whether the third argument is a number, in determining whether to treat it as a file descriptor or a handle name. Magical variables like $1 were always failing the numeric check and being treated as handle names.

  • warn's handling of magical variables ($1, ties) has undergone several fixes. FETCH is only called once now on a tied argument or a tied $@ [perl #97480]. Tied variables returning objects that stringify as "" are no longer ignored. A tied $@ that happened to return a reference the previous time is was used is no longer ignored.

  • warn "" now treats $@ with a number in it the same way, regardless of whether it happened via $@=3 or $@="3". It used to ignore the former. Now it appends "\t...caught", as it has always done with $@="3".

  • Numeric operators on magical variables (e.g., $1 + 1) used to use floating point operations even where integer operations were more appropriate, resulting in loss of accuracy on 64-bit platforms [perl #109542].

  • Unary negation no longer treats a string as a number if the string happened to be used as a number at some point. So, if $x contains the string "dogs", -$x returns "-dogs" even if $y=0+$x has happened at some point.

  • In Perl 5.14, -'-10' was fixed to return "10", not "+10". But magical variables ($1, ties) were not fixed till now [perl #57706].

  • Unary negation now treats strings consistently, regardless of the internal UTF8 flag.

  • A regression introduced in Perl v5.16.0 involving tr/SEARCHLIST/REPLACEMENTLIST/ has been fixed. Only the first instance is supposed to be meaningful if a character appears more than once in SEARCHLIST. Under some circumstances, the final instance was overriding all earlier ones. [perl #113584]

  • Regular expressions like qr/\87/ previously silently inserted a NUL character, thus matching as if it had been written qr/\00087/. Now it matches as if it had been written as qr/87/, with a message that the sequence "\8" is unrecognized.

  • __SUB__ now works in special blocks (BEGIN, END, etc.).

  • Thread creation on Windows could theoretically result in a crash if done inside a BEGIN block. It still does not work properly, but it no longer crashes [perl #111610].

  • \&{''} (with the empty string) now autovivifies a stub like any other sub name, and no longer produces the "Unable to create sub" error [perl #94476].

Known Problems

  • On VMS, Module::Build still fails its test suite.

  • On Win32, several tests fail intermittently, and may hang unless STDERR is redirected.


Perl 5.17.1 represents approximately 4 weeks of development since Perl 5.17.0 and contains approximately 37,000 lines of changes across 710 files from 35 authors.

Perl continues to flourish into its third decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.17.1:

?, Andy Dougherty, Aristotle Pagaltzis, Breno G. de Oliveira, Brian Fraser, Chris 'BinGOs' Williams, Craig A. Berry, David Mitchell, Dominic Hargreaves, Evan Miller, Father Chrysostomos, Florian Ragwitz, H.Merijn Brand, Herbert Breunung, Hugo van der Sanden, Jesse Luehrs, Karl Williamson, Karthik Rajagopalan, Lukas Mai, Martin Hasch, Michael Schroeder, Nicholas Clark, Paul Johnson, Reini Urban, Renee Baecker, Rhesa Rozendaal, Ricardo Signes, Shlomi Fish, Steve Hay, Steve Peters, Sullivan Beck, Tony Cook, Volker Schatz, Yves Orton, Zefram.

The list above is almost certainly incomplete as it is automatically generated from version control history. In particular, it does not include the names of the (very much appreciated) contributors who reported issues to the Perl bug tracker.

Many of the changes included in this version originated in the CPAN modules included in Perl's core. We're grateful to the entire CPAN community 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 articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at . There may also be information at , the Perl Home Page.

If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V, will be sent off to to be analysed by the Perl porting team.

If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to This points to a closed subscription unarchived mailing list, which includes all the core committers, who will be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.


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

The INSTALL file for how to build Perl.

The README file for general stuff.

The Artistic and Copying files for copyright information.