in reply to Re: Problem creating array
in thread Problem creating array
>perl -wMstrict -le "my @count = (1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 3, 2); my @result = map { ($_) x $count[$_] } 0 .. $#count; print qq{@count}; print qq{@result}; " 1 3 1 1 1 1 1 2 1 1 3 2 0 1 1 1 2 3 4 5 6 7 7 8 9 10 10 10 11 11
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Problem creating array
by johngg (Canon) on Sep 16, 2009 at 22:44 UTC |