You declare a new variable @ten_array inside the loop, and assign one value to it. So the outer variable @ten_array (which really is a different variable) never stores any interesting value.
You should just push onto the outer variable.
See also: Coping with Scoping.
In reply to Re: Storing 10 numbers in array
by moritz
in thread Storing 10 numbers in array
by snakeyes52
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |