in reply to Re^2: REGEX Non-Destructive Flag
in thread REGEX Non-Destructive Flag

 perl -ne '(my $foo = $_) =~ s/-/ /g;'

The assignment returns an lvalue which then gets the substitution run on it. Basically the same as yours, just in one statement.

--MidLifeXis