Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- daniel kaplan
September 30, 2004, 7:31 pm
rate this thread
- Walter Roberson
September 30, 2004, 11:49 pm
:instead of just 
:does this have to do with multidimensial arrays?
perl does not offer true multidimensional arrays (i.e., contiguous
block of storage with item offsets calculatable by a fixed
arithmetic formula.) perl does, though, allow any element of an
array to be a *reference* to another array. Multidimensional arrays
in perl are handled by indexing along the first dimension to retreive
an array reference, then indexing that along the next dimension,
and so on until you run out of dimensions... and the result you get
back might be a reference to something rather than a numeric or string or
The answer to your question should now be clear: -> is the syntax
for selecting element 0 from an array reference, whereas  is
the syntax for selecting element 0 from an array (which you might
have reached by already having dereferenced an array reference you had
"There are three kinds of lies: lies, damn lies, and statistics."
-- not Twain, perhaps Disraeli, first quoted by Leonard Courtney
Indeed it has ;-)
Multidimensional arrays in Perl are nothing more but
arrays of arrayrefs. So you need to dereference the
child array before accessing its elements with -> notation.
Perl is already shipped with a good documentation on
that topic, see
- » TableExtract question - how to deal with headers with spaces?
- — Previous thread in » PERL Discussions