in reply to Re: tr faster than eq?
in thread tr faster than eq?
Is it possible that perl was having to eval the strings each time the sub was called, thus skewing the results?
No, it's because they are evaluated somewhere without access to the lexical $string, so they act upon the undefined global $string. Your solution causes the test cases to be compiled where $string is still in scope.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: tr faster than eq?
by thor (Priest) on Mar 10, 2005 at 19:22 UTC | |
by ikegami (Patriarch) on Mar 10, 2005 at 19:41 UTC |