Think about Loose Coupling | |
PerlMonks |
Trouble using system() on Win32 machinesby ton (Friar) |
on Apr 17, 2001 at 04:14 UTC ( [id://73013]=perlquestion: print w/replies, xml ) | Need Help?? |
ton has asked for the wisdom of the Perl Monks concerning the following question:
I'm having some trouble using the system call in my ActiveState distribution of Perl (build 623). The system call seems to believe that its child process has finished when the child execs another command. Here's some illustrative code (saved to a file called 'test.pl'):
The program should be invoked with a number after it; the program then recursively calls itself with the next smaller number; using system for odds and exec for evens. On my Linux box, I get the following output: which is exactly what I expect. I get this output when I try to call the same script on my Win2K machine: D'oh! This is really messing up one of my programs, which is started by another program (through system) and has the power to update and restart itself (through exec); the parent program thinks that the child is done when it really just re-execed itself. Is this a bug in the ActiveState distribution? Can anyone think of a good way to get around this? Any help would be appreciated.
-Ton
Back to
Seekers of Perl Wisdom
|
|