in reply to Problem creating array
my @count = (1,3,1,1,1,1,1,2,1,1,3,2); my @result; for (my $i=0; $i <= $#count; $i++) { foreach (1 .. $count[$i]) { push(@result, $i); } } print "\@count: @count\n"; print "\@result: @result\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem creating array
by AnomalousMonk (Archbishop) on Sep 16, 2009 at 16:56 UTC | |
by johngg (Canon) on Sep 16, 2009 at 22:44 UTC |