On Thu, 5 Jul 2001, Bob Mangold wrote:

> if I have a hash that contains array refs as its values and I create a
> reference for it, what are the different ways that i can access the information
> in the array?
>
> for example.
>
> my %hash;
> my @array = ('red','white','blue');
> $hash{'foo'} = \@array;
> my $hashREF = \%hash;
> print ${${$hashREF}{'foo'}}[1];
>
> now I know that will print "white". but is there another syntax that will get
> me the same result and is a little easier to read?

Yes, you can use the infix arrow syntax:

print $hashREF->{foo}->[1];

-- Brett
                                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
If you had any brains, you'd be dangerous.

Reply via email to