in reply to Re: How to add more conditional statements in an efficient manner
in thread How to add more conditional statements in an efficient manner

"I am very skeptical that a hash approach can beat a simple numeric "if" approach for small n, say <10. Byte by byte string operations like calculating the numeric hash key of a string are just inherently slower than a single operation that compares 2 numeric values together."

It does not, but for most applications that call for Perl's qualities, the loss of speed is not even noticed. The OP used the word "efficient" in their title: efficient for whom? The computer or the developer? (rhetorical question)

  • Comment on Re^2: How to add more conditional statements in an efficient manner