Programming language – Principles behind Perl

software developer

In contrast to languages such as Python, Perl is less prescriptive and provides intentionally for every problem, several formulation and solution options.

For example, you can use logical operators than | | and && ( as in C ), or (with shades of meaning) and (like in Pascal) write, but also numerous commands with an overlapping of functions such as map and for allowing different formulations for the same set of facts.

Some commands, such as the diamond operator (<>) offer shortened spellings for existing functionality (in this case would be, with slight differences , <STDIN> equivalent).

This diversity is also visible in the CPAN , where often several modules fulfill a very similar purpose or one that also (albeit more complicated) could be implemented manually ( eg Getopt :: Long).

Another buzzword that can be seen as an extension of TIMTOWTDI , Perl is called the first postmodern programming language.

This means that Perl combines different paradigms and the user is free to combine structured, object-oriented, functional and imperative language features.

Simplicity

The other important mnemonic is that Perl makes jobs easy and hard jobs possible, which means Perl keeps the simple tasks easy and the difficult tasks possible.

This includes for the first goal to simplify common tasks as possible with short final solutions. For example, checking -e filename the existence of a file.

Easy to leave Simple tasks means to require no preparatory programming instructions , such as the filing of variables or writing a class.

Second, Perl tries to be complete and provide to every problem at least the basics that make a solution possible. The third objective is to not let the first two goals collide.

The growing language range of Perl 6 is becoming increasingly important, where it is based on the Huffman code, the notations of the most frequently used commands are kept as short as possible, without using the logic to break the notation of similar commands.

Context Sensitive

In Perl, there are commands that have different meanings depending on the context in which they are used. Such context-sensitive, data structures such as the array.

Will there be assigned to another array, content is passed, the recipient is a single value ( scalar) , this will get the length of the array.

About these ads