home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 4898 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  1.3 KB

  1. Path: sparky!uunet!caen!sol.ctr.columbia.edu!ursa!buzz
  2. From: buzz@toxicavenger.bear.com (Buzz Moschetti)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: Process question...
  5. Message-ID: <BUZZ.92Jul22205552@toxicavenger.bear.com>
  6. Date: 23 Jul 92 00:55:52 GMT
  7. References: <1992Jul22.231637.23043@cs.unca.edu>
  8. Sender: news@ursa.UUCP
  9. Reply-To: buzz@fsrg.bear.com
  10. Organization: Bear, Stearns & Co. Inc.
  11. Lines: 24
  12. In-reply-to: mcmahan@cs.unca.edu's message of 22 Jul 92 23:16:37 GMT
  13.  
  14. In article <1992Jul22.231637.23043@cs.unca.edu> mcmahan@cs.unca.edu (Scott McMahan -- Genesis mailing list owner) writes:
  15.  
  16.    This has stumped me.
  17.  
  18.    I want to fork off a process, but be able to read the forked 
  19.    processes' stdout in the parent, as well as feed the forked process
  20.    stdin from the parent. Preferably an execed process. :)
  21.  
  22.    ________________
  23.    | main  ^    V |
  24.    ________|____|_|
  25.       ?|   ?|         stdin   __________________
  26.        |    |---------------->| forked process |
  27.        |                      -----V------------
  28.        |<--------------------------| stdout
  29.  
  30.    How to do this in perl has baffled me, and I don't see it in the FAQ. 
  31.    I suspect there's some kind of file or pipe involved, but beyond that
  32.    I'm lost.
  33.  
  34.    [...deleted...]
  35.  
  36. Check out Randall's chat2.pl in your perl's library distribution.  It
  37. uses pty's, but you can probably hack to suit your needs.
  38.