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

Assignment operators

The = operator is an assignment operator. It is used to assign the value of its right-hand side operand to the variable on the left. In the simplest case, the operator is used like this:

my $a;
$a = 42;

The action is not limited to scalars only. Arrays, hashes, or instances of classes (we will talk about classes in Chapter 8Object-Oriented Programming) work are also processed as expected.

my @a = <10 20 30>;
my @b = @a;

Here, the assignment operator is used twice, first to initialize the @a array, and then to assign its values to the second array, @b.

主站蜘蛛池模板: 建宁县| 溧阳市| 麦盖提县| 堆龙德庆县| 油尖旺区| 驻马店市| 孟津县| 梁河县| 北安市| 濮阳县| 南和县| 丰县| 宁阳县| 新民市| 平昌县| 方城县| 前郭尔| 徐州市| 莱州市| 内乡县| 理塘县| 新邵县| 木兰县| 隆尧县| 怀仁县| 宽甸| 城固县| 柳州市| 九台市| 河间市| 蒙自县| 托克逊县| 旬邑县| 从化市| 眉山市| 林甸县| 从江县| 东安县| 朝阳区| 寿光市| 浦城县|