in reply to Non-destructive string substitution

Does this generalize into a quest for an anonymous scalar? [Note: the OP is asking for new scalar either way -- only the name is eschewed.]

Is there any benefit to avoiding the named temp variable? Speed? Obfu?

I would prefer to see the autodocumenting nature of

($bar = $foo) =~ s/foo/bar/g;
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.

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