Perl Benchmark IN sub with grep

If you miss the IN function in Perl like the function in PL/SQL, then you could use grep and an array to check this:

I made a Benchmark to check how fast his solution is:


We see the normal way is the fastest and you could use an defined array to speed up by 7%. The Code is short but much slower than an or comparison.