- 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.
推薦閱讀
- Advanced Machine Learning with Python
- JavaScript高效圖形編程
- Microsoft Dynamics 365 Extensions Cookbook
- Java開發入行真功夫
- 大學計算機基礎(第2版)(微課版)
- 深入理解Android:Wi-Fi、NFC和GPS卷
- INSTANT Adobe Edge Inspect Starter
- 代碼閱讀
- Natural Language Processing with Python Quick Start Guide
- Java EE 8 and Angular
- Get Your Hands Dirty on Clean Architecture
- Android 游戲開發大全(第二版)
- Data Manipulation with R(Second Edition)
- 算法超簡單:趣味游戲帶你輕松入門與實踐
- Unity虛擬現實開發圣典