On Wednesday, July 10, 2002, at 01:31 AM, Janek Schleicher wrote:
> Shawn wrote at Wed, 10 Jul 2002 09:59:54 +0200:
>
>> I think what you are looking for is:
>> $avg_resp_time->[0]
>>
>> if you want to have the '@' at the front, I think you would need
>> something like this:
>> @{$avg_resp_time}[0]
>>
> What should be better written as
> ${$avg_resp_time}[0]
> if you want to access the value as a scalar :-)
>
>
> Cheerio,
> Janek
>
and, as someone pointed out, this does work:
$x = ['abc','def','ghi'];
print @$x[2]."\n"; # prints 'ghi'
but i couldn't tell you how perl reads this, except to say that '@$x'
dereferences and then '[2]' gets the array element.
but i don't know why a '$' isn't needed to tell perl you want the scalar
value of that element.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]