$rows= @AoA; # more explicit: $rows= scalar @AoA; #only if all rows are the same size: $columns= @{$AoA[0]}; # == no. of columns in row 0