0
HomeDefinitionsPerl Programming Language: Definition and Uses

Perl Programming Language: Definition and Uses

Perl stands for Practical Extraction and Report Language: It is the most widely used programming language for writing CGI scripts. It is very suitable for the manipulation of character strings and files.

Perl is considered as a High-level programming language. Perl is Open Source software, licensed under its Artistic License, or the GNU General Public License (GPL).

It is an interpreted, versatile language, and particularly suitable for processing and manipulating text files, in particular due to the integration of regular expressions in the very syntax of the language.

The association in charge of developing and promoting Perl is The Perl Foundation.


Appeared in: 1987
Auteur: Larry Wall
Developers: The Perl Foundation
Last version: 5.12.1 [+/−]
Paradigms: Purpose , imperative, functional
Influenced by: C, BASIC, shell, sed, awk
Influenced: Ruby, Python, PHP, Perl 6


The Goal of Perl Programming Language

Perl was born out of a need for a language optimized for extracting information from text files and generating reports. Before Perl was born, text processing had to be done through shell scripts, using the sed, awk, grep, cut, test, and expr programs.

Many limitations appeared when using this programming: input data format not always flexible, difficulty in passing data from one process to another, slowness due to the launch of multiple programs (the cost of launching a process was not negligible), dependency on a particular implementation of a command, intrinsic bugs in certain languages (awk does not differentiate between the comparison of numbers and character strings).

Perl consolidates and borrows its concrete syntax from all these mini languages, including the shell, by adding some of the C syntax and functions from the C system libraries.

Here are some of the currencies commonly associated with it:

There Is More Than One Way To Do It (TIMTOWTDI) which could be translated as There is more than one way to do it: Perl offers so many libraries and functions that the programmer will often find 3 or 4 ways to achieve the same operation.
Perl: The Swiss chainsaw of programming languages for the same reasons.
Perl: the ideal assistant for system administrators, the majority of the configuration files being in text under Unix.
Its flexibility authorizes the use of several programming models: procedural, functional and object-oriented.

The mechanism

Perl5 is a language whose highly dynamic nature makes the distinction between the compile and runtime phases quite blurred.

Moreover, the compilation phase does not generate a bytecode as is the case with many other interpreted languages, but a syntactic tree (AST, Abstract Syntax Tree).

In practice, Perl begins by translating the source code, instruction by instruction, into AST, which is then optimized. If instructions are located in a special block like BEGIN or CHECK, they are executed as soon as they are compiled (and therefore before the rest of the source code is compiled).

This is particularly the case for modules loaded by the use statement. The AST itself is a little more elaborate than a usual AST because it already contains the execution paths. During the execution phase, the interpreter therefore follows the paths present in the AST and executes the remaining instructions.

Published Date:

Mehmet is one of the administrator of Teknonel. As a software developer, he loves to share his knowledge in related topics. He is highly familiar with the editorial process from the inception of an article idea, through the iterative process, publishing, and performance analysis as well as product reviews.

Popular in This Category

Related Articles