Q: How come when I automate the passwd program to change passwords for me passwd dies before changing the password sometimes/every time? A: What's happening is you are closing the handle before passwd exits. When you close the handle to a process it is sent a signal (SIGPIPE?) telling it that STDOUT has gone away. The default behavior for processes is to die in this circumstance. Two ways you can make this not happen are: $process->soft_close(); Which is new in 1.04. This will wait 15 seconds for a process to finish up before killing it. $process->expect(undef); This will wait forever for the process to match an empty set of patterns. It will return when the process hits an EOF.