in reply to Re^4: Whats quicker - passing along as variable to sub, or global var?
in thread Whats quicker - passing along as variable to sub, or global var?

Notice that in testing1() you're modifying the original string, so it's very likely the substitution does just plain nothing in all except the very first run.

In testing2(), you're starting with a new string every time.

So, that's probably skewing the benchmark.

  • Comment on Re^5: Whats quicker - passing along as variable to sub, or global var?