in reply to Re: Problem with system () in thread Problem with system ()
A few corrections:
- 'system() and die()' is not very easy to parse. I strongly suggest "system()==0 or die" or even "if (system()!=0) { die }".
- system() does invoke cmd.exe on WINNT, just as it invokes command.com on WIN9x and /bin/sh on UNIX. There is no need to $ENV{'COMSPEC'}.
- You say "using shell commands to set the current directory is not guaranteed to influence the current working directory of the parent." In fact, chdir() system calls in a sub-process do not affect the current working directory of the parent at all on UNIX or WIN32. You really want to use chdir() directly, as "chdir($dir) or die".
|