On Jan 25, 12:25 am, [EMAIL PROTECTED] (Sonal Singhal) wrote:
> So, what I want to do is go through an existing array and break the array
> into mini-arrays at any certain points (where the diff. in two bordering
> values are greater than 2000).  I programmed it as a recursive function, but
> I need to store all these "mini-arrays" and be able to sort them easily by
> "mini-array".  The problem with the array of arrays is I cannot get it to
> treat each row as an array.  Maybe if you can help me there...

That is non sensical. An "array of arrays" is just an array of
references to other arrays.  You use those array references the same
way you use any other array reference.

Have you read:
perldoc perlreftut
and
perldoc perllol
yet?

my @a_of_a = ( [ 1, 2, 3], ['a', 'b', 'c'], ['alpha', 'beta',
'gamma'] );
my @nums = @{$a_of_a[0]};
my @lets = @{$a_of_a[1]};
my @greek = @{$a_of_a[2]};


> Also, if I am dynamically allocating my array of arrays, how can I find out
> later my index values?

I don't understand the question.  The index values start at 0 and go
to the size of the array minus 1.   What are you actually trying to
accomplish?

If for some reason you think you need to know where in an array some
value (even another array ref) is stored, you're using the wrong data
structure.

Paul Lalli


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to