in reply to Re: Re: Arrays: Last-index special variable vs. scalar values
in thread Arrays: Last-index special variable vs. scalar values
> If you did $x = (@ary1,@ary2); you'd get the last value of @ary2.Sorry, but that is not correct. The comma operator propagates the scalar context to @ary1 and @ary2. In scalar context, the array expressions turn into the number of elements in each array. So if @ary1 has 10 elements and @ary2 has 20 elements, the expression above is like $x = (10,20), and $x is assigned the number 20.
|
|---|