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

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.

主站蜘蛛池模板: 会同县| 栖霞市| 北宁市| 蚌埠市| 津市市| 石狮市| 静海县| 新源县| 榕江县| 凤冈县| 炎陵县| 星座| 昭苏县| 诸城市| 彩票| 郸城县| 北宁市| 重庆市| 仙游县| 禹州市| 庄河市| 西宁市| 正定县| 汤原县| 涟源市| 丘北县| 自治县| 麻栗坡县| 盐亭县| 五家渠市| 祁连县| 静海县| 平泉县| 安庆市| 武汉市| 通渭县| 大连市| 内丘县| 沙湾县| 宣威市| 广元市|