Perl's P

, which means practical.

Did you know that Perl's P means practical?

The name Perl is a biblical quote from "Pearl Pearl," but the acronyms P, e, r, and l also have implications.

This may be retrofitted or unclear, but Perl users have some respect for its meaning and it's fun.

What does practical mean?

What does it mean to be practical?

One liner

Perl is a practical language. It can be used practically at work. For example, in server management, shell script, sed, awk, but Perl solves the problem when multi-line string processing or a little complicated text processing is required. ..

You can do multi-line string processing with one liner instead of awk or sed. Perl exists as a tool that can be used just in situations such as "I want to do this, I'm in trouble".

Not theoretical, not persuasive, not powerful

Perl feels good, but it's not theoretically explained on the Web, so it can be vulnerable to evaluation on the Web.

Perl is less likely to force you to persuade you, to use Perl when it's not in the right field, or to use your power to spread it.

With big media power, university power, big tech power, and incendiary marketing power, Perl isn't known, as one of the open source cultures and one of the Linux / Unix middleware tools. , It is characterized by being known naturally.

I think one of the practical aspects of Perl is that the engineers who are doing the work in the field just appear and help you in troubled situations.

Compatibility with shell script string representation

Perl is a practical language, not the ideal language X. For example, shell scripts have quotes and double quotes as representations of strings.

Perl is also quoted and double quoted.

In other words, if you try to use Perl in a shell script, the expressions in Perl and the shell script will collide.

The first solution, in the case of one-liner, is to enclose the Perl string in single quotes as the shell string and double quote the Perl string.

There are single quotes and double quotes as a way to represent a string, so you can avoid it like this.

But both can be difficult. In this case, Perl will use single quote operator and double quote operator.

q (character string)
qq (string)

The reason for the existence of this operator is to avoid conflicts with the representation that surrounds the characters in the shell script.

In addition, it can be changed up to the character box to avoid collisions.

q | string |
qq | string {

Perl says. "I respect you. I don't hit you."

String list operator that makes an array of strings as they are

Perl has a string list operator that turns a string into an array. This is also aimed at practical things.

For example, suppose a multi-line string list is written in the text.

Grilled meat
sushi
curry
Udon

Imagine that this was written in 200 lines. It's a hassle to enclose it in quotes and separate it with commas.

"Doraemon, I don't know what to do." "Nobita-kun, you again. In such a case, the character string list operator (Mojiretsurisu and she are crazy!)"

my @foods = qw (
Grilled meat
sushi
curry
Udon

);

Oh mysteriously, the copied and pasted strings instantly become a Perl array !!!

Various practical aspects of Perl

Regular expressions that are often used in text processing are built into the language, the enclosing characters of regular expressions can be changed, the DATA section can be written in the program, pipe processing can be easily implemented with the diamond operator, etc. Perl If you raise the practical aspect of, there is no end to it.

We hope you all use Perl to discover more and more practical aspects. Perl is a programming language that is always aware.

Associated Information