in reply to Storing 10 numbers in array

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.

Replies are listed 'Best First'.
Re^2: Storing 10 numbers in array
by jose_m (Acolyte) on Mar 25, 2012 at 22:25 UTC

    all in the scope snakeyes