That does not imply that you have to use substr or vec. Perl generally manages things for you as long as you use the same variable name. Part of the design of Perl was to not throw away information on the previous high-water mark when using a particular variable--even lexicals remember how much space they needed from the last time through, and assume you'll use that much again the next time through the loop or sub. Benchmarks on .= will produce much faster results the second time through, provided you don't recreate the actual variable.
In reply to Re: Re: what's faster than .=
by TimToady
in thread what's faster than .=
by xafwodahs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |