Here is a very tricky situation that happened with the following version of Perl (haven't checked it with other versions):
This is perl, v5.6.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2000, Larry Wall
Here is the applicatiob (in C) that I use inside the system call:
int main(int argc, char* argv)
Now, here is the Perl program:
Now, the result is that I get the "Hello World!" printed twice. This bizzare situation happen only when my application exits with -1 (other exit codes works fine) and when the mkdir command is used.
Any one have an idea? Is this a bug? Is there some work around that I can use? (My application must exit with -1, and I must create the directory). I'm not sure, but I think that it only happens if the mkdir fails because the directoy already exists.