It took me a little bit to figure out multi-dimensional arrays, too. It is
actually much easier than it sounds at first. Essentially you fool Perl 4
by using commas in the key to an associative array. Perl, being the clever
guy that it is, joins the comma separated parts of the key with whatever is in
$; . By default $; is \034 , so, unless you plan on using that very character
as part of indexes, your indexes get joined together, behind the scenes. You
use commas, Perl uses \034, and you can have multidimensional arrays of as
many dimensions as you like. One neat feature of this scheme is that you
only create as many elements as you need - nice for sparse arrays. Here is
a trivial example:
$matrix{1, 2} = 75;
$matrix{3, 6} = 60;
$matrix{0, 0} = $matrix{1, 2} + $matrix{3, 6};
print "$matrix{0, 0}\n";
By the way, Perl 5 is much better at this kind of thing. It has true multi-
dimensional arrays.
Hope this helps.
Jim