- 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.
推薦閱讀
- UI圖標創意設計
- ASP.NET Web API:Build RESTful web applications and services on the .NET framework
- Developing Middleware in Java EE 8
- Clojure for Domain:specific Languages
- Data Analysis with IBM SPSS Statistics
- C語言程序設計
- bbPress Complete
- Canvas Cookbook
- Kubernetes源碼剖析
- CRYENGINE Game Development Blueprints
- Android應用開發實戰
- Building Slack Bots
- Instant Automapper
- Qt 4開發實踐
- 從零開始學算法:基于Python