Perl 7 will smoothly continue the development of Perl 5 without breaking backwards compatibility

Perl 7 will smoothly continue the development of Perl 5 without breaking backwards compatibility

The Perl Project Governing Board summarized the plans to further develop the Perl 5 branch and create the Perl 7 branch. When breaking compatibility is necessary to fix vulnerabilities. The Council also concluded that the language should evolve and promote new features more intensively, while making it easier to access emerging innovations and encourage their adoption.

Contrary to the original intention of allowing backward-compatibility changes to be included by default in the Perl 7 branch, the new plan is to gradually transition the Perl 5 branch to Perl 7 without breaking backward compatibility with existing code. The release of Perl 7.0 will not be conceptually different from the next branch of Perl 5.xx.

Development of new releases of Perl 5 will continue as before – new features added to the branch that are incompatible with the old code will still be included only if the “use version” or “use feature feature” pragma is explicitly specified in the code. For example, Perl 5.010 introduced a new “say” keyword, but since existing code could use functions named “say”, support for the new keyword was only enabled by explicitly specifying the “use feature ‘say'” pragma.

New syntax added to the language that resulted in an error when processed in previous releases is immediately available without the need to specify special pragmas. For example, Perl 5.36 will introduce a simplified syntax for handling multiple list values ​​at once (“foreach my ($key, $value) (%hash) {“), which will be available immediately, even in code without the “use v5.36” pragma.

In its current form in Perl 5.36, using the “use v5.36” pragma activates 13 incompatible features (‘say’, ‘state’, ‘current_sub’, ‘fc’, ‘lexical_subs’, ‘signatures’, ‘isa’, ‘ bareword_filehandles’, ‘bitwise’, ‘evalbytes’, ‘postderef_qq’, ‘unicode_eval’ and ‘unicode_strings’), enable “use strict” and “use warnings” modes by default, and disable support for obsolete indirect object calling notation (when instead of “- >” uses a space) and Perl 4 style multidimensional arrays and hashes (“$hash{1, 2}”).

When enough changes accumulate, the next release of Perl 5.x will be replaced by Perl 7.0, which will be a kind of state snapshot, but will remain fully backward compatible with Perl 5. In order to include breaking changes and tweaks, you will need to explicitly add the “use v7” pragma to the code “. That is, code with the “use v7” pragma can be interpreted as “modern Perl” in which language-breaking changes are available, and without – “conservative Perl”, which will remain fully backwards compatible with past releases.

Be the first to comment

Leave a Reply

Your email address will not be published.


*