Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^5: Add new rows and data to array.by BillKSmith (Monsignor) |
on Mar 21, 2020 at 14:38 UTC ( [id://11114533]=note: print w/replies, xml ) | Need Help?? |
Now that I understand your requirements, I can suggest a faster algorithm. Replace the temporary array @extras with a temporary hash. Use ID values as hash keys. An inner loop to search for a match is no longer necessary - just use a hash look-up.
OUTPUT: Same as in Re^5: Add new rows and data to array. above
Bill
In Section
Seekers of Perl Wisdom
|
|