...because you only assign a new value to @Parse_Arr when there is no match, yet you print every time through the loop. So if there is a match, you don't assign a new value to @Parse_Arr, and so @ParseArr has the old value, i.e. from the previous line, which you then print.

You want something like this:

Code

next if $FirstPar =~ /Mystring1|Mystring2/ ;

print @Parse_Arr;

That way the print statement is skipped if there is a match.

By the way, your variable names are terrible. See how much clearer this code is:

Generally, you don't capitalize your variable names. Some people capitalize variable names that contain references to file handles, so that they look similar to bareword filehandles(which you shouldn't be using).