in reply to foreach with array elements problem
I don't think it works like that. You're apparently trying to assign all the values to $array[0], which I'm figuring isn't what you had in mind. If you're simply trying to put the index of the array into the corresponding array element, then perhaps you should consider:
foreach $i (1 .. 10) { $array[$i] = $i; }
... or words to that effect.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: foreach with array elements problem
by Errto (Vicar) on Oct 22, 2005 at 02:59 UTC | |
by spiritway (Vicar) on Oct 22, 2005 at 03:05 UTC | |
|
Re^2: foreach with array elements problem
by Anonymous Monk on Oct 22, 2005 at 03:25 UTC | |
by spiritway (Vicar) on Oct 22, 2005 at 04:25 UTC | |
by spiritway (Vicar) on Oct 23, 2005 at 01:55 UTC |