I'm no expert, but I'm pretty sure the commands in a normal perl script are executed sequentially. I.e. it's not possible for a command to start executing before the previous one completed, not without threading.
in reply to Find and Replace multiple values in a file.
Try closing the OUT filehandle before you open the same file with a different handle. In my experience, perl will often only write (some of) the changes to disk when the filehandle is closed.
So, remove all those sleeps and go
open (IN2, "+<_G203.xml");