in reply to Re: finding the status of the program being called from perl
in thread finding the status of the program being called from perl
Oh, yeah you're right. I said that wrong. What I meant was, how do I know if that interactive program (being called from a perl script) is waiting for user input or currently processing some other commands that require no user input but only requires the user to wait.
Does that make any sense? i'm not very articulate, am i?
If it is of any help, that interactive program is ClustalW (an alignment program), which requires several user input (from a character user interface), before it will finally produce the final output in file form. However, in the middle of the program, it requires the user to wait for some processing before allowing the user to type some more input at the prompt.
My current code:
my $infile = "homologene1.fa"; my $pid = open2(*Reader, *Writer, "clustalw") or die "Cant open clusta +lw: $!\n"; Writer->autoflush(); Reader->autoflush(); STDIN->autoflush(); print Writer "1\n"; print Writer "$infile\n"; print Writer "2\n"; print Writer "9\n"; print Writer "4\n"; print Writer "\n"; print Writer "\n"; print Writer "1\n"; print Writer "\n"; print Writer "\n"; print Writer "\n"; # <----- i need to wait here before making more user input print Writer "x\n"; print Writer "\n"; print Writer "x\n"; close(Writer); close(Reader); waitpid($pid, 0);
you can probably tell i'm very inexperienced.
thanks for reading.
|
|---|