in reply to using grep to search an array

Since you didn't show any input data, and you didn't elaborate on "I cant get grep to work", I can only guess at a couple of likely problems.

You might need to chomp your input:

chomp(@raw_data, @fileb);

You might need to use quotemeta on your regex:

$testit = quotemeta $_;

Misc advice: