in reply to Re^2: Executing perl program from another perl program and capturing the output
in thread Executing perl program from another perl program and capturing the output
ould you explain why it isn't helpful,
Because CreateProcess() is the only way to spawn a new process on windows; and it only accepts a single string containing the runtime arguments.
If you supply system with the list form of arguments, they just get concatenated together, before being passed as the second argument to CreateProcess().
There is some attempt to apply intelligence to the concatenation process, but is does not handle paths with spaces (correctly):
win32_spawnvp(int mode, const char *cmdname, const char *const *argv) { #ifdef USE_RTL_SPAWNVP return spawnvp(mode, cmdname, (char * const *)argv); #else dTHXa(NULL); int ret; void* env; char* dir; child_IO_table tbl; STARTUPINFO StartupInfo; PROCESS_INFORMATION ProcessInformation; DWORD create = 0; char *cmd; char *fullcmd = NULL; char *cname = (char *)cmdname; STRLEN clen = 0; if (cname) { clen = strlen(cname); /* if command name contains dquotes, must remove them */ ...
About the dumbest thing it could do...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Executing perl program from another perl program and capturing the output
by Loops (Curate) on Nov 25, 2014 at 05:11 UTC | |
Re^4: Executing perl program from another perl program and capturing the output
by Anonymous Monk on Nov 25, 2014 at 08:37 UTC |