open(CMD, "co_process_program |") or die "Error: $!\n"; while() { # each line of input will be in $_ } close(CMD);