my $j=0; while ($j < $#AoA+1) { my @var = shift @AoA; my $a = $var[1]; my $b = $var[2]; }