http://qs321.pair.com?node_id=759396


in reply to Clearing lines in a file based on an array containing the lines

You can eliminate the second "grooming" by comparing against your elements at the same time:

print FILE $LINE unless ($array[0] eq "$erasethese[0]" || $array[0] eq + "$erasethese[1]" );
As far as only opening the file once, you can try opening it for both reading and writing (+<)