Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
thanks for the Help!!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @array = (); ... foreach my $data ( @{ $sqldata } ) { # this is what I don't need anymore =code push @array, [ $data->{'code'}, $data->{'account'}, $data->{'name'}, $data->{'date'}, $data->{'street'} ]; =cut # I need a hash here my %rows; push @array, [ $rows{code} = $data->{'code'}; $rows{account} = $data->{'account'}; $rows{name} = $data->{'name'} ; $rows{date} = $data->{'date'}; $rows{street} = $data->{'street'}; ]; } print Dumper \@array;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Data into Array of Hashes
by toolic (Bishop) on Oct 23, 2015 at 17:17 UTC | |
by Anonymous Monk on Oct 23, 2015 at 17:28 UTC | |
by Laurent_R (Canon) on Oct 23, 2015 at 17:36 UTC | |
|
Re: Data into Array of Hashes
by stevieb (Canon) on Oct 23, 2015 at 17:26 UTC |