Link to home
Start Free TrialLog in
Avatar of hank1
hank1

asked on

array of hashes

Have a hash (from ODBC $db->DataHash) and
want to place it into an array of hashes.  How?

while ($db->FetchRow()) {
   undef %Data;
   %Data = $db->DataHash();
   # concept  push @a, %Data;  # Yes, I know this doesn't come close.
}

Do I have to break up %Data into its key/value pair and

push @a, {key1 => value, key2 => value}

or is there a better way?
Thanks
Avatar of hank1
hank1

ASKER

Whoops.  Don't post here.  DELETE
Sorry guys.
ASKER CERTIFIED SOLUTION
Avatar of Sergy Stouk
Sergy Stouk
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial