Do you know where your variables are? | |
PerlMonks |
Re^3: Get all hash value into arrayby Marshall (Canon) |
on Feb 13, 2020 at 08:43 UTC ( [id://11112916]=note: print w/replies, xml ) | Need Help?? |
Hi Rolf!
Your approach implies that the data is essentially analog to a DB table. My approach not only implies a "flat", "de-normalized" DB table, that is what it is. This will work great for a few ten's of thousands of lines. I am not "losing the possibility to index by "zip"". When you get to say 100,000K+ lines, then I would recommend a DB like SQLite. Let the DB take care of indexing. There are to be sure a lot of "if's, and's and but's" with a DB. However the OP's data structure does not appear to me to be efficient.
From what I can tell, the use of the "zip" as a primary key doesn't make any sense. And the OP's hash structure is hard to search and inefficient. Yes, I do think that 1 loop is easier to understand than 3 loops.
In Section
Seekers of Perl Wisdom
|
|