Perl script to verify that a value is present in an array (list)

I have 2 files , i need compare both files field by field, and in the fourth field some value will be interchaged and some value will be **.
ex:

file1 john|0.0|4|**:25;JP:50;UY:25
file2 john|0.0|4|JP:50;**:25;UY:25

Post desired output for those two sample files.

And what are you expecting the output to be when you compare these two files?

If the same data appears multiple times (e.g., 25 apears twice in the 4th field of both files), does it matter if they appear the same number of times or only that the given value is present at least once? (Of course, this assumes that colon and semicolon are subfield separators in the 4th vertical bar separated field. You need to explicitly state what your field separators are since there are clearly other possibilities with the minimal sample you have shown us!)

How about showing us an example where some fields do not match and show us the desired output.

Output : both files are similiar then print first field along with PASS in file3 .
ex John -->PASS .
else print john-->FAIL, in 4th fourth field(mismatch).

---------- Post updated at 02:53 PM ---------- Previous update was at 02:19 PM ----------

suppose file 2, fourth field is JP:40;:30;UY:30
then output file3 should be john->FAIL, fourth field. because file1 fourth field has
john|0.0|4|
:25;JP:50;UY:25

Once more: PLEASE USE CODE TAGS. WIth what you have specified above, we have no idea whether the output you want in file3 is:

john->FAIL, fourth field. because file1 fourth field has john|0.0|4|**:25;JP:50;UY:25
john->FAIL, fourth field.
john-->FAIL, in 4th fourth field(mismatch).
john-->FAIL, in 4th fourth field
john-->FAIL
john -->FAIL
john ->FAIL
    or
john->FAIL

or something completely different.

You also have not specified what similar means. Is john|0.0|4|**:25;JP:50;UY:25 similar to john|0.0|4|JP:50;**:25;UY:25 , john|0.0|4|JP;50;**;25;UY;25 , john|0.0|4|JP:25;**:25;UY:50 , and john|0.0|4|JP:50;**;UY:25 ? They all contain the same numbers. They all contain the same character strings. They all contain "**". Please explain what criteria is used to determine if they are similar?