A brief introduction to Perl language and its pros and cons
Source: Internet
Author: User
Perl is generally considered to be the abbreviation for practical extraction and report Language, a language evolved from C and sed, awk, Unix shell, and other languages. It was originally invented and implemented by the linguist Larry Wall. Perl is a language that is optimized for scanning arbitrary text files, getting information from these text files, and printing reports based on that information. It is also ideal for many systems management tasks. Perl is a cohesive language designed to be practical (easy-to-use, efficient, complete) rather than beautiful (graceful, compact). Its mascot is camel, take it is not beautiful but hard working, can work characteristics.
Perl does not arbitrarily limit the size of the data, as long as you have enough memory. The depth of recursion is also unrestricted. Associative array usage can be scaled to avoid performance degradation as needed. Perl can use complex pattern-matching techniques to quickly scan large amounts of data. Despite being good at working with text, Perl can handle binary data.
Perl 5 adds modular processing, object-oriented programming, introduction of references to handle complex data structures such as multidimensional arrays, Unicode support, and multithreading support, making Perl a more complete and powerful language. (above compiled from Perl manpage Perl language Introduction)
The motto of the Perl language is: There's more Than one Way to do It (TMTOWTDI, there are a number of ways to accomplish something, or "All roads lead to Beijing"). Perl is a natural and intelligent language that interprets execution according to context and has a large number of ellipsis.
Perl would be a good choice if you usually want to use SED, awk, or SH to solve the problem, but find that they are not capable enough, or want to run faster, but don't want to write foolishly in C. Perl specializes in text processing and system management, not for real-time embedded system programming, operating system low-level development (such as driver development), complex multiple linear shared memory applications, and extremely large applications.
The advantages of the Perl language:
* Powerful regular expressions and pattern matching functions (close to the ideal regular expression language)
* Complex and flexible data structures (array of array, array of Hash,hash of array, hash of hash, etc.)
*unicode Support (relative to awk and C)
The disadvantages are:
* Dynamic type language, not very reliable
* Natural language, is the advantage is also a flaw, make Perl language code may obscure;
* Intelligent language, is the advantages and disadvantages: According to the context of the programmer to explain the meaning, may produce assumptions, and thus create a variety of programming traps.
* Not very graceful. A variety of ways to do things, sometimes let the programmer at a loss.
* Performance issues. Perl's flexible data structure and processing performance are usually not very high (relative to C/s), and sometimes requiring high-performance processing requires other language overrides.
The learning curve of the Perl language is shallow and long. If you look at Learning Perl, you can write a simple Perl program, but in order to get a deeper grip on Perl, it's not easy to use Perl's complex data structures, object-oriented programming, multithreaded programming, and it takes a long time to learn and practice.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.