Look at
dialup spam removal with Net::POP3 and see what are called pre-compiled regexes from an array of strings.
Aristotle shows improved code, in his response. But the idea is to make precompiled regexes one time from your strings, then you loop thru your data only one time, checking all lines against the precompiled regexes.