in reply to Re^3: Converting multiple spaces to nbsp
in thread Converting multiple spaces to nbsp

I think you are right about the execution speed. It would be interesting to benchmark.

I would like to think that my solution is slightly easier to understand, but I consider that I am writing toddler Perl (up from baby Perl) and still have a lot to learn. And I have learned from your answer, thank you.


Perl is Huffman encoded by design.
  • Comment on Re^4: Converting multiple spaces to nbsp

Replies are listed 'Best First'.
Re^5: Converting multiple spaces to nbsp
by Cap'n Steve (Friar) on Jun 17, 2005 at 07:20 UTC
    I thought it was a little easier on the eyes, too. I'm surprised the look behind is faster.

      We don't know that yet, but I'll play with benchmarking it this weekend.

      My guess is that the look behind translates into a "find a space, slurp any more spaces, do the replace". My version does similar work in the search phase, but does more work in the replace phase.


      Perl is Huffman encoded by design.