SoFunction
Updated on 2025-04-08

One of the FAQs collections of perl

What is Perl?

Perl is an advanced programming language written by Larry Wall and many others, integrating the characteristics of many languages. It evolved primarily from the ubiquitous C language, followed by sed, awk, UNIX shell and at least a dozen other tools and languages. Perl has strong processing and transformation capabilities for process, archives, and text. Therefore, all tasks such as rapid prototyping, system tools, software tools, system management, database connections, image programming, network connections, and WWW programming are particularly suitable for using Perl. These expertise not only make Perl a favorite among system maintenance managers and CGI authors, but even mathematicians, geneticists, journalists, and even business managers use Perl, so maybe you should use it too.

Who provides support for perl? Who is responsible for the development? Why is it free?

Perl's free and open distribution method is attributed to the traditional culture of the Internet before the fever and its author Larry Wall. Perl is supported by users. Now Perl's core, standard libraries, optionally installed modules, and the instructions you are reading now are all from the hands of the obligor. For details, please see the private notation at the bottom of the README file attached in the perl original code release.

It is worth mentioning that the members of the Core Development Group (called Perl Porters) are a group of highly enthusiastic and dedicated people who devote themselves to developing free software that is better than you can imagine and can buy with money. You can obtain information on recent development plans via news:///-gw/ and http:///~gnat/perl/porters/.

Although GNU plans to include Perl in its release, there is no such thing as "GNU Perl". Perl is neither created by the Free Software Foundation nor is it responsible for maintaining it. Perl's issuance terms are also more open than GNU software.

If you prefer, you can purchase commercial Perl support. But informal support is usually quite sufficient for most users. For details, please see the answer to the question "Where can you buy commercial Perl support" question.

Which version of Perl should I use?

You should definitely use the fifth edition. The fourth version is not only old and has limited functions, but is no longer maintained. Its last correction (4.036) was in 1992. Perl's latest mass production release is 5.004. By the time you read this article, we may have released several official versions of the error debugging, and at the same time, it may be a bit of experimental version for the next version. From this article, any mention of Perl language is subject to the current mass production and issuance, unless otherwise specified.

What do perl4 and perl5 represent?

perl4 and perl5 are informal names for two different versions of the Perl programming language, because it is easier to say "perl5" than "perl of version 5 (.004). But some people mistakenly think it is: perl5 is a separate language; this is incorrect. perl5 is just a common name for the fifth major release (October 1994). Just like perl4 refers to the fourth major issuance (March 1991), there are perl1 (January 1988), perl2 (June 1988), and perl3 (October 1989).

The release of 5.0 is basically a version that starts from scratch, and all the code has been completely rewritten. It has been modularized, object-oriented, fine-tuned, simplified, and efficient, so that the code has almost become different from the original one. Nevertheless, the usage interface is roughly the same and has high consistency with previous versions.

In order to avoid confusion like "What language is perl5?", some people simply avoid "perl5" completely and use "perl" alone to refer to the recent perl version. In fact, there is no need to be so tired.

Has Perl's development stabilized?

Mass production and distribution that combines debugging and new features have undergone extensive testing before launch. Since the release of 5.000, we have published mass production and distribution on average once a year.

Larry and Perl Development Group sometimes modify the core parts of the language, but always do everything possible to keep the new version consistent with the old version. Therefore, although not all perl4 scripts can run seamlessly under perl5, upgrades have almost never happened if the program written in previous versions of perl is unusable (unless the program relies on bugs that have been removed, or uses a very small number of newly added instructions to name it).

Is Perl difficult to learn?

Perl is not only easy to get started, but also easy to continue learning. It looks the same as most languages ​​you may have been exposed to. So if you've only written C programs, or awk script, shell script, or even just a macro of Excel, you're already halfway.

Most tasks only need a small part of the Perl language to complete. The motto of developing Perl programs is "more than one way to achieve" (TMTOWTDI; There's More Than One Way To Do It, sometimes read "Timtudy"). Therefore, Perl's learning curve is both flat (easy to learn) and long (if you want, there are a lot of things that you can learn).

Finally, Perl is (usually) considered an interpreted language. That is to say, you don’t need to go through an intermediate encoding process after writing the program; this allows you to test and debug errors quickly and easily. This convenient test feature makes the learning curve smoother.

Some things that help practice Perl: UNIX experience, experience in almost any programming language, understanding regular expressions, and the ability to understand programs written by others. If you have anything you want to do with Perl, then you may have done it before and examples are usually available for free. And don't forget the new Perl module. The module has a detailed discussion in this third part of the FAQ, and [Don't Forgot Your Good Friend] CPAN, which will be discussed in the second part.


How does Perl compare with other programming languages? For example Java, Python, REXX, Scheme, or Tcl?

Perl is better in some places and poor in some places. To be precise, what aspects are good or bad usually depends on personal preference, so asking such questions in a news discussion group is likely to trigger an unconstructive jihad.

The best way to compare the similarities and differences of each language is to try to write programs with the same functions in different languages. Each programming language has its own news discussion groups, which you can learn from (but hope you are not arguing with others).


Can I use Perl to do some kind of errand?

Perl has enough flexibility and expansion, from only writing a short line of archive processing to complex systems, there is almost nothing that cannot be done. For some people, Perl is an ideal alternative to writing shell programs. Others use higher-order Perl to replace many programs that originally needed to be achieved in low-order languages ​​such as C or C++. What errands are decided by Perl, it all depends on you (and maybe your manager...).

If you have a library that provides APIs, you can use C or C++ to write a Perl extension, and then use it to dynamically load any part of the library into your Perl main program. You can also in turn write the main program in C or C++, and then insert some Perl code in real-time and dynamic loading to create a powerful application.

That being said, it is always convenient to use small, specialized, and specially designed languages ​​for special purposes to solve certain specific problems. Perl is designed to try its best to meet the needs of various people, so it is not particularly biased to anyone. As for examples of special functional languages, just give two examples, such as prolog and matlab.


In which occasions is not suitable for Perl?

When your supervisor prohibits it -- though be sure to consider changing them.

Seriously, if you already have an application written in another language (and it is well written), or you already have a language designed for certain specific jobs (for example: prolog, make), you don't need to use Perl at this time.

Due to various factors, Perl is probably not suitable for real-time embedded systems, low-level operating system development work, such as drivers or environmental conversion codes for peripheral devices, complex multi-line shared memory applications, or very large applications. You will find that Perl itself is not written in Perl.

The newly released Perl pure code compiler may help remove some of the above limitations, but you need to understand that Perl is still a dynamically typed language rather than a solid variable. As long as you don't use Perl to write the programs used in nuclear power plants or brain surgery monitors with confidence, you will naturally not suffer any trouble. In this way, Larry can sleep more peacefully at night -- the stock market analysis program is not limited.

What is the difference between "perl" and "Perl"?

The difference between the two is one bit. Oh, you're not talking about the difference in ASCII? Larry now uses "Perl" to represent the language itself, and uses "perl" to represent the embodiment of the language, that is, the current interpreter. Therefore, the author has a humorous saying: "Only perl can interpret Perl." It is your freedom to follow this usage. To draw inferences from one example, we can say "awk and perl" and "Python and Perl" in accordance with the same rules, but we cannot put "awk and Perl" or "Python and perl" together.


Should Perl program be considered a program or script?

It doesn't matter. In standard terms, program refers to a program that has been compiled from a compiled program and converted into machine code and can be executed multiple times; while script is an interpreter that must be interpreted through an interpreter every time it is executed. However, Perl programs are strictly neither compiled nor interpreted; because Perl programs can be translated into bitcode forms (can be said to be some kind of Perl virtual machine [virtual machine]), or translated into completely different languages, such as C or a combination language. So it is difficult to just look at the original code. It is written for a pure interpreter, a parse-tree interpreter, a bit code interpreter, or a pure code compiler; therefore it is difficult to give it a definite answer to this question.

What is JAPH?

This is the signature file of some people who claimed to be ``just another perl hacker'' in the discussion group in the past. There are about a hundred relatively early ones and can be obtained in /CPAN/misc/japh.

Where can I get the Wisdom Sarcasticisms of Larry Wall?

More than one hundred Larry's sarcasm, derived from his posts or source codes in the discussion group, can be obtained in /CPAN/misc/lwall-quotes.

How do I gain the trust and convince my system administrator/boss/subordinates to use version 5/5.004 of Perl instead of using other languages?
If your management or subordinates are wary of software that is not supported or software that is not officially included in the purchased operating system, you can try to start with helping them. Because if programmers can gain greater productivity by making good use of Perl's structure, functionality, simplicity, and power, then typical managers/bossessions/employees may be convinced. In addition, using Perl, in general, may also help reduce the time for delivery compared to other languages. Emphasizing this argument may help convince them.

If your topic encounters bottlenecks, especially issues regarding translation or testing, then Perl can be said to be a feasible and fast solution. When you are a lobbyist, don't forget to mention: Perl has been widely used by many large software and hardware companies in the world, and is extremely reliable and effective. In fact, Perl has now become the standard equipment for operating systems sold by many Unix operators. And if you cannot find answers to your questions in the detailed instructions, including this FAQ, just send a post to the news discussion group.

If you are facing voices against the Perl upgrade, tell them that the Perl development team has stopped maintaining or supporting the fourth version of Perl. Another big selling point of perl5 is that it has a large number of modules and extensions, which can greatly reduce the development time of the project. Also, tell them the difference between the fourth and fifth editions Perl is the same as the difference between awk and C++ (well, maybe not as obvious as the difference, but you know what I mean). If you want support and want to ensure that the software you are developing can continue to work in the future, you have to run a supported version. This probably means running the 5.004 version, although the 5.003 version is still good (it is only one year behind, one version). However, because some serious bugs have been eliminated between versions 5.000 and 5.002, you should at least upgrade to higher than these versions.