in reply to Running 'top' command (of linux) for few minutes and then come out of system command (of perl)
I think you want to set timeouts in your subprocesses. Have a look at Timeouts and timers in IPC::Run.