T
Tom
How to find the length of an "Array of Array of Array"
I get syntax error when i say $#fx[0][0][0]
I get syntax error when i say $#fx[0][0][0]
How to find the length of an "Array of Array of Array"
I get syntax error when i say $#fx[0][0][0]
Tom said:How to find the length of an "Array of Array of Array"
I get syntax error when i say $#fx[0][0][0]
Well, I'm yet to figure out what is causing the problem.
My data structure is a little complex (atleast complex for me)
$# {$g_Ao_TEList[$index]{$teIt}[0][0]}
<=== This doesn't works; infact i tried to store the count in
$lines which results nothing.
I have an "Array(1)" which references to "Array of Hashes" and the
value of each of the keys in the array references to an "Array of Array
of Array"
Now 'm trying to get the last index of the Array from "Array of Array
of Array".... Any pointers..
1"Tad said:Tom said:How to find the length of an "Array of Array of Array"
I get syntax error when i say $#fx[0][0][0]
Well first off, the $#array syntax does NOT give you the length
of the array, it gives you the last index in the array.
The @array syntax in a scalar context gives you the length of the array.
To find the length of your multi-dim array, simply apply "Use Rulefrom:
perldoc perlreftut
I usually do it in 3 steps:
my $length = @array; # pretend it is a regular old array
my $length = @{ }; # replace the _name_ of the array with a block
my $length = @{ $fx[0][0][0] }; # fill in the block with code that
# returns a reference to the
# right kind of thingy
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.