An array in scalar context evaluates to the number of items in the array, but the array slice is a list.
An array slice is not a list, it's an array slice. Each operator (including the list operator, arrays and array slices) decides what it returns in each context. In scalar context, an array slice returns the last element of the slice. It doesn't return a list. It has nothing to do with lists.
In reply to Re^5: RFC: Context tutorial
by ikegami
in thread RFC: Context tutorial
by kyle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |