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

  • Perl 6 Deep Dive
  • Andrew Shitov
  • 186字
  • 2021-07-03 00:05:47

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.

主站蜘蛛池模板: 错那县| 邛崃市| 安塞县| 蒙城县| 平南县| 黑水县| 山西省| 鄂托克前旗| 上蔡县| 漯河市| 宁河县| 蒙山县| 宁化县| 博白县| 高密市| 西贡区| 南岸区| 农安县| 安塞县| 金华市| 文登市| 图片| 武川县| 林口县| 五华县| 玛纳斯县| 通榆县| 万年县| 连城县| 通城县| 安义县| 兴化市| 拜泉县| 普洱| 彰化市| 揭西县| 安康市| 崇义县| 苍南县| 个旧市| 肇东市|