I have added a loop so that your comparison of one field against the row becomes a comparison of all fields against the row. That is what you wanted, no?
Have a look at each statement in that block one by one. If you don't understand anything there, try to find it in the documentation with perldoc. If you still don't understanding it you can say so here, specifying where you looked and how the documentation you read did not make it clear. You may also peruse the Tutorials here for further guidance.