in reply to Re^2: writing perl function like sql IN
in thread writing perl function like sql IN
You forget to mention the other side of the trade-off: a hash trades memory for speed. grep will run in O(N), but also consume a lot less memory. It also requires a certain amount of work to set up the hash; if you're only going to test a particular set few times, it may well end up not amortizing that up front effort.
TANSTAAFL.
Makeshifts last the longest.
|
|---|