Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!oliveb!amdahl!nsc!taux01!arielf From: arielf@taux01.UUCP (Ariel Faigon) Newsgroups: comp.lang.perl Subject: Question about two-sided connections to perl Summary: Is is simple to use perl for 'wrapping' interactive programs ? Keywords: popen pseudo-ttys process-connection Message-ID: <3196@taux01.UUCP> Date: 17 Jan 90 13:14:13 GMT Reply-To: arielf@taux01.UUCP (Ariel Faigon) Organization: National Semiconductor (IC) Ltd, Israel (Home of the NS32532) Lines: 31 --- Question no. 1: Is there a simple way to connect a perl program to both sides of a process ? i.e. I would love to be able to do something like: open(OUTPTY,"| some_program |",INPTY) ...; pipe input into 'some_program' and read its output in order to post-process it. Of course, suppose 'some_program' is "interactive" in nature and the 'pipes' are actually pseudo-ttys (otherwise, a deadlock between perl & 'some_program' is likely to occur). So I assume I can write to 'some_program' and read its immediate "reply" alternately. This brings me to: --- Question no. 2: Can I make 'some_program' that is connected to Perl, think it is writing into a pty instead of a pipe (actually what I need is that 'some_program' _output_ be unbuffered - note, I'm not asking about unbuffering perl-output which is simple). I'm afraid I'll need to write all the 'pty' stuff myself which I can do in 'C' in the first place. Any help ? -- Ariel Faigon, CTP group, NSTA National Semiconductor (Israel) 6 Maskit st. P.O.B. 3007, Herzlia 46104, Israel Tel. (972)52-522312 arielf%taux01@nsc.com @{hplabs,pyramid,sun,decwrl} 34 48 E / 32 10 N