$pid = open $pipe, "/some/program |"; while (<$pipe>) { ... # /some/program's output in $_ } close $pipe; # program gets a sigpipe if (kill 0, $pid) { # still there? kill 15, $pid; }