in reply to How to compare Array values??

Your code doesn't match what you say.

Do you want to check to see if the first element of Array1 contains the literal string $Array2[0] ? Because that's what your code does.

If, instead, you have a regex stored in $Array2[0], and you want to use that to attempt to match against the string stored in $Array1[0], you need to not quote the variable:

if ($Array1[0] =~ m{$Array2[0]}) { print "PASS\n"; }