Could I have written it better, cleaner, or safer?
Better and cleaner, yes. Your $data is an array of arrays and you convert it to an array of hashes by hand. Far better to have DBI do that for you.
return $dbHandle->fetchall_arrayref ({});
BTW, I would rename that variable. $db is your DB handle. What you have called $dbHandle is a statement handle. Anyone else coming to this code would be confused by that.
🦛
In reply to Re: Is there a cleaner way to write this code below, which includes derferencing references, that themselves have to be dereferenced?
by hippo
in thread Is there a cleaner way to write this code below, which includes derferencing references, that themselves have to be dereferenced?
by bartender1382
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |