# push @tmp into 3rd dimension push (@{$AoA[$i]},@tmp); # push @tmp cell to 3rd dimension # testing for proper info, not tested foreach (@{$AoA}) { next if (defined($_) && ref($_)!="ARRAY"); push (@{$_},shift @tmp); }