1. Perl
  2. Version information
  3. here

Perl 5.18 has been released

Perl 5.18 has been released. Crackling crackling.

Perl 5.18.0

Points to note when upgrading the version

I feel that it is better to wait for a while to upgrade to Perl 5.18 this time.

First, Perl's keys, values, and each now return a different key/value order each time they are executed, which causes problems with implementations that expect the same order. It seems that JSON::XS is now known to fail the test. So I'm a little worried as long as there are modules on CPAN that don't test well for a while.

This seems to be the Perl community's decision that security is more important.

Next, the given - when syntax and smart match (~~) introduced in the Perl 5.10 migration have been reverted to experimental functionality. If you are using the given - when syntax, smart match, you will get an experimental warning. You can disable the warnings with "no warnings'experimental'", but this is not recommended as the implementation and behavior of smart matches is very likely to change in the future.

If you are using the given - when syntax, smart match, it is recommended to rewrite it to a method that does not use it. Check for Perl files using given or smart match with the following command.

grep -r'~~' dir | grep -e'\ .p [lm]'
grep -re'given\+ ('dir | grep -e'\ .p [lm]'

If you are using the smart match operator, replace it with the normal operators "eq" and "==" .

$var ~~ 1->defined $var && $var == 1
$var ~~ [1, 2]->(defined $var && $var == 1) || (defined $var && $var == 2)

Let's rewrite given when as a normal if statement.

Also, as a deleted syntax, qw(...) in for statement can no longer be used in parentheses.

# abolition
for my $str qw(a b) {
  
}

# Rewrite
for my $str (qw(a b)) {

}

As mentioned above, there are some changes that break compatibility and are not so unlikely to be used, so it seems that testing is essential this time when upgrading.

CPAN module removed from core in next version

The following modules will be deprecated in Perl 5.18 and will be removed from the Perl core in a future version. If you're using it, you can rest assured that you can install and use it from CPAN.

The encoding pragma is deprecated. Encoding pragmas are deprecated and should not be used. When dealing with Japanese, use the utf8 pragma and the Encode module.

CPAN PLUS is scheduled to be abolished. There is also cpan, and there is a simple and convenient cpanm, so it seems that CPANPLUS is not necessary for the core.

In addition, Module::Pluggable, Log::Message, Object::Accessor, etc. are deprecated.

encoding

Archive::Extract

B::Lint

B::Lint::Debug

CPANPLUS

CPANPLUS::Backend

CPANPLUS::Backend::RV

CPANPLUS::Config

CPANPLUS::Config::HomeEnv

CPANPLUS::Configure

CPANPLUS::Configure::Setup

CPANPLUS::Dist

CPANPLUS::Dist::Autobundle

CPANPLUS::Dist::Base

CPANPLUS::Dist::Build

CPANPLUS::Dist::Build::Constants

CPANPLUS::Dist::MM

CPANPLUS::Dist::Example

CPANPLUS::Error

CPANPLUS::Internals

CPANPLUS::Internals::Constants

CPANPLUS::Internals::Constants::Report

CPANPLUS::Internals::Extract

CPANPLUS::Internals::Fetch

CPANPLUS::Internals::Report

CPANPLUS::Internals::Search

CPANPLUS::Internals::Source

CPANPLUS::Internals::Source::Memory

CPANPLUS::Internals::Source::SQLite

CPANPLUS::Internals::Source::SQLite::Tie

CPANPLUS::Internals::Utils

CPANPLUS::Internals::Utils::Autoflush

CPANPLUS::Module

CPANPLUS::Module::Author

CPANPLUS::Module::Author::Fake

CPANPLUS::Module::Checksums

CPANPLUS::Module::Fake

CPANPLUS::Module::Signature

CPANPLUS::Selfupdate

CPANPLUS::Shell

CPANPLUS::Shell::Classic

CPANPLUS::Shell::Default

CPANPLUS::Shell::Default::Plugins::CustomSource

CPANPLUS::Shell::Default::Plugins::Remote

CPANPLUS::Shell::Default::Plugins::Source

Devel::InnerPackage

Log::Message

Log::Message::Config

Log::Message::Handlers

Log::Message::Item

Log::Message::Simple

Module::Pluggable

Module::Pluggable::Object

Object::Accessor

Term::UI

Term::UI::History

Addition of new functions

Introduction of experimental pragma

An experimental pragma has been introduced. The newly added function was released with an experimental warning, and at a stable stage, the experimental warning was changed to a non-existent operation.

Lexical Subroutine

As an experimental feature, the ability to define lexical subroutine has been added.

use 5.018;
no warnings "experimental::lexical_subs";
use feature "lexical_subs";
{
  my sub foo {...}
}

All Perl subroutine definitions were global, but it looks like you'll be able to write subroutine that are valid only within scope.

You can also use our, which is valid only in the package.

{
  our sub foo {...}
}

Support for Unicode 6.2

Perl now supports Unicode 6.2. Note that\n {BELL} has an incompatible change that he now refers to U + 1F514 instead of U + 0007. "BELL" refers to U + 1F514 and U + 0007 is now named "ALERT".

The kill function can now be specified as " - INT"

The kill function can now be specified as "-INT" to send a signal to a group by signal name.

Related Informatrion