in reply to Re: Re: appending an array to a hash
in thread appending an array to a hash
This sort of breakdown will require you to know all column names and what order they appear in, but that shouldn't be too hard. If you have the column names in an array, for instance, it would look like this:my $value = $rows{$ID}{value}
Hope that helps...my @columns = ("ID","value","some_other_column"); my %rows; while (my @row = $sth5->fetchrow_array) { my %rowHash = (); for (my $i=0; $i < scalar @row; $i++) { $rowHash{$columns[$i]} = $row[$i]; } $rows{$row[0]} = \%rowHash; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(dkubb) Re: (5) appending an array to a hash
by dkubb (Deacon) on Mar 22, 2001 at 09:00 UTC | |
by Anonymous Monk on Mar 23, 2001 at 01:19 UTC | |
|
Re: Re: Re: Re: appending an array to a hash
by Anonymous Monk on Mar 22, 2001 at 16:54 UTC | |
|
Re: Re: Re: Re: appending an array to a hash
by Anonymous Monk on Mar 22, 2001 at 20:13 UTC |