I'm aware of List::Util's any/none/first. Depending on the size of the list, grep or do { for ... } can be faster than List::Util's offerings because there is no subroutine call and argument passing overhead. Also there's a shortcutting variant of grep using eval { grep { ... and die } ... } idiom. I made a benchmark on this in Bencher::Scenario::PERLANCAR::grep_bool.
In reply to Re^2: "Useless use of a constant" in grep block?
by perlancar
in thread "Useless use of a constant" in grep block?
by perlancar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |