in reply to Re:{6} how do I line-wrap while copying to stdout?
in thread how do I line-wrap while copying to stdout?
Still the principle that merlyn stated is correct, and is a common performance mistake in parsing. Try it with a 1 MB string. If substr still wins then I guarantee you that someone implemented a buffering strategy with strings and substr where doing a destructive substr at the beginning of a string just moves indexes around and does not recopy.
Perl plays a lot of games like that, for instance that is why push, pop and friends are fast. I am just a little surprised to see it played on strings...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re2: how do I line-wrap while copying to stdout?
by tye (Sage) on Apr 20, 2001 at 20:34 UTC |