X
Business

Perl will finally make the jump from Perl 5 to 7

Version 6 skipped due to becoming Raku, with 7 to be Perl 5.32 with new defaults.
Written by Chris Duckett, Contributor
perl7.png
Image: Sawyer X

Almost 26 years after it was first released, Perl is finally looking to upgrade its major version number from Perl 5, to Perl 7.

Speaking at the Perl Conference in the Cloud, project lead Sawyer X said Perl 7 would initially be Perl 5.32, which was released on June 20, but with some new defaults.

Examples of the new defaults to be enabled include forcing the use of strict and warnings in the language, with Sawyer X stating the rest was yet to be determined, but it would "definitely not" be unicode semantics.

Perl 7 will have a compatibility mode so that older code is still able to run, while Perl 5 will enter long-term support.

It is expected Perl 7 will be available in under a year, with a push to get the shift done in half the time, Sawyer X said.

"This support is expected to be tailed off between 2025 and 2030, allowing time for organisations to plan the changes needed to accommodate newer releases," the Perl Foundation said.

The ability will exist for Perl 7 code to be uploaded to CPAN, and a compatibility module will be applied so the code can run with the defaults of Perl 5, Sawyer X added.

The project lead pointed out that using Perl 5 in 2020, without any of the now ubiquitous stanza of use statements at the top of the file, leaves users with syntax developed around 2002 and most of the new functionality that has been developed since being hidden behind feature guards.

"Feature guards are very interesting, they guard the syntax. The idea is that it would never change unless you request it, which is a really good idea because it defends against undesired syntax and semantics," Sawyer X said.

"Feature guards although being really awesome, they actually have issues if you had not noticed them yet. The problem ... is that they are tribal knowledge, whether we like it or not.

"You have to know about them, not everyone does."

Perl's reputation for bad and confusing error messages was due to Perl 5 catering to a number of different styles of syntax, Sawyer X said, and it is something that a new major version will be able to address.

In October last year, Perl creator Larry Wall approved the renaming of Perl 6 as Raku, following almost two decades of work on version 6 that consequently saw Perl stuck using major version number 5. Early versions of Perl had been released on a one or two-year cadence.

Skipping a sixth major version of a language is not unprecedented, with PHP making the jump from 5 to 7 in 2015.

"More than just a new version or a number, it represents a sustainable path forward for the Perl language and community," cPanel vice president of product development Ken Power said.

"It represents an opportunity to rejuvenate interest in Perl, to attract new developers, to grow the community, and provide assurance for companies like cPanel that the language can meet the expectations of the modern developer."

Related Coverage

Editorial standards