Mark Reed skribis 2005-05-25 10:49 (-0400):
> [1,2,3] is not an array or a list.  It is a reference to an anonymous array.
> It is not 3 values; it¹s 1 value, which happens to point to a list of size

Just for accuracy: it points to an array, which is still not a list in
our jargon.

> 3.  If you assign that to an array via something like @a = [1,2,3], I would
> expect at least a warning and possibly a compile-time error.
> 
>  If it does work, it probably gets translated into @a = ([1,2,3]), which

That's not a translation. Parens, when not postfix, serve only one
purpose: group to defeat precedence. $foo and ($foo) are always the same
thing, regardless of the $foo.

> I¹m not sure about +(@a[0]), but I¹m guessing it would == 3.

Because parens only group, and [0] here has tighter precedence than the
prefix + anyway, +(@a[0]) and [EMAIL PROTECTED] are exactly the same. 

Because @a[0] is a reference to an array, that array is @{ @a[0] }. [EMAIL 
PROTECTED]
@a[0] } is also the same as [EMAIL PROTECTED] 

The numeric value of an array reference is the same as that of its
array.


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html

Reply via email to