in reply to Array of arrays problem

$MyArrayOfArrays[$i] holds "1", but $MyArrayOfArrays[$i][$a] expects $MyArrayOfArrays[$i] to have an array reference. In other words, contrary to the variable's name, it's not an array of arrays.

You should find the following useful:

use Data::Dumper; print Dumper \@MyArrayOfArrays;

Just guessing here, but you probably did
$MyArrayOfArrays[$i] = @some_other_array;
instead of
$MyArrayOfArrays[$i] = \@some_other_array;
at some point.