When running the code I get -1 from wait and 0 from system. $! tells me No child processes. That makes sense since both system also does a wait.
Why are you using $SIG{CHLD} with system? You shouldn't wait for a child launched using system.
In reply to Re^2: system() returns -1 with $SIG{CHLD}?
by ikegami
in thread system() returns -1 with $SIG{CHLD}?
by cmv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |