If you evaluate an array in scalar context, it returns the length of the array. (Note that this is not true of lists, which return the last value, like the C comma operator, nor of built-in functions, which return whatever they feel like returning.)
behaves differently. It's subtle (at least to me). The LIST subscript gets the comma operator applied, but the ARRAY subscript gets the array length applied.@a=(0..9); @b=(4..6); $a[@b ]= qw/a b c/;
In reply to Re^3: Improper slicing
by schrodycat
in thread Improper slicing
by schrodycat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |