September 2017
Beginner
402 pages
9h 52m
English
The ^ operator is called the upto operator. It creates a range from 0 to the integer value of the operand:
say ^5;my $right = 5;say ^$right;
In the preceding code, Perl 6 prints the range in the form of ^5.
Let's use the range in a loop:
say $_ for ^3;
This one-line program prints 0, 1, and 2. Thus, the range does not include its upper boundary.
Read now
Unlock full access