XP is just a number | |
PerlMonks |
Re: "Useless use of a constant" in grep block?by Athanasius (Archbishop) |
on Jul 30, 2017 at 06:02 UTC ( [id://1196288]=note: print w/replies, xml ) | Need Help?? |
Hello perlancar, Tangential observation:
I think either the any or the none function in the core List::Util module would be better than grep in this case:
Not only are these clearer (since the reader doesn’t have to work out “what is grep returning here?”), but they’re also more efficient because — unlike grep — they short-circuit as soon as a match is found. Hope that’s of interest,
In Section
Seekers of Perl Wisdom
|
|