in reply to Re^2: Problem creating arrayin thread Problem creating array
# 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]