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

  • 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.

主站蜘蛛池模板: 安义县| 阿坝县| 方正县| 鲁甸县| 贵溪市| 托里县| 远安县| 乌海市| 静宁县| 封丘县| 抚松县| 英德市| 尼玛县| 信宜市| 南京市| 辽中县| 深圳市| 玉门市| 芜湖县| 洪雅县| 古浪县| 盘锦市| 霞浦县| 盐津县| 中超| 漳州市| 桃源县| 江川县| 青田县| 仁怀市| 宣化县| 玉龙| 东乌珠穆沁旗| 通许县| 南雄市| 湘阴县| 余姚市| 富阳市| 原阳县| 鄂伦春自治旗| 石楼县|