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

Replies are listed 'Best First'.
Re: File compares
by Cine (Friar) on Jul 31, 2003 at 12:48 UTC
    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.

    T I M T O W T D I