I've written a perl script that opens two files which contain lists. I want to find items in the first list that are not in the second list. The script uses two foreach loops. The outer loop goes through each line of the first list, extracting the necessary item information. The inner loop goes through the second list, extracting the item information, then comparing that information to the item in the first list.
So, the idea is that, for each item in the first list, the script will loop through all items in the second list, looking for matches. The trouble is that the inner foreach loop only loops once. I had this same problem in PHP when looping through MySQL tables in nested while loops. The solution was to reset the index of the mysql data using mysql_data_seek for each iteration of the outer loop. How can I do this in perl with filehandles?