in reply to Re: Problem creating array
in thread Problem creating array

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!

Replies are listed 'Best First'.
Re^3: Problem creating array
by ikegami (Patriarch) on Sep 16, 2009 at 15:10 UTC
    Even if you didn't know how to use "x" to do what you want, it's not messy to do it without "x".
    # 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; } }