>
-------
Where the .cpp files sits, it runs perfectly.
Is there any way to cd to the right directory to call the program?
rather than having coppies of the .pl file?
system("cd c:\temp\test.pl");
system("perl c:\\temp\\perl.pl");
You could of course pass your commands to the commandline interpreter:
system("cmd /C \"cd c:\\temp\" && \"perl c:\\temp\\perl.pl\"");
In this scenario, you should consider using the CreateProcess() function
from the Windows API (since your call wouldn't produce portable code
anyway). You can hand the working directory directly to the command. Also
you can define the process it's own environment, and you are not limited
in the possible length of the command-line parameters.
regards,
Alex