We don't bite newbies here... much | |
PerlMonks |
Re^2: Various ways to concatenating an array of stringsby hawtin (Prior) |
on Mar 30, 2006 at 19:49 UTC ( [id://540257]=note: print w/replies, xml ) | Need Help?? |
As I said in my original post I rejected join() for some good reason months ago. All your reply says is that join is the most obvious solution (which I agree it is), but it didn't work in my case. Thank you for your input but your test of course proves nothing, my issue was with thousands of differently sized strings not 8 strings the same size. If I rewrite your test as:
Then the results are:
Having played with this I now recall that the efficiency problem was not with speed but with memory usage. Under some pathalogical cases the join was consuming vast quantities of memory (that was under a previous version of Perl and maybe I should study it again). So thank you for helping me illustrate that pack is quicker than join (in some cases) :-)
In Section
Seekers of Perl Wisdom
|
|