官术网_书友最值得收藏!

Operator classification

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 of two or three non-alphabetical symbols, such as >= or <= operators. Or, they can be a string identifier, for example—cmp or eq.

主站蜘蛛池模板: 班玛县| 石门县| 木兰县| 响水县| 山东| 秦皇岛市| 台东市| 平罗县| 拜泉县| 广东省| 蒙城县| 嫩江县| 环江| 翁源县| 万荣县| 柳州市| 兴隆县| 天门市| 阳泉市| 吉首市| 固安县| 金门县| 静宁县| 兰西县| 新兴县| 仁怀市| 天镇县| 仪征市| 福清市| 沛县| 陆河县| 富顺县| 澄迈县| 临高县| 孝感市| 社旗县| 会东县| 达州市| 波密县| 永康市| 交口县|