in reply to Ignore file in array without looping

You probably want
next if grep { $file =~ /$_/; } @array_code;