in reply to Arrays in arrays, how to access them

You can't really have nested arrays the way you seem to think about them in Perl. An array is just a collection of ordered scalars. So, if you try to do something like this:

my @master_array = (1, 3, (5, 9, 4), 2, (8, 7), 6);

you will not get an array of arrays, but just a flat array containing all the values listed above, just as if you had declared it this way:

my @master_array = (1, 3, 5, 9, 4, 2, 8, 7, 6);

But you can nonetheless build nested data structure by the use of references: some of the scalars of your array might be references to other arrays.

For example you could do this:

my @subarray1 = (5, 9, 4); my @subarray2 = (8, 7); my @master_array = (1, 3, \@subarray1, 2, \@subarray2, 6);

Here, $master_array[2] contains \@subarray1, which is a scalar containing a reference to the @subarray1 array. You could now access the 9 value with the following syntax:

my $value = $master_array[2][1];

To change 9 to 10, just use it the other way around:

$master_array[2][1] = 10;

You can also use the [] array reference constructor to obtain the same result:

my $subarray1_ref = [5, 9, 4]; my @master_array = (1, 3, $subarray1_ref, 2, [8, 7], 6);

This gives you a first idea about what you can do, but you definitely need to read the documentation about Perl references and data structure to go further. The place to start is the Perl Data Structure Cookbook: http://perldoc.perl.org/perldsc.html.