Try out the Process::Status class.