in reply to Regular expression matching or eq, which is faster?
'faster' and 'most efficient' are often the subject of questions to PerlMonks and almost always the answer is one of:
In this case I suspect all four answers apply. It depends on the version of Perl you are using. With 5.10 (I understand) the special case you are dealing with can be almost as fast as eq.
To find out, bench mark your actual use cases using Benchmark (but make sure you are testing what you think you are).
But in any case, either version is likely to be fast enough. Most likely if you are having performance issues your problem is elsewhere which leads right to:
Why does it matter?
|
|---|