* TU64 4.0D, Perl 5.00502: need bidirectional write
@ 1999-09-10 2:38 Rob McMillin
0 siblings, 0 replies; only message in thread
From: Rob McMillin @ 1999-09-10 2:38 UTC (permalink / raw)
To: tru64-unix-managers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-09-10 2:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-09-10 2:38 TU64 4.0D, Perl 5.00502: need bidirectional write Rob McMillin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox