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

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.

主站蜘蛛池模板: 运城市| 华容县| 栾川县| 阿尔山市| 临潭县| 桐庐县| 刚察县| 扬州市| 柞水县| 海宁市| 宣威市| 广宗县| 靖西县| 板桥市| 安溪县| 芒康县| 澎湖县| 镇坪县| 新河县| 永宁县| 石家庄市| 漳浦县| 南丰县| 大埔县| 六枝特区| 朝阳区| 文水县| 西安市| 柘荣县| 容城县| 龙门县| 张家口市| 大荔县| 泰宁县| 图片| 密云县| 泌阳县| 濮阳县| 黔东| 黄龙县| 偃师市|