Perl programming language: author, description, pros and cons

This important event in the programming world happened in 1986, when the seemingly ordinary guy Larry Wall, after painstaking work, announced to the world that he had developed the Perl programming language. The path to this momentous event was difficult and thorny, but the result was worth it. How, who and why developed a new programming language? There are answers to all these questions.

Background

The impetus for this discovery was a good reason. Then he took part in the UNIX project. The work was difficult, since it was necessary to create a secure network with many levels, so that it was possible to combine the work of several computers working from each other at significant distances. The whole process was successful, but the reports had to be very time-consuming, not only with a huge number of files, but also with cross-links between them.

perl programming language

Wall decided to apply the awk filter to work, but an unexpected obstacle arose: it was impossible to control the opening or closing of a huge number of files - ironically - based on the information contained in them about the location of these files.

At first, Larry decided to write a specific system utility to solve an unforeseen problem. She, it would seem, was a way out of this situation. But before that, he had already compiled several utilities to solve this problem, which, unfortunately, did not become an outlet for UNIX standards.

That's why a talented system administrator, a linguist by training, which helped him in his work, took a chance and created the Perl programming language so that it was possible to simultaneously process text files, find a solution for system tasks, create more understandable reports. And at the same time, that it should be low-level programming, which would be available in the C language. Therefore, the interpreter of the Perl language was written in it.

New programming language: cause

As claimed by Larry, helped him create a new language of laziness. But it is precisely the laziness that allowed us to solve an important problem: how to avoid compiling a large number of programs in different languages ​​that were an integral part of the UNIX tools. Too tiring was this procedure.

The dignity of the new language was appreciated by others, since it harmoniously combined the capabilities of file processing and system administration. And these are exactly two necessary facts that are needed during the programming of a UNIX system.

It should be noted that the Perl programming language has a slight difference from other similar languages: it appeared because the need was ripe for it, and not in order to impress users or come up with another beautiful tool that does not play a special role.

table of symbols

On the contrary, when Larry introduced users to his invention, it made a splash among system administrators, because now there was no need to spend a lot of time to delve into several programming languages, and it became possible to easily solve problems by using a single language using a symbol table.

Features

Translated into Russian, the abbreviation Perl sounds like “a practical language to extract data and compile reports.”

They decided to make a camel a symbol of this type of language, probably considering that since the animal is noble, hardy, capable of carrying a heavy burden for many days, the same work resembles the burden on a new language, which is also serious.

Why many users immediately appreciated the new language, there are many reasons. Those who use the UNIX system know that the settings here go through special files - plain text files, and the changes are made after the commands are executed. They are written in a special shell language, and their execution occurs from the command line.

The UNIX system allows you to create individual commands, relying on the commands of the interpreter and saving them. They remain in text files, and if required, are executed as a standard set of operating system commands - only through the command line.

User Commands scripts are named differently. In the UNIX system, the operating administrator has to write a large number of scripts, which, in turn, process subsequent scripts, i.e. text files using special programs:

  • Awk. The program provides an opportunity to compare with these samples and serves as a report generator.
  • Sed. Acts as a batch editor for text files.

Programs as filters in turn read lines of input files. Then they perform the actions applicable to the string, which are determined by the commands of the programs. At the same time, a chain of characters is highlighted according to certain patterns, replacement according to established rules, new files are generated.

perl regular expressions

Great opportunities

The new programming language Perl has opened up very rich possibilities in cases where you need to process text, stable expressions. Perl is distinguished by large options for auxiliary modules.

Over time, this unique language has expanded its boundaries, and is now widely used in web development and games, if you need network programming or graphical user interface design .

The language has taken root and fell in love for ease of use, now it is recognized as the most dynamic programming language. It supports a variety of paradigms, which include styles - functional, procedural and others, it has memory control, there is support for text processing.

Not for nothing that one of L. Wall's mottos says that simple things can remain simple, but complex things must be done.

It’s easy to learn the language by understanding the assignment expressions, blocks of code, control structures and functions.

perl programming

Similarity with other languages

Larry borrowed a lot from other programming languages. For instance:

  • UNIX shells Variables are marked with leading signs, they clearly express the type of the variable and help these variables to be interpolated in the lines. Built-in functions provide tools, and it is used to program the shell.
  • Arrays from Lisp.
  • Using Perl regular expressions from awk , at the same time borrowing associative motives from it.
  • From sed.

But the new language coped with its own tasks much faster, and it was therefore started to be used not only for solving system administration tasks.

Wall got a package from G. Spencer, which helped Perl learn regular expressions, modifying it to fit his brainchild. Many of the features developed are not only the credit of Larry. Colleagues and friends no less enthusiastically tried to bring their innovations to the developed unique program. And when the language appeared on the Internet, a whole community of like-minded people formed, who also helped to improve it. Since then, according to statistics, more than 10,000 programmers have been involved in the work.

However, the language is still being improved thanks to the development of packages that are used with success in the implementation of new language applications for developing information-related technologies.

perl arrays

Stages of development

Small but significant steps of the path can be distinguished in the table.

Released Versions

Time of creation

perl 1. Many features did not contain. This was the easiest way to search files by templates. But there were file descriptors, a format, and scalar variables.

1988 year. January.

perl 2. A not yet improved regex engine has appeared.

1988 year. June.

perl 3. Developers have been able to handle binary data streams.

1989 year. October.

perl 4. Appeared for the most part thanks to the book that saw the light, “Programming Perl, but under the name better known as Camel Book. Secured documented new language. This period went through a series of releases, as a result of which he stopped at version 4.036. It was already 1993. Then work began on the next - V - version.

1991 year. March.

perl 5. There is support for complex data types, an object model that includes links, packages, and also closure as a value. A mailing list is created so that you can coordinate work on different platforms. In fact, this was the main forum for development, porting and maintenance. Modules are now with an important part of the version, because they were able to expand the language, but without the participation of modifying the interpreter. This was able to stabilize him, but expanded his language capabilities.

1994 year. October.

Unique Perl - a programming language: pros and cons

Perl 5 is actively being developed and now, replenished with all new versions. But all the developments are related by several factors: automatic data typing is performed, automatic memory control is carried out.

Thanks to the interpreter, not only types are known, but also the memory requests of each program object, and it is not difficult for him to allocate memory, free it when counting links.

It should be noted that Perl programming distinguishes the interpreter from others. Proof of this is the translation of the program into an intermediate bytecode, and only then it starts to run. In comparison: the traditional one works a little differently - the input operator is interpreted and instantly executed, which is fraught with syntax errors during the workflow. Perl allows you to detect this kind of error already in the period of translation into by-code.

general purpose programming language

In order to transfer one type of data to another, an automatic process is required, but if it is impossible to translate any type of data, this can lead to a fatal error.

The merit of version 5 004 is that there is a UNIVERSAL package that gave the language the main object, and all classes came from it - on an automatic basis. Now you can request a version of the modules. It has become a reality to support requesting a version of modules. In addition to this, perl began to support many operating systems, including Microsoft Windows.

Version 5.005, released in 1998, significantly improved the quality of the regular expression processor, improved new intercepts in the backend, which was solved with the help of certain modules and expanded support for operating systems.

Latest updates

The two thousandth year gave the world a new, 5.6, version of the pearl language. She already looked much more solid than the first, had 64-bit systems, was able to support files of more than two GB, included string representation, taking into account the Unicode standard, as well as the keywords - our. During this period, the version naming scheme changes so that it is closer to other open source projects.

An interesting fact is this solution: if a version is in development, it will be assigned a number with odd numbers, and the stable one gets even numbering.

Wall then called on his followers to make suggestions for a more advanced version. His call was heard, and the result was 361 documents, which helped to develop the VI version. At the trial, users were presented with a document that most likely looked like a summary, but this version existed, but only in the form of a description of the language. A number of documents have become the specification of this version. The attempt to launch the interpreter of the VI version in 2006 was stopped. But since 2009, under the name Rakudo Perl, this version has been living and is periodically updated.

A significant change in the Perl 5 development process has occurred since Perl 5.11. The development community has moved to a monthly release cycle, with a release date planning three months in advance.

pearl tongue

A new version

Version 5.8 appeared in 2002. It is famous for being updated from 2008 onwards annually, significantly improved Unicode support, added many features that include multithreading support, the original implementation of input-output and increased numerical accuracy. And, again, new modules appeared.

On the 20th anniversary of the creation of a general-purpose programming language, the new version under the number "5.10.0" did not disappoint users again. New operators appeared, as well as “smart” - matches, regular expressions were updated.

What have the last years of work brought?

Each year, all new improvements helped make the language invented by Wall more and more easier easier and more accessible. The year 2010 was marked by the fact that perl syntax received support for package NAME VERSION, reloading of regular expression operators , modules were updated in subsequent years, and operator support expanded.

The goal was achieved - to indicate during operation the version that should be emulated, which means to allow perl to be updated, but at the same time not to lose the working ability of the used scripts, which pose a threat to be incompatible with the new version presented. There are more functions, increased security.

At the end of May, most recently, the next version appeared, as always, more advanced and convenient for work. Today it can be tested by anyone and on their own experience to make sure that a lot of work has been done to create this programming language.

In this Perl language, arrays are not limited. It is possible to solve, using the language, non-traditional tasks, for the implementation of which it would otherwise be involved several, perform administrative tasks, process high-quality text files, and all the problems of time will be spent not so much. When developing new programs, using a symbol table, using the necessary operators, the result will be correct and fast.

This article once again proved that nothing is impossible for enthusiasts in their field. Sometimes even the most insignificant problems lead to useful discoveries that can make our lives a little easier.

Source: https://habr.com/ru/post/K2548/


All Articles