You are viewing the version of this documentation from Perl 5.37.10. This is a development version of Perl.

CONTENTS

NAME

perldelta - what is new for perl v5.37.10

DESCRIPTION

This document describes differences between the 5.37.9 release and the 5.37.10 release.

If you are upgrading from an earlier release such as 5.37.8, first read perl5379delta, which describes differences between 5.37.8 and 5.37.9.

Core Enhancements

Some gotos are now permitted in defer and finally blocks

Perl version 5.36.0 added defer blocks and permitted the finally keyword to also add similar behaviour to try/catch syntax. These did not permit any goto expression within the body, as it could have caused control flow to jump out of the block. Now, some goto expressions are allowed, if they have a constant target label, and that label is found within the block.

use feature 'defer';

defer {
  goto LABEL;
  print "This does not execute\n";
  LABEL: print "This does\n";
}

New regexp variable ${^LAST_SUCCESSFUL_PATTERN}

This allows access to the last succesful pattern that matched in the current scope. Many aspects of the regex engine refer to the "last successful pattern". The empty pattern reuses it, and all of the magic regex vars relate to it. This allows access to its pattern. The following code

if (m/foo/ || m/bar/) {
    s//PQR/;
}

can be rewritten as follows

if (m/foo/ || m/bar/) {
    s/${^LAST_SUCCESSFUL_PATTERN}/PQR/;
}

and it will do the exactly same thing.

Deprecation warnings now have specific subcategories

As of 5.37.10 all deprecation warnings will have their own specific deprecation category which can be disabled individually. You can see a list of all deprecated features in perldeprecation, and in warnings. The following list is from warnings:

+- deprecated ----+
|                 |
|                 +- deprecated::apostrophe_as_package_separator
|                 |
|                 +- deprecated::delimiter_will_be_paired
|                 |
|                 +- deprecated::dot_in_inc
|                 |
|                 +- deprecated::goto_construct
|                 |
|                 +- deprecated::smartmatch
|                 |
|                 +- deprecated::unicode_property_name
|                 |
|                 +- deprecated::version_downgrade

It is still possible to disable all deprecation warnings in a single statement with

no warnings 'deprecated';

but as of 5.37.10 it is possible to have a finer grained control. As has historically been the case these warnings are automatically enabled with

use warnings;

%{^HOOK} API introduced

For various reasons it can be difficult to create subroutine wrappers for some of perls keywords. Any keyword which has an undefined prototype simply cannot be wrapped with a subroutine, and some keywords which perl permits to be wrapped are in practice very tricky to wrap. For example require is tricky to wrap, it is possible but doing so changes the stack depth, and the standard methods of exporting assume that they will be exporting to a package at certain stack depth up the stack, and the wrapper will thus change where functions are exported to unless implemented with a great deal of care. This can be very awkward to deal with.

Accordingly we have introduced a new hash called %{^HOOK} which is intended to facilitate such cases. When a keyword supports any kind of special hook then the hook will live in this new hash. Hooks in this hash will be named after the function they are called by, followed by two underbars and then the phase they are executed in, currently either before or after the keyword is executed.

In this initial release we support two hooks require__before and require__after. These are provided to make it easier to perform tasks before and after a require statement.

See perlvar for more details.

Modules and Pragmata

Updated Modules and Pragmata

Documentation

Changes to Existing Documentation

We have attempted to update the documentation to reflect the changes listed in this document. If you find any we have missed, open an issue at https://github.com/Perl/perl5/issues/new/choose.

Additionally, the following selected changes have been made:

pod/perldebguts.pod

pod/perldeprecation.pod

pod/perlexperiment.pod

pod/perlexperiment.pod

pod/perlguts.pod

pod/perlop.pod

pod/perlvar.pod

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

Testing

Tests were added and changed to reflect the other additions and changes in this release. Furthermore, these significant changes were made:

Platform-Specific Notes

Windows
  • POSIX::dup2 no longer creates broken sockets. [GH #20920]

  • Closing a busy pipe could cause Perl to hang. [GH #19963]

Internal Changes

Selected Bug Fixes

Acknowledgements

Perl 5.37.10 represents approximately 4 weeks of development since Perl 5.37.9 and contains approximately 23,000 lines of changes across 360 files from 21 authors.

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

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

Arne Johannessen, Craig A. Berry, Dan Jacobson, David Mitchell, Elvin Aslanov, Graham Knop, James E Keenan, James Raspass, Jon Gentle, Karen Etheridge, Karl Williamson, Leon Timmermans, Lukas Mai, Paul Evans, Philippe Bruhat (BooK), Richard Leach, Steve Hay, Tomasz Konojacki, Tony Cook, 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 perl bug database at https://github.com/Perl/perl5/issues. There may also be information at http://www.perl.org/, the Perl Home Page.

If you believe you have an unreported bug, please open an issue at https://github.com/Perl/perl5/issues. Be sure to trim your bug down to a tiny but sufficient test case.

If the bug you are reporting has security implications which make it inappropriate to send to a public issue tracker, then see "SECURITY VULNERABILITY CONTACT INFORMATION" in perlsec for details of how to report the issue.

Give Thanks

If you wish to thank the Perl 5 Porters for the work we had done in Perl 5, you can do so by running the perlthanks program:

perlthanks

This will send an email to the Perl 5 Porters list with your show of thanks.

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.