# With "x" for my $i (0..$#count) { push @result, ($i) x $count[$i]; }
# Without "x" for my $i (0..$#count) { for (1..$count[$i]) { push @result, $i; } }
In reply to Re^3: Problem creating array
by ikegami
in thread Problem creating array
by Subop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |