my @arrayA; while (...) { my @arrayB = ...; push(@arrayA, \@arrayB); # Ok }