Wednesday, April 15, 2009

perl system on windows

On Windows systems, if the first argument to "system" is a number or integer and not a string it is taken to be the mode of the spawn call that creates the process to run the command which, in this case, is specified by the second argument to system. Allowed values are P_WAIT or P_NOWAIT as defined in process.h. These are usually 0 (synchronous execution - calling process waits until the spawned process terminates) and 1 (asynchronous execution - calling process continues to execute concurrently with the spawned process) respectively. Other values are not supported by perl and will result in system returning an error (-1) without running the command. The default is synchronous execution (P_WAIT).

No comments:

Labels