Syntactic Confectionery Delight | |
PerlMonks |
Re: Is there a cleaner way to write this code below, which includes derferencing references, that themselves have to be dereferenced?by hippo (Bishop) |
on May 05, 2022 at 17:22 UTC ( [id://11143600]=note: print w/replies, xml ) | Need Help?? |
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.
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 Section
Seekers of Perl Wisdom
|
|