$_ = "Child(x,y)"; $To = "Child(x,z)"; I need to substitute the above as s/$_/$To/ print $_;