in reply to Substituting without modifying

That's syntactically equivalent to a two-step operation:
my $qux = $foo; $qux =~ s/bar/quux/;
It just takes one line of code, so it's more idiomatic. There's absolutely nothing wrong with it, and I quite like it myself. There are only two things you might run into -- programmers who don't understand the idiom, and the looks of a my inside braces.

If it makes your life easier, go for it.