in reply to what difference does a command run in shell and in perl

Given the format of file you are reading, Config::IniFiles might do a better job at giving you the key / value pairs that you can then dump in another file.
It can handle multi-line values that your simple replace breaks, see Parameter Files in the Oracle DB ref
  • Comment on Re: what difference does a command run in shell and in perl