in reply to Non-destructive string substitution
Is there any benefit to avoiding the named temp variable? Speed? Obfu?
I would prefer to see the autodocumenting nature of
In many cases the new value will be caught in another variable anyway. I'm guessing 'no temp' is only interesting if the value is passed to another operator/function immediately, like print or perldoc:length, for instance.($bar = $foo) =~ s/foo/bar/g;
It's also not a trivial exercise to devise a correctly formed Benchmark that demonstrates the difference.
-QM
--
Quantum Mechanics: The dreams stuff is made of
|
|---|