Perl never ceases to impress me. Also, shame on me for not doing my own benchmarks. I did know the if-approach would not scale well, but the OP seemed to be looking for a solution to a problem who's "search domain" was relatively small (3 elements in the example). But you have brought to light something I would never have expected.