- Perl 6 Deep Dive
- Andrew Shitov
- 110字
- 2021-07-03 00:05:56
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 8, Object-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.
推薦閱讀
- HTML5+CSS3王者歸來
- 高效微控制器C語言編程
- Mastering Articulate Storyline
- 算法精粹:經典計算機科學問題的Python實現
- Mastering OpenCV 4
- Building a Quadcopter with Arduino
- Mastering Google App Engine
- Python:Master the Art of Design Patterns
- Scala Reactive Programming
- 軟件項目管理實用教程
- JavaScript應用開發實踐指南
- Oracle數據庫編程經典300例
- H5+移動營銷設計寶典
- Neo4j 3.x入門經典
- Joomla!Search Engine Optimization