in reply to Filling an array
Note that all these solutions give 101 values, the 0th value being the first and the 100th value being the hundred-and-first. If you want only the first 100, do (0 .. 99) instead.my $multiple = 3; my @arr = map { $_ * $multiple } (0 .. 100); # Or, you could do a for-loop my $multiple = 3; my @arr; $arr[$_] = $_ * $multiple for (0 .. 100);
------
We are the carpenters and bricklayers of the Information Age.
Vote paco for President!
|
|---|