in reply to Seek one liner for distributing an integer
This produces the results you want in one run through @array - 5 steps - rather than $num steps. One of the other examples given above also attempts to do this, but I can't get the code to work, so here's mine.
NOTE: $n is created global here, overwriting any other global or local $n in use. I couldn't do a my statement without using a second line.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Seek one liner for distributing an integer
by ikegami (Patriarch) on Sep 22, 2004 at 15:22 UTC |