73: #initialize a value to count where we are in the array in order to 74: #delete the lines we do not need 75: my $i = 0; 76: my $item; 77: my $item2; 78: foreach $item (@data_file){ 79: foreach $item2 (@lines){ 80: if ($item =~ /$item2/){ 81: splice(@data_file,$i,1); 82: } 83: } 84: $i++ 85: } #### #initialize a value to count where we are in the array in order to #delete the lines we do not need foreach my $index ( reverse 0 .. $#data_file ) { foreach my $item ( @lines ) { if ( $data_file[ $index ] =~ /\Q$item/ ) { splice @data_file, $index, 1; } } }