in reply to Array reference
Since you have my @Result inside the loop, each iteration of the use creates a new @Result variable, which holds at most one item at the end of each iteration, because you push at most one line to it in each iteration.
$Outcome is a reference to the last of the arrays you create.
I guess what you actually want is to move the my @Result outside of the loop.
Also there's no reason for initializing the new array with () - my gives you a perfectly fine empty array already.
See also: Coping with Scoping.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Array reference
by Anonymous Monk on Jun 09, 2011 at 12:22 UTC | |
by moritz (Cardinal) on Jun 09, 2011 at 12:49 UTC | |
by Anonymous Monk on Jun 09, 2011 at 12:55 UTC | |
by DStaal (Chaplain) on Jun 09, 2011 at 12:52 UTC | |
|
Re^2: Array reference
by Anonymous Monk on Jun 09, 2011 at 12:48 UTC |