in reply to pushing onto array is not working as intended..
This line:
push @{$records}, %record;
...should be:
push @{$records}, \%record;
...as you have everywhere else.
Update: Actually, that's not going to do what you want either. Change them all to:
push @{$records}, { %record };
With what you have, you'll end up with an array of references to the same hash. You want to construct a new hash every time you push, and the above syntax will do that.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: pushing onto array is not working as intended..
by ikegami (Patriarch) on Apr 08, 2009 at 21:23 UTC | |
Re^2: pushing onto array is not working as intended..
by spstansbury (Monk) on Apr 08, 2009 at 20:47 UTC |
In Section
Seekers of Perl Wisdom