in reply to Substituting without modifying
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.my $qux = $foo; $qux =~ s/bar/quux/;
If it makes your life easier, go for it.
|
|---|