'faster' and 'most efficient' are often the subject of questions to PerlMonks and almost always the answer is one of:
- It depends
- Benchmark it
- It is fast enough
- Why does it matter?
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?
True laziness is hard work
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.