At today's virtual conference for Perl language developers the Perl 7 project, which will smoothly continue the development of the Perl 5 branch without radical changes. Perl 7 will be similar to the release , except for different default settings that better align with modern development practices. In all other respects, Perl 7 will remain the same Perl 5 and maintain compatibility with previously developed applications.
A significant change in the version number will act as a marker for the transition to a new model of enhancing the functionality of the Perl language without noticeably breaking backward compatibility.
It is expected that the creation of Perl 7 will help attract new developers to Perl and facilitate the process of adding significant new features to the language while maintaining compatibility with the existing codebase. The number 7 was chosen since Perl 6 was used in the development of the language, which is now under the separate name Raku. The first release of Perl 7 is anticipated next year. The Perl 5.32 branch will be the last in the Perl 5 series and is planned to be supported for 5 to 10 years.
The most noticeable change in Perl 7 will be the default inclusion of the "", which implies strict checking of variable declarations, the use of symbolic references, and subroutine assignment. Using "use strict" is considered good practice and is adopted by most developers. Similarly, handling warnings will also be planned to be enabled by default («).
In Perl 7, they also plan to stabilize and include by default some already existing experimental features such as ("use feature 'signatures'"), which allow for defining incoming arguments when declaring a function and automating the check for their number (it will be possible to write "sub foo ($left, $right) {" instead of "sub foo { my($left, $right) = @_;"). They also plan to include by default support for the "isa" operator to check whether an object is an instance of a specified class or a derived class ("if( $obj isa Package::Name )", and also postfix dereferencing operations "$sref->*$" instead of "\\${ $sref }", "$aref->@*$" instead of "@{ $aref }" and "$href->%{ … }" instead of "%$href{ … }".
The candidates for being disabled by default in Perl 7 are:
- Indirect object notation ("«) — an outdated method of calling objects, where a space is used instead of «->» («method $object @param» instead of «$object->method(@param)»). For example, instead of «my $cgi = new CGI», you will always need to use «my $cgi = CGI->new».
- Bare file descriptors without variable declaration (««) — using constructs like «open FH, $file» will result in an error; you should use «open my $fh, $file». This change will not affect the standard file descriptors STDIN, STDOUT, STDERR, ARGV, ARGVOUT, and DATA.
- Dummy multidimensional arrays and hashes in Perl 4 style (««).
For example, specifying «$hash{1, 2}» will result in an error; you need to use an intermediate array, like «$hash{join($;, 1, 2)}». - Prototype declarations in Perl 4 style (you need to use «use :prototype()»).
In more distant plans, Unicode support is expected to be included by default, relieving developers from specifying «use utf8» in the code. For modules and scripts that encounter issues with the new default settings, there is a way to revert to Perl 5 behavior by adding the line «use compat::perl5» to the code. Individual settings will also be preserved and can be changed separately.
Source: opennet.ru
