Keep It Simple, Stupid | |
PerlMonks |
Function speeds: lc() vs. eq vs. =~by Clownburner (Monk) |
on Apr 16, 2001 at 21:58 UTC ( [id://72886]=perlquestion: print w/replies, xml ) | Need Help?? |
Clownburner has asked for the wisdom of the Perl Monks concerning the following question:
OK, here's a quicky for you: I have a program that needs to check the results of a DBI call against a list of possible values, and set other variables based on that. Since this is supposed to run interactively and could have to evaluate a huge number of replies, speed is a huge factor. 'Effective Programming in Perl' says that the eq operator is faster than using a RegExp '=~', but what about if you have to do a case-insensitive search? Are multiple 'eq' operations faster than one RegExp? What about an lc() For example, which of these would run fastest: Thanks in advance... Signature void where prohibited by law.
Back to
Seekers of Perl Wisdom
|
|