open COMMAND,'-|','some_command'; $input=; #... bla bla $pid=fork #....bla bla waitpid $pid,0; #... bla bla