--- "David H. Adler" <[EMAIL PROTECTED]> wrote:
> On Thu, May 17, 2001 at 12:08:56PM -0500, John Storms wrote:
> > Is it possible to have an array of associative arrays?
>
> Technically, that's not *literally* possible. But you can have an
> array of *references* to hashes (as assoc. arrays tend to be called
> nowadays).
But the result is functionally the same, especially if you use
anonymous hashes.
my @a = ( { foo => 1,
bar => 2 },
{ tarzan => 'boy',
jane => 'girl' }
);
Now you should be able to say $a[1]{jane} to get 'girl'.
Be aware that [] is the anonymous array ref creator,
and that {} is the anonymous hash ref creator.
You might also look at
perldoc perllol # arrays, but the point holds
perlreftut
perlref
=====
print "Just another Perl Hacker\n"; # edited for readability =o)
=============================================================
Real friends are those whom, when you inconvenience them, are bothered less by it than
you are. -- me. =o)
=============================================================
"There are trivial truths and there are great Truths.
The opposite of a trival truth is obviously false.
The opposite of a great Truth is also true." -- Neils Bohr
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/