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

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.

主站蜘蛛池模板: 韶山市| 安龙县| 邯郸县| 丹棱县| 乌拉特后旗| 牟定县| 右玉县| 迁西县| 兰坪| 兴国县| 珠海市| 冕宁县| 甘德县| 丰宁| 左权县| 集贤县| 黄山市| 鄱阳县| 鄢陵县| 湖南省| 双峰县| 新乡市| 于田县| 清水县| 仪陇县| 彭阳县| 黄陵县| 南部县| 闽侯县| 积石山| 龙里县| 林州市| 股票| 剑川县| 大洼县| 墨竹工卡县| 资阳市| 岳阳市| 银川市| 双城市| 宜阳县|