I would like to run a separate process in Perl (a command line PHP script). I would like to capture this processes output AND return code. Optionally I would like to be able to terminate the process and move on if the process takes longer than N seconds. What should I look into?
You can try IPC::Run.
IPC::Run - system() and background procs w/ piping, redirs, ptys (Unix, Win32)