You are viewing the version of this documentation from Perl 5.14.1. View the latest version

CONTENTS

NAME

perl5136delta - what is new for perl v5.13.6

DESCRIPTION

This document describes differences between the 5.13.5 release and the 5.13.6 release.

If you are upgrading from an earlier release such as 5.13.4, first read perl5135delta, which describes differences between 5.13.4 and 5.13.5.

Core Enhancements

(?^...) regex construct added to signify default modifiers

A caret (also called a "circumflex accent") "^" immediately following a "(?" in a regular expression now means that the subexpression is to not inherit the surrounding modifiers such as /i, but to revert to the Perl defaults. Any modifiers following the caret override the defaults.

The stringification of regular expressions now uses this notation. E.g., before, qr/hlagh/i would be stringified as (?i-xsm:hlagh), but now it's stringified as (?^i:hlagh).

The main purpose of this is to allow tests that rely on the stringification to not have to change when new modifiers are added. See "Extended Patterns" in perlre.

"d", "l", and "u" regex modifiers added

These modifiers are currently only available within a (?...) construct.

The "l" modifier says to compile the regular expression as if it were in the scope of use locale, even if it is not.

The "u" modifier says to compile the regular expression as if it were in the scope of a use feature "unicode_strings" pragma.

The "d" modifier is used to override any use locale and use feature "unicode_strings" pragmas that are in effect at the time of compiling the regular expression.

See just below and "(?dlupimsx-imsx)" in perlre.

use feature "unicode_strings" now applies to some regex matching

Another chunk of the "The "Unicode Bug"" in perlunicode is fixed in this release. Now, regular expressions compiled within the scope of the "unicode_strings" feature will match the same whether or not the target string is encoded in utf8, with regard to \s, \w, \b, and their complements. Work is underway to add the [[:posix:]] character classes and case sensitive matching to the control of this feature, but was not complete in time for this dot release.

\N{...} now handles Unicode named character sequences

Unicode has a number of named character sequences, in which particular sequences of code points are given names. \N{...} now recognizes these. See charnames.

New function charnames::string_vianame()

This function is a run-time version of \N{...}, returning the string of characters whose Unicode name is its parameter. It can handle Unicode named character sequences, whereas the pre-existing charnames::vianame() cannot, as the latter returns a single code point. See charnames.

Reentrant regular expression engine

It is now safe to use regular expressions within (?{...}) and (??{...}) code blocks inside regular expressions.

These block are still experimental, however, and still have problems with lexical (my) variables, lexical pragmata and abnormal exiting.

Custom per-subroutine check hooks

XS code in an extension module can now annotate a subroutine (whether implemented in XS or in Perl) so that nominated XS code will be called at compile time (specifically as part of op checking) to change the op tree of that subroutine. The compile-time check function (supplied by the extension module) can implement argument processing that can't be expressed as a prototype, generate customised compile-time warnings, perform constant folding for a pure function, inline a subroutine consisting of sufficiently simple ops, replace the whole call with a custom op, and so on. This was previously all possible by hooking the entersub op checker, but the new mechanism makes it easy to tie the hook to a specific subroutine. See "cv_set_call_checker" in perlapi.

To help in writing custom check hooks, several subtasks within standard entersub op checking have been separated out and exposed in the API.

Return value of delete $+{...}

Custom regular expression engines can now determine the return value of delete on an entry of %+ or %-.

keys, values work on arrays

You can now use the keys, values, each builtin functions on arrays (previously you could only use them on hashes). See perlfunc for details. This is actually a change introduced in perl 5.12.0, but it was missed from that release's perldelta.

Incompatible Changes

Stringification of regexes has changed

Default regular expression modifiers are now notated by using (?^...). Code relying on the old stringification will fail. The purpose of this is so that when new modifiers are added, such code will not have to change (after this one time), as the stringification will automatically incorporate the new modifiers.

Code that needs to work properly with both old- and new-style regexes can avoid the whole issue by using (for Perls since 5.9.5):

use re qw(regexp_pattern);
my ($pat, $mods) = regexp_pattern($re_ref);

where $re_ref is a reference to a compiled regular expression. Upon return, $mods will be a string containing all the non-default modifiers used when the regular expression was compiled, and $pattern the actual pattern.

If the actual stringification is important, or older Perls need to be supported, you can use something like the following:

# Accept both old and new-style stringification
my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism';

And then use $modifiers instead of -xism.

Regular expressions retain their localeness when interpolated

Regular expressions compiled under "use locale" now retain this when interpolated into a new regular expression compiled outside a "use locale", and vice-versa.

Previously, a regular expression interpolated into another one inherited the localeness of the surrounding one, losing whatever state it originally had. This is considered a bug fix, but may trip up code that has come to rely on the incorrect behavior.

Directory handles not copied to threads

On systems that do not have a fchdir function, newly-created threads no longer inherit directory handles from their parent threads. Such programs would probably have crashed anyway [perl #75154].

Negation treats strings differently from before

The unary negation operator - now treats strings that look like numbers as numbers [perl #57706].

Negative zero

Negative zero (-0.0), when converted to a string, now becomes "0" on all platforms. It used to become "-0" on some, but "0" on others.

If you still need to determine whether a zero is negative, use sprintf("%g", $zero) =~ /^-/ or the Data::Float module on CPAN.

Performance Enhancements

Modules and Pragmata

Updated Modules and Pragmata

Documentation

Changes to Existing Documentation

perlapi

Diagnostics

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

Changes to Existing Diagnostics

Testing

Platform Support

Platform-Specific Notes

IRIX

Conversion of strings to floating-point numbers is now more accurate on IRIX systems [perl #32380].

Mac OS X

Early versions of Mac OS X (Darwin) had buggy implementations of the setregid, setreuid, setrgid and setruid functions, so perl would pretend they did not exist.

These functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and higher, as they have been fixed [perl #72990].

OpenVOS

perl now builds again with OpenVOS (formerly known as Stratus VOS) [perl #78132].

VMS

The shortening of symbols longer than 31 characters in the C sources is now done by the compiler rather than by xsubpp (which could only do so for generated symbols in XS code).

Windows

$Config{gccversion} is now set correctly when perl is built using the mingw64 compiler from http://mingw64.org [perl #73754].

The build process proceeds more smoothly with mingw and dmake when C:\MSYS\bin is in the PATH, due to a Cwd fix.

Internal Changes

Selected Bug Fixes

Errata

Acknowledgements

Perl 5.13.6 represents approximately one month of development since Perl 5.13.5 and contains 67920 lines of changes across 566 files from 47 authors and committers:

A. Sinan Unur, Aaron Crane, Alex Davies, Ali Polatel, Allen Smith, Andrew Rodland, Andy Dougherty, Ben Morrow, brian d foy, Casey West, Chip Salzenberg, Chris 'BinGOs' Williams, Craig A. Berry, David Golden, David Mitchell, Eric Brine, Father Chrysostomos, Florian Ragwitz, George Greer, gregor herrmann, Jan Dubois, Jerry D. Hedden, Jesse Vincent, Joshua Pritikin, Karl Williamson, kmx, Michael G Schwern, Mike Kelly, Nicholas Clark, Paul Green, Rafael Garcia-Suarez, Renee Baecker, Ricardo Signes, Sisyphus, Slaven Rezic, Steffen Müller, Steve Hay, Sullivan Beck, Tatsuhiko Miyagawa, Todd Rinaldo, Tony Cook, Tye McQueen, Vernon Lyon, Walt Mankowski, Zefram, Zsbán Ambrus, Ævar Arnfjörð Bjarmason.

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.

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 http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , 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 perlbug@perl.org 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 perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who 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.

SEE ALSO

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.