I read the "I need to compare two arrays and then execute addition code depending on whether or not there is a value in @b that does not have a match in @a." as wanting
an if statement testing whether
all the values in @b are in @a, not an if statement for each element in the array. It could have been meant the other way, but given the code posted, I think it unlikely.