kill $pid;
The first argument to kill should be the signal, not the PID. Since you didn't test the return value of kill you haven't spotted the error.
In reply to Re^5: Killing a child process
by hippo
in thread Killing a child process
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |