NAME

perl5172delta - what is new for perl v5.17.2

DESCRIPTION

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

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

Core Enhancements

kill with negative signal names

kill has always allowed a negative signal number, which kills the process group instead of a single process. It has also allowed signal names. But it did not behave consistently, because negative signal names were treated as 0. Now negative signals names like -INT are supported and treated the same way as -2 [perl #112990].

pack is now constant folded.

pack with constant arguments is now constant folded in most cases [perl #113470].

Modules and Pragmata

Updated Modules and Pragmata

  • File::stat has been upgraded from version 1.06 to 1.07.

    Previously File::stat's overloaded -x and -X operators did not give the correct results for directories or executable files when running as root. They had been treating executable permissions for root just like for any other user, performing group membership tests etc for files not owned by root. They now follow the correct Unix behaviour - for a directory they are always true, and for a file if any of the three execute permission bits are set then they report that root can execute the file. Perl's builtin -x and -X operators have always been correct.

  • Tie::StdHandle has been upgraded from version 4.2 to 4.3.

    READ now respects the offset argument to read [perl #112826].

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

    IO::Socket tries harder to cache or otherwise fetch socket information.

  • Storable has been upgraded from version 2.36 to 2.37.

    Restricted hashes were not always thawed correctly [perl #73972].

    Storable would croak when freezing a blessed REF object with a STORABLE_freeze() method [perl #113880].

  • Socket has been upgraded from version 2.001 to 2.002.

  • autodie has been upgraded from version 2.11 to 2.12.

    autodie now plays nicely with the 'open' pragma.

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

    Added the 'file_default' option for URLs that do not have a file component.

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

Documentation

Changes to Existing Documentation

perlfunc

  • Clarified documentation of our.

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.

New Diagnostics

New Errors

New Warnings

Changes to Existing Diagnostics

  • The 'Can't use "my %s" in sort comparison' error has been downgraded to a warning, '"my %s" used in sort comparison' (with 'state' instead of 'my' for state variables). In addition, the heuristics for guessing whether lexical $a or $b has been misused have been improved to generate fewer false positives. Lexical $a and $b are no longer disallowed if they are outside the sort block. Also, a named unary or list operator inside the sort block no longer causes the $a or $b to be ignored [perl #86136].

Configuration and Compilation

  • Building perl with some Windows compilers used to fail due to a problem with miniperl's glob operator (which uses the perlglob program) deleting the PATH environment variable [perl #113798].

Platform Support

Platform-Specific Notes

VMS

Quotes are now removed from the command verb (but not the parameters) for commands spawned via system, backticks, or a piped open. Previously, quotes on the verb were passed through to DCL, which would fail to recognize the command. Also, if the verb is actually a path to an image or command procedure on an ODS-5 volume, quoting it now allows the path to contain spaces.

AIX

Configure now always adds -qlanglvl=extc99 to the CC flags on AIX when using xlC. This will make it easier to compile a number of XS-based modules that assume C99 [perl #113778].

Internal Changes

  • Perl used to implement get magic in a way that would sometimes hide bugs in code could call mg_get() too many times on magical values. This hiding of errors no longer occurs, so long-standing bugs may become visible now. If you see magic-related errors in XS code, check to make sure it, together with the Perl API functions it uses, calls mg_get() only once on SvGMAGICAL() values.

  • OP allocation for CVs now uses a slab allocator. This simplifies memory management for OPs allocated to a CV, so cleaning up after a compilation error is simpler and safer [perl #111462][perl #112312].

  • PERL_DEBUG_READONLY_OPS has been rewritten to work with the new slab allocator, allowing it to catch more violations than before.

  • The old slab allocator for ops, which was only enabled for PERL_IMPLICIT_SYS and PERL_DEBUG_READONLY_OPS, has been retired.

Selected Bug Fixes

  • A regression introduced in v5.14.0 has been fixed, in which some calls to the re module would clobber $_ [perl #113750].

  • do FILE now always either sets or clears $@, even when the file can't be read. This ensures that testing $@ first (as recommended by the documentation) always returns the correct result.

  • The array iterator used for the each @array construct is now correctly reset when @array is cleared (RT #75596). This happens for example when the array is globally assigned to, as in @array = (...), but not when its values are assigned to. In terms of the XS API, it means that av_clear() will now reset the iterator.

    This mirrors the behaviour of the hash iterator when the hash is cleared.

  • $class->can, $class->isa, and $class->DOES now return correct results, regardless of whether that package referred to by $class exists [perl #47113].

  • Arriving signals no longer clear $@ [perl #45173].

  • Allow my () declarations with an empty variable list [perl #113554].

  • During parsing, subs declared after errors no longer leave stubs [perl #113712].

  • Closures containing no string evals no longer hang on to their containing subroutines, allowing variables closed over by outer subroutines to be freed when the outer sub is freed, even if the inner sub still exists [perl #89544].

  • Duplication of in-memory filehandles by opening with a "<&=" or ">&=" mode stopped working properly in 5.16.0. It was causing the new handle to reference a different scalar variable. This has been fixed [perl #113764].

  • qr// expressions no longer crash with custom regular expression engines that do not set offs at regular expression compilation time [perl #112962].

  • delete local no longer crashes with certain magical arrays and hashes [perl #112966].

  • local on elements of certain magical arrays and hashes used not to arrange to have the element deleted on scope exit, even if the element did not exist before local.

  • scalar(write) no longer returns multiple items [perl #73690].

  • String to floating point conversions no longer misparse certain strings under use locale [perl #109318].

  • @INC filters that die no longer leak memory [perl #92252].

  • The implementations of overloaded operations are now called in the correct context. This allows, among other things, being able to properly override <> [perl #47119].

  • Specifying only the fallback key when calling use overload now behaves properly [perl #113010].

  • sub foo { my $a = 0; while ($a) { ... } } and sub foo { while (0) { ... } } now return the same thing [perl #73618].

  • Fixed the debugger l and M commands, and other debugger functionality which was broken in 5.17.0 [perl #113918].

  • String negation now behaves the same under use integer; as it does without [perl #113012].

  • chr now returns the Unicode replacement character (U+FFFD) for -1, regardless of the internal representation. -1 used to wrap if the argument was tied or a string internally.

  • Using a format after its enclosing sub was freed could crash as of perl 5.12.0, if the format referenced lexical variables from the outer sub.

  • Using a format after its enclosing sub was undefined could crash as of perl 5.10.0, if the format referenced lexical variables from the outer sub.

  • Using a format defined inside a closures, which format references lexical variables from outside, never really worked unless the write call was directly inside the closure. In 5.10.0 it even started crashing. Now the copy of that closure nearest the top of the call stack is used to find those variables.

  • Formats that close over variables in special blocks no longer crash if a stub exists with the same name as the special block before the special block is compiled.

  • The parser no longer gets confused, treating eval foo () as a syntax error if preceded by print; [perl #16249].

  • The return value of syscall is no longer truncated on 64-bit platforms [perl #113980].

  • Constant folding no longer causes print 1 ? FOO : BAR to print to the FOO handle [perl #78064].

  • do subname now calls the named subroutine and uses the file name it returns, instead of opening a file named "subname".

  • Subroutines looked up by rv2cv check hooks (registered by XS modules) are now taken into consideration when determining whether foo bar should be the sub call foo(bar) or the method call "bar"->foo.

  • CORE::foo::bar is no longer treated specially, allowing global overrides to be called directly via CORE::GLOBAL::uc(...) [perl #113016].

  • Calling an undefined sub whose typeglob has been undefined now produces the customary "Undefined subroutine called" error, instead of "Not a CODE reference".

  • Two bugs involving @ISA have been fixed. *ISA = *glob_without_array and undef *ISA; @{*ISA} would prevent future modifications to @ISA from updating the internal caches used to look up methods. The *glob_without_array case was a regression from Perl 5.12.

  • Regular expression optimisations sometimes caused $ with /m to produce failed or incorrect matches [perl #114068].

  • __SUB__ now works in a sort block when the enclosing subroutine is predeclared with sub foo; syntax [perl #113710].

  • Unicode properties only apply to Unicode code points, which leads to some subtleties when regular expressions are matched against above-Unicode code points. There is a warning generated to draw your attention to this. However, this warning was being generated inappropriately in some cases, such as when a program was being parsed. Non-Unicode matches such as \w and [:word;] should not generate the warning, as their definitions don't limit them to apply to only Unicode code points. Now the message is only generated when matching against \p{} and \P{}. There remains a bug, [perl #114148], for the very few properties in Unicode that match just a single code point. The warning is not generated if they are matched against an above-Unicode code point.

Acknowledgements

Perl 5.17.2 represents approximately 4 weeks of development since Perl 5.17.1 and contains approximately 15,000 lines of changes across 320 files from 34 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.2:

Aristotle Pagaltzis, Brian Fraser, Chip Salzenberg, Chris 'BinGOs' Williams, Colin Kuskie, Craig A. Berry, Daniel Dragan, Daniel Perrett, Darin McBride, David Golden, David Mitchell, Dominic Hargreaves, E. Choroba, Eric Brine, Father Chrysostomos, François Perrad, H.Merijn Brand, Jan Dubois, Jesse Luehrs, Karl Williamson, Lukas Mai, Matthew Horsfall, Nicholas Clark, Oleg Nesterov, Reini Urban, Ricardo Signes, Robin Barker, Shirakata Kentaro, Shlomi Fish, Steve Hay, Tony Cook, Vincent Pit, Walt Mankowski, Yves Orton.

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 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 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.

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.