in reply to Re^2: "Answer" questions in an interactive program?
in thread "Answer" questions in an interactive program?

Does this behave differently on Windows?

Seems so:

c:\test>perl #!/usr/bin/perl -l my $cmd = q(perl -e "chomp(my $ret = <STDIN>); exit $ret+1"); my $pid = open CMD, '|-', $cmd or die $!; print CMD 98; close CMD; print "status from close: ", $? >> 8; waitpid $pid, 0; print "status from waitpid: ", $? >> 8; ^Z status from close: 99 status from waitpid: 99

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

Replies are listed 'Best First'.
Re^4: "Answer" questions in an interactive program?
by Anonymous Monk on May 11, 2010 at 12:26 UTC
    It worked! Thanks a lot to all of you!