Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^3: How to check if a variable's value is equal to a member of a list of valuesby LanX (Saint) |
on Mar 25, 2013 at 14:28 UTC ( [id://1025316]=note: print w/replies, xml ) | Need Help?? |
It should
Unfortunately all the use cases of smartmatch are hard to remember. For repeated lookups a prepared hash scales certainly better. You're free to check this with benchmarks or search for older discussions.¹ I hoped smartmatch could at least handle the stringification limitation of hashes, but nope:
Cheers Rolf ( addicted to the Perl Programming Language)
Update¹) Brian got deep into benchmarking :) http://stackoverflow.com/questions/3951812/how-fast-is-perls-smart-match-operator-for-searching-scalar-in-an-array
In Section
Seekers of Perl Wisdom
|
|