|Just another Perl shrine|
grep with looped testsby Wiggins (Hermit)
|on Jun 06, 2014 at 15:16 UTC||Need Help??|
Wiggins has asked for the wisdom of the Perl Monks concerning the following question:
So, 5 years ago I was trying to solve (efficiently) 80 regexs run over a 10K document. That quest ended in success. Now I am wrestling with filtering out lines of an array that match any entry of an array of regexs I am giving 'grep' a shot but am having a problem generalizing a single test into multiple tests.
I want to replace that single regex with a loop over an array of 'qr's.
'return' shouldn't be the correct mechanism to tell grep true/false. But when I run this, the second print (@foo) produces nothing.
It is always better to have seen your target for yourself, rather than depend upon someone else's description.