Also, @array[1] drives a list context whereas $array[1] would drive scalar context. Hence:
will behave differently than@array[1] = @another_array;
The former will put the index (i.e., the number of elements in @another_array minus one) of the last element in @another_array in the first element of @array; whereas the second will put the number of elements in @another_array in the first element of @array.$array[1] = @another_array;
Similarly, if you use @array1 as input to a function that behaves differently in list context vs. scalar context, the use of @array[1] will result in list context behavior, whereas $array[1] will result in scalar context behavior (hence, actually, the differences shown above in my example).
In reply to Re^2: What is the difference between $array[1] and @array[1]?
by ack
in thread What is the difference between $array[1] and @array[1]?
by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |