in reply to Problem creating array
push(@result, ($i) x $count[$i]); [download]
Man you guys are good. You wouldn't believe the mess of loops I had trying to solve this problem. Thanks for everyone's help!
# With "x" for my $i (0..$#count) { push @result, ($i) x $count[$i]; } [download]
# Without "x" for my $i (0..$#count) { for (1..$count[$i]) { push @result, $i; } } [download]