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
    Seems to me you fixed the wrong line in your update. I consider
    %record = (); ... push @{$records}, { %record };
    much worse than
    my %record; ... push @{$records}, \%record;
Re^2: pushing onto array is not working as intended..
by spstansbury (Monk) on Apr 08, 2009 at 20:47 UTC
    Yes, that's exactly what I wanted.
    The syntax is NOT second nature yet...

    Thank you very much!

    Scott...