in reply to comparing two arrays and displaying scalar matches
You want to check all patterns against all lines. That's two loops.
To avoid printing the same line more than once, you could join the patterns into one. That moves one of the loops into the regex engine.
|
|---|