in reply to Array of Hashes
so I tested using sub getOneRow, which works as expected, proving the dereferencing is correct.
Unfortunately not. In each sub you are not pushing a hashref onto the array (as you should) but instead pushing a hash, so the array essentially becomes the hash. To fix, in your subs push the hashref on:
push @data, $rowref;
and in your calling routine iterate over each hashref rather than hash:
foreach $row (@data) {
Otherwise, please investigate placeholders now before little Bobby Tables comes to tea.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Array of Hashes
by Ken_M (Initiate) on Feb 07, 2019 at 14:05 UTC | |
by hippo (Archbishop) on Feb 07, 2019 at 14:26 UTC |