You could run select on the filehandle you use to communicate with the interactive program. If it returns before the timeout, and marks the filehandle as ready for input, then the
program is waiting for you to send it data. If it doesn't, it isn't.
Re: finding the status of the program being called from perl
Replies are listed 'Best First'.
thanks. i think this is what i am looking for. but i'm getting really confused. besides perldoc.com, do you know where i can find more information about whether i should choose $sel->can_read or $sel->can_write? i think my perl script is becoming really confused, because what used to work is now not working anymore. and also, if i am using open2(*Reader, *Writer, $cmd), which filehandle, Reader or Writer, should i use to find out whether the interactive program is waiting for input? or do i use STDIN?