in reply to Is there something faster than string concatenation?
Perl's strings aren't immutable so if you do:
Only the contents of $some_shorter_string needs to be copied.$some_long_string .= $some_shorter_string;
String file handles have all kinds of overhead and they're more a convenience - I'm surprised the non-oo version is that quick. Object oriented calls are slow in perl anyway relative to function calls.
The join version is pretty slow though. I wouldn't have expected that.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Is there something faster than string concatenation?
by rdj (Novice) on Dec 03, 2007 at 02:28 UTC | |
by Joost (Canon) on Dec 03, 2007 at 02:49 UTC | |
by tye (Sage) on Dec 03, 2007 at 07:07 UTC | |
by ikegami (Patriarch) on Dec 03, 2007 at 07:37 UTC | |
by eyepopslikeamosquito (Archbishop) on Dec 03, 2007 at 11:23 UTC | |
by tye (Sage) on Dec 03, 2007 at 19:21 UTC | |
by Joost (Canon) on Dec 03, 2007 at 12:59 UTC |