NAME

perldelta - what is new for perl v5.25.7

DESCRIPTION

This document describes differences between the 5.25.6 release and the 5.25.7 release.

If you are upgrading from an earlier release such as 5.25.5, first read perl5256delta, which describes differences between 5.25.5 and 5.25.6.

Core Enhancements

Indented Here-documents

This adds a new modifier '~' to here-docs that tells the parser that it should look for /^\s*$DELIM\n/ as the closing delimiter.

These syntaxes are all supported:

    <<~EOF;
    <<~\EOF;
    <<~'EOF';
    <<~"EOF";
    <<~`EOF`;
    <<~ 'EOF';
    <<~ "EOF";
    <<~ `EOF`;

The '~' modifier will strip, from each line in the here-doc, the same whitespace that appears before the delimiter.

Newlines will be copied as is, and lines that don't include the proper beginning whitespace will cause perl to croak.

For example:

    if (1) {
      print <<~EOF;
        Hello there
        EOF
    }

prints "Hello there\n" with no leading whitespace.

'.' and @INC

Perl now provides a way to build perl without . in @INC by default. If you want this feature, you can build with -Ddefault_inc_excludes_dot

Because the testing / make process for perl modules do not function well with . missing from @INC, Perl now supports the environment variable PERL_USE_UNSAFE_INC=1 which makes Perl behave as it previously did, returning . to @INC in all child processes.

WARNING: PERL_USE_UNSAFE_INC has been provided during the perl 5.25 development cycle and is not guaranteed to function in perl 5.26.

create a safer utf8_hop() called utf8_hop_safe()

Unlike utf8_hop(), utf8_hop_safe() won't navigate before the beginning or after the end of the supplied buffer.

Fix taint handling in list assignment

commit v5.25.6-79-gb09ed99 reworked list assignment, and accidentally broke taint handling at the same time.

@{^CAPTURE}, %{^CAPTURE}, and %{^CAPTURE_ALL}

@{^CAPTURE} exposes the capture buffers of the last match as an array. So $1 is ${^CAPTURE}[0].

%{^CAPTURE} is the equivalent to %+ (ie named captures)

%{^CAPTURE_ALL} is the equivalent to %- (ie all named captures).

op.c: silence compiler warning in fold_constants()

    op.c: In function ‘S_fold_constants’:
    op.c:4374:28: warning: argument ‘o’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
     S_fold_constants(pTHX_ OP *o)
                                ^

This warning has been silenced.

Performance Enhancements

  • Reduce cost of SvVALID().

  • $ref1 = $ref2 has been optimized.

  • Array and hash assignment are now faster, e.g.

        (..., @a) = (...);
        (..., %h) = (...);

    especially when the RHS is empty.

  • Reduce the number of odd special cases for the SvSCREAM flag.

  • Avoid sv_catpvn() in do_vop() when unneeded.

  • Enhancements in Regex concat COW implementation.

  • Speed up AV and HV clearing/undeffing.

  • Better optimise array and hash assignment

Modules and Pragmata

Updated Modules and Pragmata

  • podlators has been upgraded from version 4.08 to 4.09.

  • Archive::Tar has been upgraded from version 2.14 to 2.18.

  • B has been upgraded from version 1.64 to 1.65.

  • Data::Dumper has been upgraded from version 2.162 to 2.165.

    The XS implementation now supports Deparse.

  • Devel::Peek has been upgraded from version 1.25 to 1.26.

  • DynaLoader has been upgraded from version 1.39 to 1.40.

  • Errno has been upgraded from version 1.26 to 1.27.

    Document that using %! loads Errno for you.

  • File::Spec has been upgraded from version 3.65 to 3.66.

  • Hash::Util has been upgraded from version 0.21 to 0.22.

  • JSON::PP has been upgraded from version 2.27400_01 to 2.27400_02.

  • List::Util has been upgraded from version 1.46 to 1.46_02.

  • Math::BigInt has been upgraded from version 1.999726(_01) to 1.999727.

    There have also been some core customizations.

  • Math::Complex has been upgraded from version 1.59 to 1.5901.

  • Module::CoreList has been upgraded from version 5.20161020 to 5.20161120.

  • mro has been upgraded from version 1.19 to 1.20.

  • Net::Ping has been upgraded from version 2.51 to 2.55.

    Remove sudo from 500_ping_icmp.t.

    Avoid stderr noise in tests

    Check for echo in new Net::Ping tests.

  • Opcode has been upgraded from version 1.38 to 1.39.

  • POSIX has been upgraded from version 1.73 to 1.75.

  • Scalar::Util has been upgraded from version 1.46 to 1.46_02.

  • Storable has been upgraded from version 2.58 to 2.59.

  • Term::ANSIColor has been upgraded from version 4.05 to 4.06.

  • Test::Simple has been upgraded from version 1.302059 to 1.302062.

  • threads has been upgraded from version 2.09 to 2.10.

  • Time::HiRes has been upgraded from version 1.9740_01 to 1.9740_03.

    Now uses clockid_t.

  • Unicode::Collate has been upgraded from version 1.14 to 1.18.

  • Unicode::Normalize is now maintained by p5p and has been moved to dist/

  • Unicode::UCD has been upgraded from version 0.66 to 0.67.

  • XS::Typemap has been upgraded from version 0.14 to 0.15.

Documentation

Changes to Existing Documentation

perlfunc

  • Defined on aggregates is no longer allowed. Perlfunc was still reporting it as deprecated, and that it will be deleted in the future.

perldata

  • Use of single character variables, with the variable name a non printable character in the range \x80-\xFF is no longer allowed. Update the docs to reflect this.

perlobj

  • Added a section on calling methods using their fully qualified names.

  • Do not discourage manual @ISA.

perlop

  • Clarify behavior single quote regexps.

perllocale

  • Some locales aren't compatible with Perl. Note the potential bad consequences of using them.

perldiag

  • Deprecations are to be marked with a D. "%s() is deprecated on :utf8 handles" use a deprecation message, and as such, such be marked "(D deprecated)" and not "(W deprecated)".

perlguts

  • add pTHX_ to magic method examples.

perlvar

  • Document @ISA. Was documented other places, not not in perlvar.

perlootut

  • Tidy the document.

  • Mention Moo more.

perlhack

  • Document Tab VS Space.

perlre

  • Several minor enhancements to the documentation.

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

  • Improve error for missing tie() package/method. This brings the error messages in line with the ones used for normal method calls, despite not using call_method().

  • Make the sysread()/syswrite/() etc :utf8 handle warnings default. These warnings were under 'deprecated' previously.

  • 'do' errors now refer to 'do' (not 'require').

Utility Changes

  • Porting/pod_lib.pl

    Removed spurious executable bit.

    Account for possibility of DOS file endings.

  • perf/benchmarks

    Tidy file, rename some symbols.

  • Porting/checkAUTHORS.pl

    Replace obscure character range with \w.

  • t/porting/regen.t

    try to be more helpful when tests fail.

  • utils/h2xs.PL

    Avoid infinite loop for enums.

Configuration and Compilation

  • Remove "Warning: perl appears in your path"

    This install warning is more or less obsolete, since most platforms already *will* have a /usr/bin/perl or similar provided by the OS.

  • Reduce verbosity of "make install.man"

    Previously, two progress messages were emitted for each manpage: one by installman itself, and one by the function in install_lib.pl that it calls to actually install the file. Disabling the second of those in each case saves over 750 lines of unhelpful output.

  • Cleanup for clang -Weverything support. [perl 129961]

  • Configure: signbit scan was assuming too much, stop assuming negative 0.

  • Various compiler warnings have been silenced.

  • Several smaller changes have been made to remove impediments to compiling under C++11.

Testing

  • XS-APItest/t/utf8.t: Several small fixes and enhancements.

  • Tests for locales were erroneously using locales incompatible with Perl.

Platform Support

Platform-Specific Notes

Darwin

don't treat -Dprefix=/usr as special, instead require an extra option -Ddarwin_distribution to produce the same results.

POSIX

Finish removing POSIX deprecated functions.

OS X

OS X El Capitan doesn't implement the clock_gettime() or clock_getres() APIs, emulate them as necessary.

macOS

Deprecated syscall(2) on macOS 10.12.

EBCDIC

Several tests have been updated to work (or be skipped) on EBCDIC platforms.

HP-UX

Net::Ping UDP test is skipped on HP-UX.

VMS

Move _pDEPTH and _aDEPTH after config.h otherwise DEBUGGING may not be defined yet.

VAXC has not been a possibility for a good long while, and the versions of the DEC/Compaq/HP/VSI C compiler that report themselves as "DEC" in a listing file are 15 years or more out-of-date and can be safely desupported.

VMS And Win32

Fix some breakage, add 'undef' value for default_inc_excludes_dot in build scripts.

Linux

Drop support for Linux a.out Linux has used ELF for over twenty years.

NetBSD-VAX

Test fixes and minor updates.

Account for lack of inf, nan, and -0.0 support.

Win32

fp definitions have been updated.

OpenBSD 6

OpenBSD 6 still does not support returning pid, gid or uid with SA_SIGINFO. Make sure this is accounted for.

FreeBSD

t/uni/overload.t: Skip hanging test on FreeBSD.

Internal Changes

  • The meanings of some internal SV flags have been changed

    OPpRUNTIME, SVpbm_VALID, SVpbm_TAIL, SvTAIL_on, SvTAIL_off, SVrepl_EVAL, SvEVALED

  • Change hv_fetch(…, "…", …, …) to hv_fetchs(…, "…", …)

    The dual-life dists all use Devel::PPPort, so they can use this function even though it was only added in 5.10.

Selected Bug Fixes

  • Handle SvIMMORTALs in LHS of list assign. [perl #129991]

  • [perl #130010] a5540cf breaks texinfo

    This involved user-defined Unicode properties.

  • Fix error message for unclosed \N{ in regcomp.

    An unclosed \N{ could give the wrong error message "\N{NAME} must be resolved by the lexer".

  • List assignment in list context where the LHS contained aggregates and where there were not enough RHS elements, used to skip scalar lvalues. Previously, (($a,$b,@c,$d) = (1)) in list context returned ($a); now it returns ($a,$b,$d). (($a,$b,$c) = (1)) is unchanged: it still returns ($a,$b,$c). This can be seen in the following:

        sub inc { $_++ for @_ }
        inc(($a,$b,@c,$d) = (10))

    Formerly, the values of ($a,$b,$d) would be left as (11,undef,undef); now they are (11,1,1).

  • [perl 129903]

    The basic problem is that code like this: /(?{ s!!! })/ can trigger infinite recursion on the C stack (not the normal perl stack) when the last successful pattern in scope is itself. Since the C stack overflows this manifests as an untrappable error/segfault, which then kills perl.

    We avoid the segfault by simply forbidding the use of the empty pattern when it would resolve to the currently executing pattern.

  • [perl 128997] Avoid reading beyond the end of the line buffer when there's a short UTF-8 character at the end.

  • [perl 129950] fix firstchar bitmap under utf8 with prefix optimisation.

  • [perl 129954] Carp/t/arg_string.t: be liberal in f/p formats.

  • [perl 129928] make do "a\0b" fail silently instead of throwing.

  • [perl 129130] make chdir allocate the stack it needs.

Acknowledgements

Perl 5.25.7 represents approximately 4 weeks of development since Perl 5.25.6 and contains approximately 83,000 lines of changes across 630 files from 26 authors.

Excluding auto-generated files, documentation and release tools, there were approximately 13,000 lines of changes to 340 .pm, .t, .c and .h files.

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

Aaron Crane, Abigail, Andrew Fresh, Andy Lester, Aristotle Pagaltzis, Chad Granum, Chris 'BinGOs' Williams, Craig A. Berry, Dagfinn Ilmari Mannsåker, Dan Collins, Dave Rolsky, David Mitchell, Hauke D, H.Merijn Brand, Hugo van der Sanden, James E Keenan, Jarkko Hietaniemi, Karl Williamson, Lukas Mai, Matthew Horsfall, Nicolas R., Stefan Seifert, Steve Hay, Todd Rinaldo, Tony Cook, 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 perl bug database at https://rt.perl.org/ . 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 see "SECURITY VULNERABILITY CONTACT INFORMATION" in perlsec for details of how to report the issue.

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.