I find the spec unclear.

What do you mean by matches? Do you mean a field in line 1 of file 1 happened to be the same as a field in line 2 of file 2? Does it matter if the match is between field 1 and field 5, or do the fields in question have to match up?

Without being able to state a clear spec, it is hard to meet it.

Anyways, some tips.

  1. However you solve the problem, it will probably help to have nested data structures. And for that it will help to read through References quick reference.
  2. To see if an actual data structure looks like you wanted it to look like, you can try Data::Dumper.
  3. Any problems of the form "This matches something in that list" are usually best handled in Perl by taking that list, and turning it into a hash, then doing a hash lookup.
  4. Take things one step at a time. If the full problem is too much for you, just find a piece you can handle. For instance figure out what internal data structure you want to use, and then inline some sample data in your script and try to work with that. Once you can get an answer from the parsed data, then worry about building a piece that reads the file into that structure...

In reply to Re (tilly) 1: Comparing fields in 1 database with fields in another by tilly
in thread Comparing fields in 1 database with fields in another by rline

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.