Basically, I am querying a database and I need to convert the resulting array to a hash.
I query the database as follows
my $sth = $dbw->prepare($sql);
while (@rows = $sth->fetchrow_array()) {
...
...
}
Now I need to create a hash, so lines [0] are the key and lines [1], lines [2], lines [3] are values. For each reading of the record, you must create a new hash key and set the appropriate values
If my tables look like
abc 2.3 2.4 2.5
def 3.2 3.3 3.4
ijk 4.5 4.6 4.7
The first record is read, and abc is the key, and numbers are the values ... so
source
share