$ perl -wle' $_="/foo/bar"; $foo="/foo/bar"; s/$foo/baz/; print' baz