So you want each row to be stored in it's own hash, right? So if you've got 2 columns per row called "ID" and "value", you'd want to be able to access them like this?:
my $value = $rows{$ID}{value}
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 @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;
}
Hope that helps...
Hot Pastrami