- 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.
推薦閱讀
- 程序員面試筆試寶典(第3版)
- Spring 5企業級開發實戰
- C++程序設計(第3版)
- Microsoft Dynamics 365 Extensions Cookbook
- C#程序設計
- Advanced Oracle PL/SQL Developer's Guide(Second Edition)
- Instant Nancy Web Development
- Kotlin編程實戰:創建優雅、富于表現力和高性能的JVM與Android應用程序
- Terraform:多云、混合云環境下實現基礎設施即代碼(第2版)
- C語言從入門到精通
- Learning Concurrency in Python
- 算法精解:C語言描述
- Kohana 3.0 Beginner's Guide
- 計算機應用基礎(Windows 7+Office 2010)
- Visual Basic.NET程序設計