Things in () separated by commas are called a list of things.
A list is an ordered set of scalar values.
Examples of lists:
Example 4-1. examples/arrays/list_literals.p6
#!/usr/bin/perl6
(1, 5.2, "apple"); # 3 values
(1,2,3,4,5,6,7,8,9,10); # nice but we are too lazy, so we write this:
(1..10); # same as (1,2,3,4,5,6,7,8,9,10)
('a'..'z'); # all the lowercase letters
("apple", "banana", "peach", "blueberry"); # is the same as
<apple banana peach blueberry>; # quote word
my ($x, $y, $z); # We can also use scalar variables as elements of a list
| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| undef, defined, not | List Assignment |