It may be silly but I haven't found a good solution in the documentation about how to initialize a fixed array, or multidimensional array on an easy way without iterating.
my @array[10] = [0,0,0,0,0,0,0,0,0,0];
my @grid[100;100];
I'd probably use the xx
operator. Something like this :
my @array[10] = 0 xx 10;
my @grid[100;100] = [0 xx 100] xx 100;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With