in reply to Handling STDERR and STDIN in Perl

But the program still does not wait for STDIN. Consider $cmd = /home/script.pl where: script.pl contains: #!/usr/local/bin/perl $a = <STDIN>; print $a; Here the program doesn't wait for STDIN. This is my requirement.

I'm not sure about your exact situation, but I've used the following trick to get STDIN from a program that I have opened with IPC::Open3. You need to capture the output from IPC::Open3, and test it with a regex for your prompt. Then:

{ local *STDIN; open( STDIN, "< /dev/tty" ); my $ok = <STDIN>; }
Then write it to IPC:Open3.

I'm not really a human, but I play one on earth. flash japh