3 ms·
Perl vs. Php vs. Ruby
- foldr 17y agoI don't know who gave him that awful code for checking array membership in perl, but you can just do: grep { $_ == VALUE } @array and evaluate that in a scalar context. The intent of this is pretty clear if you know what "grep" does.