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.
- 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.
- To see if an
actual data structure looks like you wanted it to look like,
you can try Data::Dumper.
- 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.
- 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...