in reply to Re: Help tightening up a subroutine please
in thread Help tightening up a subroutine please

First, grep goes over the whole list. If you only need to stop at the first successful match, don't use it. You can use List::Util::first instead.

For this particular application, a bandpass filter rather than a low pass filter, List::Util::first is no substitute for grep.

( Actually, first() isn't even a low pass filter as it returns a single value not a filtered list but...)


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."