in reply to Replace string in one file using input from another file

The master-file is XML and therefore should be manipulated using XML tools, not direct manipulation as though it were a text-file. You can afford to read the entire file into memory using a tool like XML::LibXML and then manipulate the structure internally. Then, write out the modified XML, preferably into a new file so that the original input is not corrupted when if you make a mistake.
  • Comment on Re: Replace string in one file using input from another file