programming-examples/perl/Statement/Using nested for loop to output the elements in a two-dimensional array.pl
2019-11-15 12:59:38 +01:00

18 lines
224 B
Raku

@array = (
["A", "F"],
["B", "E", "G"],
["C", "D"],
);
for $outer (0..$#array) {
for $inner (0..$#{$array[$outer]}) {
print $array[$outer][$inner], " ";
}
print "\n";
}