Perl introduction
Perl, a feature-rich computer programming language, runs on more than 100 computer platforms and is suitable for a wide range of applications, from mainframes to portable devices, from rapid prototyping to large-scale extensible development.
Perl language has a wide range of applications. In addition to CGI, Perl is used in graphic programming, system management, network programming, finance, biology and other fields. Because of its flexibility, Perl is called the Swiss Army knife in scripting languages.
What is Perl?
Perl is a programming language designed by Larry Wall and constantly updatedand maintained by him.
Perl has the power and flexibility of high-level languages such as C #. In fact, you will see that many of its features are borrowed from the C language.
Perl is like scripting languages, Perl doesn’t need compilers and linkers to run code, all you have to do is write the program and tell Perl to run it. This means that Perl is ideal for quick solutions to small programming problems and for prototyping large events to test potential solutions.
Perl provides all the features of scripting languages such as sed and awk, as well as many features that they do not have. Perl also supports sed to Perl and awk to Perl translators.
In short, Perl is as powerful as C and as convenient as scripting languages such as awk and sed.
Perl advantages
Compared with “high-level” languages such as C and Pascal, Perl directly provides more convenient programming elements such as generic variables, dynamic arrays, Hash tables, and so on.
Perl not only has the powerful and flexible characteristics of dynamic language, but also borrows syntax rules from CpicurCure +, Basic, Pascal and other languages, thus providing a lot of redundant syntax.
Perl does a better job of unifying variable types and masking operational details than other high-level languages such as Python.
Due to the extensive use of syntax from other languages, programmers who transfer from other programming languages to Perl can quickly start handwritten programs and complete tasks, which makes Perl a language that is easy to use.
Perl is extensible, and we can use the `CPAN("the Comprehensive Perl Archive Network" comprehensive Perl archive network<http://cpan.perl.org/>`__ the central warehouse found a lot of modules we need.
Perl’s mod_perl allows the Apache web server to use the Perl interpreter
Perl shortcomings
It is precisely because of Perl’s flexibility and “excessive” redundant syntax that it has gained the reputation of “write-only”, because Perl programs can be written very casually (for example, variables can be used without declaration), but may get unexpected results (without reporting errors) with fewer letters, and the code of many Perl programs is difficult to read. The length of the program code that implements the same function can vary ten times and a hundred times, which makes it difficult for the maintainer (or even the writer) of the program to maintain.
Similarly, because of the casual nature of Perl, it may cause some Perl programmers to forget the syntax and have to check the Perl manual frequently.
The suggested solution is to use it in the program use strict
; and use warnings
and unify the code style, using libraries instead of using “hard coding” yourself. Perl can also write code books as elegantly as languages such as Python or Ruby.
A lot of times perl.exe
process takes up a lot of memory space, which is only temporary, but it doesn’t feel good.