in reply to Deleting records from an array
You could avoid the loop within a loop issue if you would loop through the array one time and lookup the hash elements as you go. Instead of doing
you can doif ($fields[3] =~ $key) {
to check if the array element is in the hash.if( defined( $coll_key_hash{$fields[3]} ){
You didn't provide an example of your data but from your code it looks like it would work this way. Even with the approach of deleting array elements as they are used you would be rehashing (har har) a lot of data.
|
|---|