On May 28, 2022, Perl 5.36 was released with a range of convenient features. Perl was once one of the most popular programming languages for web development worldwide; however, there is a broad division among developers today regarding it.
From the TIOBE Index for June 2022, it is apparent that Perl is no longer a popular programming language. Perl appears on the top 20 list, but it is ranked 17th, and very few people will mention it when discussing the best programming languages.
(Source: TIOBE Index for June 2022)
This is one of the most significant upgrades since 5.34, which may effectively enhance the developer experience.
Below are the core enhancements of Perl 5.36.0 (https://perldoc.perl.org/5.36.0/perldelta)
c
In light of these enhancements, is it likely that Perl will regain its leadership position.
Or, will it fade away in the near future?
Despite Perl's 30-year history, version 7 is still some way off
Perl, or the Practical Extraction and Report Language, was created by Larry Wall and released on December 18, 1987. It has become widely used for many tasks, including web programming, web development, system administration, GUI design, and more.
With features similar to those found in C, sed, awk, and shell scripts, Perl has one noteworthy advantage—its internal integration of regular expressions and the immense third-party library CPAN.
The 2.0 version of Perl was released in June 1988, and the 3.0 and 4.0 versions in 1989 and 1991, respectively. A substantial update to Perl was released in 1994, becoming the most widely used version of this programming language.
In 2015, Perl 6 (renamed Raku in 2019) was officially released on Christmas Day after having been in development for over a decade. In the name of the Perl 6 mascot, Camelia, Larry Wall announced the production availability of Perl 6. He also stressed that Perl was still a young language, meaning it was somewhat mature but had shortcomings.
Over the past four decades, Perl has experienced many ups and downs. Even though the final version 5.36.0 is "just around the corner," the much-anticipated Perl 7 remains a long way off, according to the Perl Steering Council.
Perl: There's more than one way to do it
In general, Perl is a natural and smart language that interprets execution in context and consists of a large number of omitted writes. As its programming motto goes, "There's More Than One Way to Do It."
When sed, awk, or sh are insufficient to solve the problem, or when you wish to run faster without having to write in C, Perl will save the day. It is suitable for text processing and system management, but it is less effective when dealing with real-time embedded system programming, underlying OS development (e.g., driver development), multi-thread shared memory applications, or other larger applications.
A dynamic language, Perl has an array of powerful and versatile features. It borrows syntax rules from many languages, like C/C++, Basic, and Pascal, resulting in a large number of redundant syntax constructs. Maybe that is why it is classified as "write-only"—despite the fact that it is free to write, it can produce unexpected results without reporting any errors. Furthermore, its code for realizing a given function is lengthy compared with other languages, which is a significant problem for programmers.
Today, more and more people are comfortable writing server scripts in Perl. In contrast to most web programming languages (PHP and JavaScript), Perl is executable directly. Each line of the source code is interpreted into machine code before execution, eliminating the need to compile the code.
One valuable feature of Perl is its ability to execute code and subroutines written in other languages. Furthermore, it supports a wide variety of processors, so developers can choose from a wide selection of libraries and modules. It is also suitable for database management, supporting SQL statements, and processing returned results.
Moreover, Perl has only three types of data—scalar, array, and hash. Scalar data is the simplest data type and consists of a single number, integer, text, or reference. It is often referred to as an array when a sequence of scalars is handled differently. A hash is a type of data that combines values and keys in a specific manner. In Perl, a value-key is represented as a scalar, while a text string represents a type.
Pros and Cons of Perl
Pros:
Regular expression: Text manipulation is one of Perl's most powerful capabilities. Regular expressions are found in many languages, but Perl is generally considered their inventor. Moreover, it is built-in, so no additional modules are required.
Flexibility: Perl supports three basic types of variables: scalars, arrays, and hashes. References can be used without worrying about memory leaks or unexpected computer shutdowns.
Unicode supported (vs. AWK or C).
Portability: Perl works well on the Web, UNIX, and even Windows. This is not a single tool but rather a jack-of-all-trades.
CPAN: You can find everything you need here. It is very easy to install modules through CPAN and is as good as apt-get in managing dependencies.
Cons:
As a dynamically typed language, it is not very reliable.
Since Perl is a natural language, Perl code may seem obscure and elusive.
As a smart language, it interprets the programmer's meaning based on context. There is, however, the possibility that its guesses are incorrect and may cause further problems.It is not very elegant and has multiple ways of doing the same thing, which can be difficult for programmers.
Perl's flexible data structure usually leads to unsatisfactory processing performance (relative to C/C++), and sometimes needs to be rewritten in another language to achieve high performance.
Perl's learning curve is shallow (easy to learn) and long (there's a lot you can do if you want). Simply read and follow the tutorial book "Learning Perl," and you will be able to write simple Perl programs. However, mastering Perl in-depth, such as its complex data structures, object-oriented programming, and multi-threaded programming, is not so easy without a great deal of time and effort.
Does Perl intend to be discarded?
A similar question appeared over ten years ago; however, Perl is still in use today. In addition to text processing, data mining, operations, bioinformatics, and many other fields, Perl is also used in many other Internet applications.
While Perl itself is an "old" language, it has a vibrant and productive community, and its value can be clearly seen in the CPAN library. A number of programmers may agree that CPAN is one of the most comprehensive and extensive libraries available for programming languages. CPAN provides access to thousands of modules and frameworks that can be used to achieve your desired outcomes.
Are you looking for a web server? HTTP :: Server is available. Do you require a standalone database? You can use Muldis :: DB. Whatever your needs, you can usually find several suitable modules and choose the one that suits your application the most.
Healthy competition among Ruby, Python, and other competitors is beneficial to Perl. Any new feature that other languages receive, the Perl community rewrites for it. For example, when Ruby was soaring on the success of Rails, Perl had its Dancer, which in many ways was superior to Rails.
No, Perl is not dying, nor is it disappearing anywhere. It doesn't get a lot of media attention, and few people are aware of its existence. But, whatever.
While Perl may not be suitable for application or CGI Web development, it is still a handy scripting language for data mining, Linux administration, and other process-oriented text processing analysis. It is also likely that Perl will remain in use for some time to come, as many auto-test tools are written in this programming language. The only downside is that Perl CGI development is fading out.
Conclusion
Perl still has a lot of value and potential; however, we must acknowledge that it is currently experiencing some difficulties. As the language becomes more accessible with modern features, modernizing it without compromising backward compatibility might unlock more potential.