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

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.

主站蜘蛛池模板: 慈溪市| 自治县| 名山县| 长沙县| 永济市| 库尔勒市| 乐清市| 汉源县| 泊头市| 大竹县| 化隆| 石棉县| 娄烦县| 原阳县| 安泽县| 布拖县| 密山市| 大理市| 司法| 古丈县| 泽库县| 常州市| 建宁县| 当阳市| 灵川县| 东台市| 东明县| 滨海县| 大丰市| 龙井市| 望奎县| 南汇区| 鄂温| 张家川| 精河县| 洱源县| 西华县| 晋中市| 大化| 平武县| 澳门|