You cannot run 2 pieces of software that listen on the same port at the same time. If you do, the first one that gets the port will win, which means that the configurations associated with that software are what is used. So you are likely seeing an in-configured version of the apache running the perl scripts which is not set to parse them.
There is no reason to install multiple versions though. xampp is simply a bundle of software, and it does include apache. If you are trying to manually configure a second install of apache, this needs to be run on a different port if you intend to use them both at the same time. I don't know why you would do that though, you can just configure apache or xampp's apache to deal with the perl code as well.