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.
In reply to Re: foreach with array elements problem
by spiritway
in thread foreach with array elements problem
by OnionKnight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |