in reply to arrays, context, and print - oh my.
(1,2,3,4)[0] is an anonymous array containing 4 elements which is being subscripted to return the first element.
print (1,2,3,4) If it looks like a function it is a function. That's a function!
print scalar (1,2,3,4)[2] Rats - pocket reference fails me. I guess scalar binds more tightly to the array than does [] and you can't subscript a scalar.
print +(1,2,3,4)[3] Same as previous except that [] binds more tightly than + (again rats - [] not listed in precedence table!). + is a uniary operator.
|
|---|