in reply to Deleting internal array elements
However, I should warn you that if that array is likely to be large, you are going to spend a lot of time looking through the array for the first element of each row in your file.
You could also use a hash for both purposes: Put the elements you are looking for into the hash as keys, with some arbitrary value (say, 1), as values. Keep a count of the keys you put in with a simple scalar.
Then instead of looking through an array for your row element, you simply test $hash{$row[0]}. If you want to avoid finding duplicates, you can delete $hash{$row[0]}, and it will no longer match. Decrement the count of keys each time you make a match, and when it reaches 0, you will know you no longer need to read the file.
|
|---|