From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079072816003.tru64-unix-managers.marc@archive.invalid> From: Rob McMillin Date: Fri, 10 Sep 1999 02:38:59 +0000 To: tru64-unix-managers Subject: TU64 4.0D, Perl 5.00502: need bidirectional write X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079072816003 BTW, this is using Compaq Tru64 Unix v 4.0D and Perl 5.005_02. I've been checking all over hell and gone and so far with no success. Normally I wouldn't write to the Tru64 Unix Managers list, but this looks like an OS-specific Perl problem. Essentially, what I want is the ability in a Perl script to open a file descriptor for a process on both ends, i.e., what open (READ,WRITE,"| some_process |") should intuitively do if that syntax worked. I know about open2/open3, but they come with caveats that if you can't control pipe buffering in the child process, you may as well not bother. Since the process we want to read to and write from is a third-party binary, it fits that description. The perlipc man page suggested I look at the Comm.pl package, but when I tried the following sample program (modeled after the one in the docs): ----- #!/usr/extra/bin/perl require "Comm.pl"; &Comm::init; ($proc_pty,$proc_tty,$proc_pid) = &open_proc("cat -n"); for (1 .. 3) { $l = "line $_"; print $proc_pty "$l\n"; print "sent '$_', got back ",scalar <$proc_pty>; } ----- I get results that look like this: ----- sent '1', got back line 1 sent '2', got back line 1 sent '3', got back line 1 ----- Clearly, something's going wrong. It looks like Comm.pl is breaking because of the obscure pty code therein. Is anybody out there doing this and having success? -- Robert L. McMillin | Not the voice of Syseca, Inc. | rlm@syseca-us.com Personal: rlm@netcom.com