FAQ on the Perl language for beginners. Unique Perl - programming language: pros and cons

Appeared in 1987.

This programming language is rich in capabilities for working with text, which determines its main area of ​​application - text manipulation, in particular.

This article will walk you through the steps to install the Perl runtime, select development tools, and create your first program. At the end of this guide you will find a list of resources that will help you quickly master the basics of Perl, as well as explore the language in more depth.

Perl is the only language in which programs look the same before and after RSA encryption.

At the time of writing this material current version interpreter is 5.22.0. Perl 6 is due for release in 2015, but is not well documented yet.

The Perl programming language is highly not recommended as a language for learning programming. If you are an absolute beginner, it is better to start with something less destructive for your fragile consciousness. Seriously, here's what Jon Ribbens had to say about this language:

PHP is a little evil created by incompetent novices, while Perl is a big and insidious evil created by skilled but twisted professionals.

By the way, you shouldn’t start with PHP either. Now let's get down to business.

Runtime environment

On at the moment Perl is officially supported on three leading platforms: Mac OS X, Unix and Windows. On the first two of them, the Perl runtime environment is pre-installed, and its version can be found using the perl -v command (the latest version can be downloaded), and for operating systems Windows family The Perl interpreter is available for download on this page. It is recommended to choose ActivePerl (distribution from ActiveState) as the most common one.

Integrated Development Environment (IDE)

Perl, unfortunately, is not very popular among development environment developers, so you have only a few options to choose from. large number specialized tools.

Padre, the Perl IDE

A multi-platform, lightweight development environment designed specifically for Perl and user-friendly for beginners. In addition to traditional syntax highlighting and autocompletion, it also has built-in refactoring tools. By the way, Padre itself is written in Perl 5.

Text editors

As with any programming language, of course, you have a huge variety of multi-platform text editors to choose from, from pre-installed notepads to more convenient means editing source code with syntax highlighting, autocompletion, etc. In particular, pay attention to:

  • KomodoEdit - a stripped-down version of the commercial development environment Komodo IDE, developed by ActiveState (the same one that supports the ActivePerl distribution), has functions of autocompletion, syntax highlighting, multiple cursors and documentation tips;
  • Vim- text editor, the interface of which may be unusual for a Windows user; supports syntax highlighting;
  • Sublime Text is one of the best source code editing tools with syntax highlighting, autocompletion, etc., the functionality of which is expanded by many existing plugins;
  • Notepad++ is a lightweight text editor that features the most correct syntax highlighting after KomodoEdit; The functionality can be expanded with plugins, but there are quite a few of them specifically for Perl.

CodeGround

Also, if you only want to try Perl programming and don't want to install additional software to your computer, you can use the CodeGround service, which provides access to online development environments with basic functionality for most programming languages, including Perl.

The first "Hello, world!" in Perl

Traditionally, we suggest starting your acquaintance with a new language with a well-known program:

Print "Hello World\n";

Save this line in the hello.pl file and run the program you just created with the command:

Perl hello.pl

However, first make sure that executable files Perl is among yours environment variables (environment variables), and also that you are calling perl from the folder with source file hello.pl . If successful, you will see the expected “Hello, world!”

Congratulations, you've started writing Perl!

And then on our way...

An excellent English tutorial on the Perl programming language to get you started can be found at tutorialspoint.com. In addition, there is an official training resource -

Perl allows you to write powerful programs from the very beginning, whether you are a newbie programmer or an expert. Perl offers standard tools programming - comparison operators, pattern matching quantifiers, list functions - and has shortcuts for entering character ranges. Perl also offers file tests so you can quickly find what you want.

The Most Useful File Tests in Perl

Programming with Perl is quite simple, which is done for the letters you use to check files. For example, r checks if the file can r ead, a T looking for a file t ext. Here are the most useful tests files in Perl:

Special characters in Perl

Like any programming language, Perl uses special teams For special characters, such as reverse or vertical tabs. So, if you need to program a call or beep or carriage return only, check the following table for the character that will produce it:

Perl True-False Comparison Operators

When you program in Perl or any other language, you use comparison operators all the time. The following table shows common comparisons for Perl in both mathematical and string form:

push (@r, @s)

splice(@r, $#r + 1, 0, @s)

Any number

Match 1 or more times

*

Match 0 or more times >?

You are about to take a journey into the world of Perl programming. Your journey will be all the more enjoyable due to the presence of a large number of examples that will be encountered along the way. The beginning of our journey covers the basic concepts of language. Gradually you will learn enough about Perl to create small programs. At the end of our journey, you will already have the necessary knowledge to be able to create full-fledged applications.

Do you speak any other programming languages? If yes, then learning Perl will be a pleasure for you. If not, then don’t rush, try all the suggested exercises and examples and don’t be afraid to experiment!

Origin

Perl was the result of one man's efforts, and by his own admission, the result of his laziness. This is a unique language, the essence of which cannot be conveyed simple description technical details. Perl is a state of mind.

One of the quirks of the language is its name. It has several definitions. Perl originally stood for Practical Extraction Report Language. However, programmers very often call it Phatologically Eclectic Rubbish Lister or even Practically Everything Really Likable.

Let's take a few minutes to understand what Perl is and what tasks were assigned to it at the time of its creation. Back in 1986, Larry Wall was working on the problem of generating reports from a large number of text files that overlapped with each other. Being a Unix programmer, and because the task involved manipulating the contents of text files, he first tried using Awk. But it soon became clear that Awk was not suitable for the job, and, having no other candidates for solving the problem, the only thing left was to invent his own tool that could be used in the future.

Instead of wasting time, Larry simply invented a new programming language and wrote an interpreter for it. This seems like a paradox, but it’s not entirely true - what you do is always a lot of work, but if you do it correctly, then this work will definitely pay off.

Larry soon offered his creation to the Usenet newsreader community. Users with access to Usenet provided Perl's creator with an efficient " feedback support", asking how to do this, that, the third. Many of these problems Larry did not even intend to pose to his little new programming language.

The new programming language had an emphasis on system control and text processing. After several revisions, it could already use regular expressions, signals, and network sockets. It became known as Perl and very quickly became popular among Unix programmers, and soon among us all.

Larry no longer maintains Perl alone, but retains his exclusive title of lead developer.

Perl programs are very similar to C programs, perhaps because Perl was written in C, and perhaps because Larry found some C constructs handy. But Perl is less pedantic and much more concise than C.

Perl is designed to help the programmer do routine tasks, which are too difficult or poorly portable for the shell, and too abstruse or difficult to code for C (or any other language).

Once you've mastered Perl, you may find that you spend noticeably less time correctly quoting various shell parameters (or executing C declarations correctly) and more time reading Usenet news and skiing down the mountain. because Perl is a wonderful tool to help you become a programmer. “Some of the ancients” said: “You shouldn’t learn a programming language that doesn’t radically change your understanding of programming.” Rest assured, once you learn Perl, you'll look at programming from a completely different perspective.

The powerful designs of this language allow you to create very effective solutions And universal tools. These tools can be used in the future because programs written in Perl are highly portable and ready to use. As a result, you'll have even more time to read Usenet news and go to bars with friends.

Perl is very good at handling tasks low level, especially after the release of the fifth version of the language.

Cost and license

Perl is free. To be more precise, Perl is distributed under the GNU Public License. Full source code and documentation are completely free to copy, compile and print. All the programs you write in Perl are yours, and you can do whatever you want with them.

In addition to UNIX computers, Perl also exists for other platforms - Windows, DOS, Atari, Amiga, etc.

Do you have Perl installed?

It's very easy to find out if you have Perl. Just issue the following command on the command line:

perl -v This is perl, version 5.001
Unofficial patchlevel 1m.
Copyright 1987-1994, Larry Wall Win32 port Copyright 1995 Microsoft Corporation. All rights reserved.
Developed by hip communications iNC., //info.hip.com/info/
Perl for Win32 Build 107
Built Apr 16 1996@14:47:22
Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5.0 source kit.

If you receive an error message or you have version 4 of Perl, contact your system administrator or install Perl yourself.

Your first Perl program

Your first Perl program illustrates printing a line of text to the screen. To begin, you must create a simple text file that will contain your Perl program. Then you will run your program file.

Creating a program

A Perl program is a regular text file containing several language constructs. The latter usually resemble a mixture of C, Unix shell script and English language. In general, this is exactly how it really is.

Perl code can be quite diverse. Here are some basic rules:

Leading spaces in the line are ignored. You can place the language statement wherever you want: at the beginning of the line, indented (recommended), or even aligned to the right (but in this case it will be extremely difficult to read the program text and understand anything);

A language construct must end with a semicolon unless it is the last construct in a block or file, or is an eval statement;

Spaces, tabs, empty lines are irrelevant - one space is as good as a hundred of the same spaces. This means that you can break the language construct into multiple lines for clarity. A string is usually a series of characters surrounded by quotation marks. Chapter 2, "Number and String Literals," contains more detailed description lines;

Anything following the "#" character is ignored unless it is inside a line. Use this feature to provide useful comments to your code. It should be noted that there are no multi-line comments (for example, as in the C language) in Perl.

Similar to a shell script, a Perl program consists of all the Perl statements present in a file, considered together as one large program to be executed. There is no concept of a main function, as in C, in Perl.

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

Background

The impetus for this discovery was when he took part in the UNIX project. The work was difficult, as it was necessary to create secure network with many levels, so that it is possible to combine the work of several computers operating at considerable distances from each other. The whole process was completed successfully, but the reports had to be made very labor-intensive, not only with a huge amount files, but also between them.

Wall decided to use the awk filter for the job, but an unexpected obstacle arose: it was impossible to control either the opening or closing of a huge number of files - ironically - based on the information they contained about the location of these files.

Initially, Larry, to solve an unforeseen problem, decided to write a specific system utility. It seemed to be a way out of the current situation. But before that, he had already compiled several utilities to solve this problem, which, unfortunately, did not become a solution for UNIX standards.

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

New programming language: the reason for its occurrence

According to Larry, laziness helped him create a new language. But it was precisely that laziness that made it possible to decide important task: How to avoid creating a large number of programs on different languages, which were an integral part tools UNIX. This procedure was too tedious.

The merits of the new language were appreciated by others, as it harmoniously combined the capabilities of file processing and system administration. And these are exactly the two necessary facts that are needed when programming a UNIX system.

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

On the contrary, when Larry introduced users to his invention, among system administrators it created a real sensation, 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.

Peculiarities

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

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

There are many reasons why the new language was immediately appreciated by many users. Anyone who uses a UNIX system knows that the settings here go through special files- ordinary text ones, and changes are made after executing commands. They are written in a special shell language, and their execution occurs from command line.

The UNIX system allows you to create custom commands by drawing on and storing interpreter commands. They remain in text files and, if required, are executed as standard set operating system commands - only through the command line.

User commands otherwise called scripts. IN UNIX system The operational 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 makes it possible to compare with these samples and serves as a report generator.
  • Sed. Acts as a batch editor for text files.

Programs read strings one by one as filters input files. They then perform the actions that apply to the string, which are determined by the program commands. In this case, a chain of characters is selected according to certain patterns, replacement according to established rules, new files are generated.

Great opportunities

The new programming language Perl has opened up very rich possibilities in cases where it is necessary to process text and stable expressions. Perl has a large variety of helper modules.

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

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

It’s 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 master the language once you understand assignment expressions, code blocks, control structures, and functions.

Similarities with other languages

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

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

But the new language coped with its own tasks much faster, and therefore they began to use it not only for solving system administration problems.

Wall received a package from G. Spencer that helped him master Perl regular expressions, modifying it to suit your creation. Many of the features developed are not solely due to Larry. Colleagues and friends tried no less enthusiastically to bring unique program your innovations. And when the language appeared on the Internet, a whole community of like-minded people formed who also helped 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 successfully in implementing new applications of the language under emerging technologies related to information.

Stages of development

Small but significant stages of the journey can be highlighted in the table.

Released versions

Creation time

perl 1. Didn't contain many features. This was the easiest way to search files using patterns. But there were file descriptors, format and scalar variables.

1988 January.

perl 2. An as yet unimproved regular expression mechanism has appeared.

1988 June.

perl 3. Developers have achieved the ability to process binary data streams.

1989 October.

perl 4. Appeared largely thanks to the book that was published, “Programming Perl", but under the name better known as "Camel Book". The new language has been documented. This period went through a whole series of releases, eventually settling on version 4.036. It was already 1993. Then work began on the next - V - version.

1991 March.

perl 5. Added support for complex data types, object model, which includes references, packages, and a closure as a value. A mailing list is created so that work can be coordinated on different platforms. In fact, it became the main forum for development, porting and maintenance. Modules are now with important part versions, because they were able to expand the language, but without modifying the interpreter. This was able to stabilize him, but expanded his language capabilities.

1994 October.

Unique Perl - programming language: pros and cons

Perl 5 is actively being developed and is now being updated with new versions. But all developments have several factors in common: automatic data typing is carried out, automatic control over memory.

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

It should be noted that Perl programming distinguishes the interpreter from others. Proof of this is the translation of the program into intermediate bytecode, and only then it begins to be executed. In comparison: the traditional one works a little differently - the entered operator is interpreted and instantly executed, which is fraught syntax errors during the work process. Perl allows you to detect these types of errors already during the translation into buy code.

In order to convert one type of data to another, you will need automatic process, if translations of any types of data are impossible, this can lead to a fatal error.

The merit of version 5004 is that there is a UNIVERSAL package, which gave the language a main object, and all classes were derived from it - on an automatic basis. It is now possible to request the version of modules. It has become a reality to support requesting the version of modules. In addition to this, perl began to support many operating systems, and Microsoft Windows including.

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

Latest updates

The year two thousand gave the world a new, 5.6, version of the Pearl language. It already looked much more solid than the first ones, had 64-bit systems, was able to support files larger than two GB, included string representation taking into account the Unicode standard, and also keyword- our. During this period, the version naming scheme changes to be more similar to other open source projects.

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

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

A significant change in the Perl 5 development process occurred with the release of Perl 5.11. The developer community has moved to a monthly release cycle, with release dates planned three months in advance.

New version

Version 5.8 appeared in 2002. It is famous for the fact that from that time it was updated annually until 2008, it significantly improved Unicode support, added many functions, which include multithreading support, an original I/O implementation, and increased numerical accuracy. And, again, new modules appeared.

To the 20th anniversary of the creation of a programming language general purpose the new version numbered “5.10.0” did not disappoint users once again. New operators have appeared, as well as “smart” matches, and regular expressions have been updated.

What have the last years of work brought?

Every year, new improvements helped make the language invented by Wall easier, simpler and more accessible. The year 2010 was marked by the fact that the syntax of the Perl language received support for package NAME VERSION, regular expressions; in subsequent years, modules were updated, and support for operators was 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 capabilities of the used scripts, which pose a threat of being incompatible with the presented one new version. It became more features, safety has increased.

At the end of May, just recently, the next version appeared, as always, more improved and easier to use. Today, anyone can test it and see from their own personal experience that a lot of work has been done to create this programming language.

In this language Perl arrays not limited. Using the language, you can solve non-traditional tasks that would otherwise require several people, perform administrative tasks, process text files with high quality, and not much time will be spent on all the problems. By 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 of their craft. Sometimes even the smallest problems lead to useful discoveries that can make our lives a little easier.

It so happens that I know at least two people who would like to learn Perl. I decided to write this post especially for them.

  • Part 1: Variable Types (You are reading this part)

You will find examples there simple programs from the series “print numbers from 1 to 5” and the like. I have always liked to learn from examples - it’s more interesting and faster than from books or seminars. You can also look at the posts on this blog - chances are you will find more examples there.

I assume that at school/institute you studied Pascal/Delphi, C or at least Basic, and there is no need to explain what a function and loops are. If this is not the case, it's okay, you'll just have to spend extra time reading Wikipedia to figure it all out. If you don't know how to run a bash script, or why in the first line of the script you should write something like #!/bin/sh, you'll have to do a little googling to find out.

Especially for those who are interested in the questions “is it true that Perl is very complicated”, “what books on Perl can you recommend” and even “uh... is it still written in it?”, I wrote a Mini-FAQ on Perl , which you can read on HabraHabr. And for those who did not strengthen many letters Here I will give a brief summary of it:

  • Perl - modern language programming in which they write and will continue to write for a very long time.
  • Perl, like any other programming language, has its advantages, disadvantages and applications. Exists really big class of problems that Perl solves with 5+.
  • Perl syntax is no more complex than C++ or Java syntax. You can verify this by reading this post to the end.
  • There are good, yet inexpensive Perl tutorials. You can also easily find a community of Perl programmers online who speak your native language.
  • Perl works well under both operating systems UNIX family, and under Evil Windows.

Addition: I also recommend that you read the articles Perl vs Python vs Ruby vs PHP and Priests of Programming. The first one talks about the performance of various scripting languages, the second one talks about PHP differences from other languages. For Python fans, I advise you to read the article Python script performance test. I hope that these materials will help you find the answer to the question “what is good about Perl.”

Hello %username%!

So, let's write our first Perl script already!

#!/usr/bin/perl

$name = shift() ;
print("Hello, $name! \n") ;

Let's run the script:

$ chmod u+x 1 .pl
$ ./ 1 .pl afiskon
Hello afiskon!

Everything is very simple here:

  • The names of scalar variables (that is, not arrays or hashes, what they are - see below) begin with a dollar sign.
  • The shift function returns the next script argument. In other words, the first call to shift() returns the first argument, the second call returns the second argument, and so on.
  • The print() function prints the string passed as an argument.
  • You can substitute variable values ​​into the line (see line 4). For more information about strings, see below.

If it’s not very clear yet, that’s okay. Perhaps a little theory will bring a little more clarity.

Variable types

There are three main types of variables in Perl: scalars(numbers and strings), arrays- similar to those used in Pascal or C (sometimes arrays are also called vectors), and hashes(associative arrays).

Scalars we already used in the previous example. Here are some more examples of specifying scalars.

#!/usr/bin/perl

$a = 123 ;
$b = - 7.496 ;
$c = 0xABC; # equals 2748, yes, it's a comment :)
$d = ($a + $b ) / $c ;
$d *= $a ; # same as $d = $d * $a;

$str1 = "hello" ;
$str2 = "$str1, world" ; # $str2 contains "hello, world"
$str3 = $a . " \n". $str2 ;
$str4 = "$str1" ; # $str4 contains "$str1", not "hello"

Here we set positive and negative, integer and fractional numbers, set the number in hexadecimal encoding, add, multiply and divide - everything is like in C or Java. In addition to those listed Perl operations also supports the exponentiation operation:

$a = 2 ** 8 ; # result: 256

With strings, everything is approximately the same as in some PHP. The dot means the concatenation operation (that is, “gluing” strings together); if the string contains variable names, values ​​are substituted in their place; symbols can be inserted using a backslash new line(\n), tabs (\t), quotes (\"), the backslash itself (\\), the dollar sign without any variable substitution (\$) and much more. If the string is in single quotes, the symbols in it are interpreted “as is”, without variable substitution, etc.

Like PHP, Perl interprets scalars as numbers or strings depending on the operation. It's simple:

$int1 = "11" + 22 ;
# ^ the string "11" is converted to a number,
# after which addition is performed, result: 33.
$str1 = "11" . 22;
# ^ the number 22 is converted to a string,
# after which concatenation is performed, the result is "1122".

The rules for converting from a string to a number and vice versa are the same as in PHP:

$str1 = 0 . "abc" ;
# ^ the result is "abc", the number zero is converted to the empty string
$int1 = "aaa" + 1 ;
# ^ result is 1, there are no numbers in the string "aaa"
$int2 = "12aaa" + 1 ;
# ^ result is 13, only the first digits of the string are taken into account

By the way, there are special operators for declaring long strings - q and qq:

# similar to single quotes
$text = q (
Do you have $15 ?
} ;
# similar to double quotes
$message = qq (
Hello, $username!
How are you?
} ;

Working with Arrays happens as follows:

#!/usr/bin/perl

$scalar = "bebebebe" ;
($a, $b) = (1, 2); # same as $a = 1; $b = 2;
@arr = ("aaa" , 123 , $scalar , $a + $b ) ;
print $arr [ 1 ] . " \n";
push @arr , $a ;
print pop (@arr) . " \n";

Here we create an array @arr consisting of 4 elements (line 5). Then we output the second element (line 6). The numbering of elements starts from zero, so index 1 is used to display the second element. Then we put the value of the variable $a at the end of the array ( push function, line 7), and immediately extract and display it (function pop, line 8).

Please note that the names of the arrays begin with “dog”, not dollar (it’s not difficult to remember - the corresponding characters are similar to the first letters English names types: $ - scalar, @ - array). When accessing the second array element (line 6), the dollar sign was used because the array element is a scalar. At first this causes a lot of confusion, but in general everything is logical.

In this script we also call the print and push functions without parentheses. In Perl, when calling a function, wherever it does not cause ambiguity, the parentheses can be omitted.

To declare an array whose elements are strings without spaces, there is special operator— qw:

@arr = qw/aaa bbb ccc/ ;
# similar to ("aaa", "bbb", "ccc"), only shorter

Hashes are similar to arrays, but the elements in the hash are not ordered. In this case, strings can be used as a key by which an element is accessed.

#!/usr/bin/perl

%hash = ( # when declaring hashes and arrays you can
"x" => 12 , # use line breaks
y => 53 , # if there are no special characters in the key, quotes are not needed
"z" => - 10.5 , # you can leave a comma at the end
) ;

$hash("x")++; # x coordinate is now 13
$hash ( y ) --; # y coordinate is now 52

# display coordinates
print "x = $hash(x), y = $hash(y), z = $hash(z)\n ";

Hash names begin with a percent sign and are used to refer to an element. braces(not square, as is the case with arrays). If the key name is known in advance, you can specify it without quotes (line 10).

By the way, the $test, @test and %test variables are completely independent variables of different types.

At this point I wanted to go to conditional statements and for/while loops, but I realized that there is already too much text for one post. Meanwhile, many questions remain behind the scenes:

  • Conditional statements;
  • For and while loops;
  • Declaration of functions;
  • Working with streams and files;
  • Strict syntax;
  • Using ready-made modules and classes.

I will write about this in one of the following posts. I would like to receive at least a couple of comments on this post - interesting/uninteresting, understandable/incomprehensible, and so on. By the way, if you have questions related to Perl (not necessarily related to this post), feel free to ask them in the comments!

I hope this series of posts about programming in Perl will help you write your first simple scripts. Over time, scripts will become more complex, they will use new technologies (OOP, regular expressions) and after a while you will find that you know enough about Perl to share your experience with others.