in reply to Having issues with substitutions

choroba is always right. Here's more to consider–

use v5.14; { local $_ = "He's out bowling with Fred tonight."; s/Fred/Barney/; s/with (\w+)/against \U$1\E's team/; say; }

local and a scope block to protect $_. \U\E to uppercase and end. You could also do raw Perl in the right side of the s///e if you include the e for execute flag. say by itself because $_ is implied.