in reply to Re: Loop through 2 files in parallel
in thread Loop through 2 files in parallel

The Perl Cookbook might be helpful here "Finding elements in one array but not another".I'm with AndyZaft, putting each of these into an array and then doing your logic is the way to go.

Replies are listed 'Best First'.
Re^3: Loop through 2 files in parallel
by rwitmer (Initiate) on Nov 10, 2010 at 21:03 UTC
    This is a very good idea (the hash keys) but it won't work in my situation because the elements of the list are not unique. They can occur multiple times in the list, so how far along in the list you are makes a difference. I think you're right about the array. If I put each file into an array I can keep track of where I left off and move around. I was just trying to figure out how to do it without using an array because the lists are pretty long, 20K lines each. I guess that isn't much for Perl, but it would be better for keeping what's loaded into memory down if it wasn't all put into an array at once.