"Rob Richardson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Rob,
>
> I will take your word that "$a = (3, 2, 1);" returns 1. I think I was
> thinking of "$a = [3, 2, 1];", in which an anonymous array would be
> created and $a would return 3, the number of elements in the array.
>
> NOT!!!
>
Carry on answering your own questions like that and you'll put me out of my
night job :)
>
> The above is what I was going to say when I started typing this, but
> then I remembered. In "$a = [3, 2, 1];", $a gets a reference to the
> anonymous array. I was going to finish this thought with a way to get
> the number of elements in the anonymous array, but I realized I don't
> know how! Also, this question could be important in my current
> project. What's the best way to find the number of elements contained
> in an anonymous array to which you have a reference?
>
$a is the array reference
@$a is the array
@$a+0 (or scalar @$a if you prefer) is the number of elements
>
> Thanks yet again!
>
UR welcome
/R
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]