in reply to Running 'top' command (of linux) for few minutes and then come out of system command (of perl)
You can use IPC::Run's run method instead of system. and set a timeout.