Keep It Simple, Stupid | |
PerlMonks |
Re: Pushing Array ref to arrayby tobyink (Canon) |
on Feb 01, 2012 at 16:10 UTC ( [id://951257]=note: print w/replies, xml ) | Need Help?? |
Ditch your my @row near the top of the script, and do your loop like this:
In your current code, the scope for @row is too large, so you're effectively pushing multiple references to the same array onto @results. As a general rule, always declare a variable as close as possible to where it's going to be used.
In Section
Seekers of Perl Wisdom
|
|