print $condition ? ($a=~s/foo/bar/, $a)[1] : $a;