If you need results in real time:
If, from Perl, the C++ spawn call is syncronous, you'll have to spawn the C++ app hundreds or more times, losing your speed advantage, and outputing the result in Perl each time. Alternatively, you'll need two SEPARATE Perl apps, one to launch the C++ app, and one to read in the data, in order to simulate asynchronisity.
If the call is asynchronous, you'll have to find a way from the C++ process to connect back to the Perl process; there is an easy way, named pipes. I've never experimented with them in Perl, the standard named piping package doesn't work in Windows apparently.
But the concept is simple; you have a named filehandle, that is connected at one end to the C++ program and at the other end to the Perl program, all data written by the C++ program can be read into the Perl program and outputted.
Effectively, it's polling a virtual file that is closed and opened very frequently; and that's the easiest way I can think to simulate it in a Windows environment. From the C++ app, open the file (watching for errors), write some data, close the file; if you hit errors, try to open it and write until no errors. At the same time, in the Perl app, in a loop, open the file (ignoring errors), if there's data, output it, then clear the file and close it. You may end up with some funny things going on. If you figure out how to write-protect or otherwise flag the file in windows, it'll be much more reliable.
Alternatively, if you don't need a reply in real time.
If the spawn call to the C++ program is synchronous, it's easy, return the output from the C++ process when the program finishes, and it should be the return value from the call in the Perl process. It should be as easy as that. If it's not, use a named file and read it in when the process finishes.
If the call is asynchronous, make the Perl program delete the named file, run the C++ process, and then loop in Perl until the file exists (When the C++ program makes it), or until the user presses some kind of escape key.
Should be easy
Matt