What is Perl

W

Perl is an acronym for Practical Extraction and Report Language. It was designed by Larry Wall to be a tool for writing programs in the UNIX operating system and is still up to date and maintained by him. Perl borrows the features of C, shell, AWK, sed, Lisp and many other languages ​​to a lesser extent. An important element that distinguishes Perl from other languages ​​is that it benefits from a repository called CPAN that contains well-documented open-source modules. Using CPAN to reuse the already written code is encouraged. Like script languages, Perl does not require a compiler and linker to convert source programs into executable code (machine code). This means that Perl is ideal for making quick solutions to small programming problems, or for creating prototypes to test the solution to more complex issues. Perl provides all the features of script sed and awk, plus features that are not present in any of these languages.

Perl supports a sedl-> Perl and awk-> Perl, translator.

In short, Perl is as powerful as C but as friendly as awk, sed and shell scripts. PERL has many uses, especially for performing administrative tasks in the UNIX system. Perl is a generic programming language originally developed for text manipulation and is currently used for a wide range of applications including system administration, web development, networking applications, graphical interfaces, and more.

Language is intended to be practical, easy to use, effective, complete.

The main features are ease of use, support for procedural and object programming, built-in powerful word processing support, and a large collection of third-party modules. Perl design can be understood as a response to three major trends in the computer industry: lower hardware prices, increased development costs, improvements in compiler technology. Perl has many features that make it easier for the program to pay for more CPU and memory usage. These include a garbage collector, dynamic types, strings, lists, regular expressions, and an eval function ().
Perl is available on Windows, * UNIX, Linux, and Mac OS X operating systems. Perl has been used since the inception of the Web in dynamic site programming using the CGI protocol. Besides Python and PHP, Perl is one of the most popular languages ​​used in dynamic site development. On UNIX systems, Perl language is usually pre-installed because many Linux / Unix components are deployed using Perl. Perl has three types of fundamental data: scalar, array, and hash.

1. ($) Scalars can contain only one value. This value can be a whole, a real, a character, a string, or a reference. The name of the scaling variables always starts with the $ character.
2. (@) Arrays are collections of scalar values; they store lists of scalars. The name of an array variable always starts with the @ character.
The starting index in an array is 0, as in C language. The size of an array in Perl is limited only by the memory of the system on which the interpreter is running. Two of the most essential functions that work with lists (or arrays): split and join
3. (%) Hash (or associative lists) contain a different collection of key/value pairs. The name of the hash variables always starts with the% character. Keys are always unique scalar values, values ​​can be any scalar value. As for arrays, the size of a hash is limited by the memory of the system on which the interpreter is running.

Special variables in Perl:
@ARGV – List of parameters on the command line
@INC – list of directories from which Perl loads modules
% ENV – list of system variables
$ 0 – the name of the script being executed
$! – The last error from the operating system
$ _ – the default variable
$, – a string that separates the elements of a list from non-interleaved printing
$ “- a string that separates the elements of a list from interpolated printing Perl supports the numbering of several numbers: decimal, binary, octal, or hexadecimal.

About the author

Ilias spiros
By Ilias spiros

Recent Posts

Archives

Categories