This may be a stupid question, but I didn't find an answer by skimming perldocs and google. My apologies if I missed an obvious answer somewhere.
Is there a built-in function to delete an internal element in an array and have the array automatically closer around it "in-place"? I'm looking for something like:
my @array = (1,2,3);
print join(',', @array);
# prints: 1,3
The reason I ask is that I am parsing a very large (3 GB) CSV file, and only keeping rows whose first element is found in an array. Each element in the array has only one matching row, so I thought it would be nice to just "remove" the elements as I go so that when the array is empty I could stop reading the file immediately.
I know I could implement this with a hash, but I got curious if there was a way to do this directly with arrays?