Killing all the child processes created through Expect module

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hi all,
            sorry to bother you once again, but I am stuck with a
problem. This what I am doing:

                  1. I create an object by calling Expect->spawn().
                  2. Then I use this object to fire some commands
which are spawning another set of commands and so on.
                  3.  I am then calling $obj->pid() to get the pid of
the handle.
                  4. Now I want to   kill the  commands that were
spawned by  this handle.  So  i   am sending a kill signal to -$pid.  
($pid =pid of the handle).

                      But some times the child processes created
through the handle remain in the system. What is the reliable way to
kill all such child processes created through the handle?  Please help
me out of this.
                       I am using perl and Expect 1.15. A similler
query in the newsgroup comp.lang.perl.misc had no answers. So I
thought you could help me.


Site Timeline