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

Variable containers in Perl 6

There are three basic types of variable containers: scalars, arrays, and hashes. First, you will learn the basics of how to use them in code. Then, later in this chapter, in the Using built-in data types section, we will take a deeper look at the data types available in the language.

The structural type of the container is expressed by a special character called sigil. It always stands before the variable name and, in many cases, may be considered a part of it.

The name of the variable is an identifier. An identifier is a string of alphabetic characters, digits, underscore characters, and hyphens. The first character cannot be a digit or a hyphen. Alphanumeric characters are understood in the Unicode sense, so, together with hyphens, it is possible to create very expressive variable names. The identifiers are case-sensitive.

In the following sections, you will see examples of naming the variables. Notice that a variable is always preceded by a sigil, while bare identifiers may be function or class names, as we will see in other chapters of this book.

主站蜘蛛池模板: 东乌珠穆沁旗| 清徐县| 明光市| 白银市| 始兴县| 婺源县| 宜昌市| 小金县| 岫岩| 广宗县| 海林市| 玉树县| 新昌县| 云龙县| 安国市| 任丘市| 丽江市| 张家港市| 元江| 年辖:市辖区| 平顺县| 阳曲县| 寻乌县| 忻城县| 齐齐哈尔市| 永康市| 奈曼旗| 台前县| 嵊州市| 洞口县| 蛟河市| 永州市| 中阳县| 新源县| 桃园县| 兴文县| 义马市| 大连市| 弥渡县| 法库县| 苗栗县|