$string = "foo, this foo is just a foo"; $string =~ s/foo/bar/g;