September 2017
Beginner
402 pages
9h 52m
English
First, let's remind ourselves of some of the basic terminology that we need when talking about operators. Consider a simple example:
my $a = 10;my $b = 20;my $c = 0;$c = $a + $b;say $c; # 30
Let's concentrate on the following line of code:
$c = $a + $b;
Here, we tell the compiler to perform two actions—first, calculate the sum of the $a and $b variables, and second, assign the result to the third variable, that is, $c. There are two operators in this example—+ and =. Operators are presented by their one-character names. In this case, the names are chosen to copy the corresponding operators in mathematics. Later, we will see examples of other operators, which are not just a character. They can be, for example, a sequence ...