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

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.

主站蜘蛛池模板: 鹿邑县| 吴桥县| 石门县| 阳原县| 古蔺县| 城固县| 永善县| 塘沽区| 昌黎县| 林口县| 衡阳市| 上蔡县| 固安县| 凭祥市| 丹阳市| 九龙县| 胶南市| 尼勒克县| 庆元县| 繁昌县| 连平县| 普陀区| 招远市| 堆龙德庆县| 芜湖市| 伊金霍洛旗| 合川市| 万源市| 阳原县| 安远县| 霍山县| 绍兴市| 银川市| 石泉县| 民丰县| 西丰县| 蒲城县| 琼中| 手游| 旬邑县| 丹棱县|