perryp has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I have a Perl Tk program that I'm writing that displays a listbox of items, after selecting those items, I'm now trying to search through a master file to locate the items selected from a list box. So my main question is, what is the best way to search through a master and detail file looking for matching records in both.
Best regards
Paul
There are MANY ways. Which is the better is up to your programming style and restrictions.
The simplest (and fastest) is to keep the master file in a hash and look up values there. If that would consume to much memory, there are two trivial ways of fixing that, either use a database interface to your file or search through it manually.