in reply to Multidimensional Hash
Assuming you are using DBI, the following template should give you a good starting point:
my %results = (); my $query = qq(SELECT id, col1, col2 FROM some_table); my $sth = $dbh->prepare($query); while (my $rh_row = $sth->fetchrow_hashref) { my $id = delete $rh_row->{id}; $results{$id} = { %$rh_row }; }
Regards,
PN5
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multidimensional Hash
by rnahi (Curate) on Aug 07, 2004 at 05:21 UTC | |
by Prior Nacre V (Hermit) on Aug 07, 2004 at 06:16 UTC |