in reply to Typo or on purpose? Variable instantiation with string concatenation operator
my $str1 .= $self->sanitizeString($input1);
will do the same thing as
my $str1 = $self->sanitizeString($input1);
but it makes no sense to use the former.
The benchmarks show no difference in speed. (Anything under 1% is definitely meaningless. I question anything under 5%. I used kennethk's code, but changed timethese to cmpthese to produce more useful output, and changed the label to something meaningful.)
Rate concat normal concat 771935/s -- -1% normal 779433/s 1% --
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Typo or on purpose? Variable instantiation with string concatenation operator
by Crackers2 (Parson) on Oct 06, 2015 at 18:07 UTC | |
by ikegami (Patriarch) on Oct 07, 2015 at 19:37 UTC |
In Section
Seekers of Perl Wisdom