in reply to Deleting internal array elements

With regard to the size of your file you are parsing memory management vs speed will be a consideration.

You mentioned matching rows who's first element is found in an array. To step through your whole array for each row is a big expense. If your match array is 20 elements and you have 1,000,000 lines that means you have to loop 1,000,000 x 20 times. That's expensive!! For your match array you may want to make a hash instead and then check for the existence of the hash key

%hash = {'match1'=> 1; 'match2' => 1; } foreach $row (@file) { if (exists hash{$$row[0]}) { ## do something } }
Speed wise: splicing an array can be expensive, as NetWallah suggests, so try "undef". This though can be expensive memory wise for large arrays. You have to consider your uses and what is best.

Also speed wise its faster to read a file into memory and then do what you want on it, rather than process as you read from the file. Although a 3Gb is a LOT of file and you will be hardup to read all that into memory.
open (FILE, "<$file") or die $!; @file = <FILE>; foreach $row (@file) { ## do something with $row }
Just some things to think about.

Dean

Programming these days takes more than a lone avenger with a compiler. - sam