cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
But isn't there a more perlified way to do it using map or X? Surprisingly, searches have not turned up much except a down-voted answer on stack overflow.my @arr; for my $i (0..$n-1) { for my $j (0..$m-1) { $arr[$i][$j] = 0; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Initialize a 2D array with zeros
by tybalt89 (Monsignor) on Jan 17, 2024 at 01:06 UTC | |
by eyepopslikeamosquito (Archbishop) on Jan 17, 2024 at 05:30 UTC | |
Re: Initialize a 2D array with zeros
by etj (Priest) on Dec 10, 2024 at 14:54 UTC | |
Re: Initialize a 2D array with zeros
by harangzsolt33 (Deacon) on Jan 17, 2024 at 03:50 UTC |