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

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.

主站蜘蛛池模板: 大新县| 崇仁县| 桃江县| 定远县| 夏津县| 宜城市| 江津市| 瑞丽市| 竹溪县| 宁海县| 宁河县| 通海县| 临朐县| 岢岚县| 鄂温| 陆丰市| 阿尔山市| 延长县| 台山市| 新兴县| 阿勒泰市| 平江县| 新河县| 平度市| 东阳市| 墨竹工卡县| 兴安县| 格尔木市| 石楼县| 辽宁省| 那坡县| 丰镇市| 鹤山市| 油尖旺区| 宁都县| 司法| 永济市| 西贡区| 兴安盟| 威信县| 南召县|