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
In reply to Re: Multidimensional Hash
by Prior Nacre V
in thread Multidimensional Hash
by wsee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |