in reply to Program hangs while gathering external program output

If it's never going to need any more response than that, then this should do the trick - just change your open like so (of course I can't test this with your java app): open(RES, "echo \n | $program |") or die "Unable to run $program: $!\n"; Update: That's odd that it didn't work - I even tested it very simply using "dir /p", but perhaps it is a difference between Win95 and your platform.

--
I'd like to be able to assign to an luser

Replies are listed 'Best First'.
Re: Re: output to screen by hitting return key
by Anonymous Monk on Apr 19, 2002 at 01:13 UTC
    I think you are close. Create a file with a newline in it. Then do this:
    open( RES, "$program < mynewline.file |" ) or die $!;
    Of course I think you should use IO::Pipe for that...

    Who was it, Knuth?, that said, "Beware the above code... I havn't tried it."

      thanks for the response. It rocks! Any idea about the java exception problem in my previous post?
        redirect STDERR to STDOUT ?? Just a guess, but try this:
        "$program < newline.file 2>&1 |"
It didn't work.
by hdeng419 (Initiate) on Apr 19, 2002 at 00:56 UTC
    It didn't work. It seems the Java program never be called. the screen only display "ECHO is on." -Hui