-1 or other -x (negative numbers) in slices, can only work with commas, but not with ..
Nope. The point is that ".." counts up. These work:
@letters = ('a'..'z'); say for @letters[-5..-1]; say for @letters[reverse(-1..0)];
In reply to Re^3: Slicing an array variable with a -1 or any negative number doesn't work
by shmem
in thread Slicing an array variable with a -1 or any negative number doesn't work
by igoryonya
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |