You have a typo in line 14 which is making both the parent and child run the child code and exit on the first time through the loop. Change . . . if %kid; to . . . if $cpid;.
After Compline,
Zaxo
In reply to Re^3: creating multiple instances of a process
by Zaxo
in thread creating multiple instances of a process
by sweetblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |